6 ms·
This all assumes that you want most code to have the properties of compilers, but this seems misguided to me. Compilers don't handle complexity well, they're un
by Veedrac 9y ago
This all assumes that you want most code to have the properties of compilers, but this seems misguided to me. Compilers don't handle complexity well, they're unreliable and not stable against small random purtubations, naïve approaches tend to be inefficient and complex ones global, etc. A lot of this is just that they're solving a difficult task (converting terrible C code into less terrible assembly), admittedly.
- runevault 9y agoI 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).
- vicpara 9y agoLanguage design goes hand in hand with compiler's design. No wonder we have so many languages being born every year. Different mix of ideas being tried in each of them or forgotten lessons being rediscovered. Just taking a look at what D, Rust, Lisp and Scala proposes will give one the chance to ask crucial questions about what are the implication of that guarantee, pros, cons and how it will all work out.