3 ms·
The language used to implement the compiler and runtime system for a new language has no impact on what is possible in the new language. If the implementation l
by scott_s 11y ago
The language used to implement the compiler and runtime system for a new language has no impact on what is possible in the new language. If the implementation language does not natively support something you want in the new language, you can just implement that yourself, and it is then available to the new language.
For example, C does not natively support garbage collection, but Python certainly does. The most popular Python implementation is implemented in C.
- hellofunk 11y agoThanks for pointing that out. I'm not a language or compiler engineer so my sight wasn't big enough. I tend to think of a new language as a gigantic library sitting on top of another language, and just assumed that if the base language can't handle something like a persistent data structure, then the new language would struggle with that as well.
- kazagistar 11y agoThat is almost never an accurate way to think about it.
- dkersten 11y agoOnly a very small handful of languages are actually implemented like this. Its worth also pointing out that some languages that compile to C, still support features that C does not (for example, Chicken Scheme compiles to C and supports both garbage collection and continuations, neither of which C supports natively).
- masklinn 11y ago> for example, Chicken Scheme compiles to C and supports both garbage collection and continuations, neither of which C supports natively And GHC still allows compiling Haskell (lazy, functional, garbage-collected) via C (eager, procedural, manually managed).
- autoreleasepool 11y ago> I tend to think of a new language as a gigantic library sitting on top of another language That's a bad default assumption