3 ms·
I wonder if there are any ways to build simple to compile but still useful languages outside of just doing Lisp or Lisp-like.
by runevault 9y ago
I wonder if there are any ways to build simple to compile but still useful languages outside of just doing Lisp or Lisp-like.
- munificent 9y agoAlmost every language is less thorny than C because of C's context-sensitivity and the preprocessor. Pascal is a classic language that's useful but easy to compile. Any of Wirth's successor languages are too (occam, etc.). SML is a step up, but still not intractable. Java 1.0 might be fun.
- runevault 9y agoHm fair point. BTW I'd just like to say thank you for Crafting Interpreters, been going through it (in c#) and enjoying it immensely.
- munificent 9y agoThank you! That's great to hear. :)
- shakna 9y agoFORTH is probably the classic "easy to compile" language, and is quite a decent language in and of itself.
- UncleMeat 9y agoThe hard part of writing a compiler is not the lexing, parsing, type checking, or code generation. The hard part is the optimizing bit. There do exist languages that are more amendable to whole-program analysis but the things that cause problems are usually not obvious. Java, weirdly, is among the easier languages to analyze because its memory model happens to be very easy to work with (excluding nulls).