News for hackers. Stuff that matters.
Re:What can we learn from how compilers are designed? by runevault on Friday March 16, 2018 @05:03PM (#16604003)
I wonder if there are any ways to build simple to compile but still useful languages outside of just doing Lisp or Lisp-like.
Re:What can we learn from how compilers are designed? by munificent on Friday March 16, 2018 @05:18PM (#16604097)
Almost 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.
Re:What can we learn from how compilers are designed? by runevault on Friday March 16, 2018 @05:22PM (#16604122)
Hm fair point. BTW I'd just like to say thank you for Crafting Interpreters, been going through it (in c#) and enjoying it immensely.
Re:What can we learn from how compilers are designed? by munificent on Friday March 16, 2018 @07:18PM (#16604678)
Thank you! That's great to hear. :)
Re:What can we learn from how compilers are designed? by shakna on Friday March 16, 2018 @06:12PM (#16604363)
FORTH is probably the classic "easy to compile" language, and is quite a decent language in and of itself.
Re:What can we learn from how compilers are designed? by UncleMeat on Friday March 16, 2018 @08:14PM (#16604915)
The 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).