Hacker News new | past | comments | ask | show | jobs | submit login

Using Java was a poor choice (especially without the latest improvements such as records and switch expressions):

* new books should use more modern popular languages to age well and to attract younger audience

* on the JVM there are languages better suited for the topic (e.g. Scala by a large margin)

* There's already the "Language Implementation Patterns" book (https://www.amazon.com/Language-Implementation-Patterns-Doma...) which not only is great for teaching because of its pattern-based approach but also gives you real life skills (e.g. ANTLR is used in most big data query engines)




> new books should use more modern popular languages to age well and to attract younger audience

That doesn't make sense. Java is one of the most popular programming language, more popular than a lot of other "modern popular languages". The only languages more popular are either as old as Java (JavaScript, Python) or older (C, C++). C# might be one option, but it's close to Java, and I don't know if the support for Linux/MacOS was here at the time this book was started. Same thing for JavaScript and Python's popularity, which are relatively recent trends. On the other hand, Java has stayed and endured. It's still here and will still probably be here in 20 years.

> on the JVM there are languages better suited for the topic (e.g. Scala by a large margin)

Scala is less popular than Java, and harder to master. Once you consider Scala, you get into endless arguments about whether to use Scala, SML, OCaml, Haskell, etc.

> There's already the "Language Implementation Patterns" book

There is also "Writing an interpreter in Go" and "Writing a compiler in Go" that seem to cover the same ground. But I'm certain than more people know about interpreters and compilers thanks to these three books than thanks to any one of them.

> but also gives you real life skills (e.g. ANTLR is used in most big data query engines)

The majority of programming languages don't use a generated parser but a handmade recursive descent parser, because it's the best at error reporting. There's a good post about different parsing approaches by Laurence Tratt: https://tratt.net/laurie/essays/entries/which_parsing_approa.... Generated parsers are great for DSLs but that won't teach you how the programming languages that you use work.


Didn't think I'd see 'attract younger audience' and 'Scala' in the same sentence.

A lot of young people know Java because it's what they learned in school and because a lot of employers use it so it's the first thing they learn on the job.

In my opinion, the language is designed in a way that makes it easy to pick up for beginners. The lack of obfuscated operators and foot guns is a plus, and the language forces you to avoid doing 'clever' code golf things, too.


You sound pretty smart! How about writing that book for the rest of us?


ANTLR may be used in big data query engines but I can’t think of a single language I’ve ever used that had a parser written with it. I know you can grab off the shelf parsers with antlr for a bunch of languages, but who cares?

And frankly, Scala’s build tool is way too slow and would be a slog to use for this book.


SBT and Scala are the biggest productivity killers for me at work purely based on the slow build time and lack of proper documentation. That and every release the ecosystem makes some breaking change.


Yeah, SBT is pretty awful. I feel like Scala suffers from design by committee, and by being the choice language of certain types of Enterprise Software Engineers TM.


It is not a language for getting things done imo. Even IntelliJ can’t figure out what’s going on sometimes.


  > Language Implementation Patterns
I hear the code examples are in Java. I think that's unfortunate. (And a bit ironic about your post).


If you actually take the time to read the book Bob explains the choice.

And fwiw modern Java is decently expressive without adding the unneeded complexity of Scala or something similar.

edit: replied to the wrong post. /shrug




Applications are open for YC Winter 2023

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: