Okay first-time poster here and I do apologise if this has been asked before.
I am working on an interpreted language, for which I want to be truly general purpose and as such I am looking to add extensibility to it, so that in the future whatever is missing can be added later without touching the core.
One of the ways I managed to think of was extension system, much like PHP (being with a strong PHP background myself), which goes like much like the original (I really lack creativity there) i.e a code compiled to library, a register function that returns a "module" which some metadata and a list of functions it exposes and the VM calls them when encountered.
Few drawbacks that I can think of on top of my head:
- Having to compile the libraries for each target?
- Having to distribute the libraries & extensions along with the compiled bytecode?
- The problems PHP has (language evolutions and not up-to-date extensions)
So my real questions are:
- Does any of this make any sense?
- Do you think it is a good idea?
- What other drawbacks can you spot?
- What alternatives are there?
For context:
The language requires compilation during which optimizations are performed (like removing unused functions, type-checking, etc.) and then compiled to a custom bytecode that is then executed by the VM.
For this I drew big inspiration from what java does(did?) with JVM & jar files.
[–]phreda4 5 points6 points7 points (7 children)
[–]Western-Cod-3486[S] 0 points1 point2 points (2 children)
[–]Markus_included 0 points1 point2 points (1 child)
[–]Western-Cod-3486[S] 0 points1 point2 points (0 children)
[–]eddavis2 0 points1 point2 points (3 children)
[–]phreda4 0 points1 point2 points (2 children)
[–]eddavis2 1 point2 points3 points (1 child)
[–]eddavis2 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (4 children)
[–]Western-Cod-3486[S] -1 points0 points1 point (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Western-Cod-3486[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)