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

This is a scam. Take a look at the toc to see how many pages are devoted to the interpreter, the VM and so on. It is impossible to learn how to write a complete interpreter or compiler, (leave alone VMs etc) in such a small "book".

The blurb says

"Become the next Guido Van Rossum, Matz, Larry Wall or Rasmus Lerdorf by creating your own revolutionary programming language in a few days"

yeah right! :-D.

If anyone is really interested in learning to build an interpreter or compiler, here is a book list to work through in order.

(1) SICP (do all the exercises in Chapter 4 and Chapter 5). There is an incredible amount of learning there. Once you've done this, you can write a basic interpreter/compiler for languages with s-expression syntax. [The semantics can be anything you imagine]

(2) Essentials of Programming Languages. This will teach you how many language features work (lazy evaluation, object systems, static type systems ..)

(3) Lisp in Small Pieces - how to implement byte code compilers, macro systems, compilation to C, lots of good stuff here.

(4) A book on lexing and parsing so you can give your language any syntax you want. I prefer Modern Compiler Design by Gries. If you understand the first three chapters you can write your own lex/yacc equivalents. (the book has a lot more to it than these chapters, but it is the best I've seen on lexing/parsing).

(5) Now take a look at the source of your favorite language. ((Lua and the lcc compiler (it even has a book explaining its design) in particular, are very educational).

(6) If you are REALLY serious about optimization, Steve Muchnick's book, Advanced Compiler Design and Implementation.

I have all these books and have derived an incredible amount of learning and joy from them.

yes it is a bit of work, but it is fascinating journey. Enjoy.

EDIT: If you want to go deep into type systems (say you want to grok Haskell's type system from first principles, (or add OCAML like modules to your language, say) Benjamin Pierce's Types and Programming Languages - You are in good shape to work through this after you've finished EOPL




The source to Lua is quite good, though not commented heavily. There's a roadmap by Mike Pall at http://www.reddit.com/comments/63hth/ask_reddit_which_oss_co... , and some other notes on the Lua users's wiki at http://lua-users.org/wiki/LuaSource . Lua has been kept small for embedding, and its designers are adamant about portability, so the code is very clean. (It's also one of my favorite languages.)

Also, _Modern Compiler Implementation in ML_ by Andrew Appel (http://www.cs.princeton.edu/~appel/modern/ml/) is quite good. It uses SML, but is pretty understandable if you're familiar with OCaml or (perhaps) Haskell. I found it vastly more readable than the Dragon Book.


Your advice is good, but you're being a snob. The complexity of a simple compiler is not that high. My language (http://plausible.org/nasal) has a core of about 3-4000 lines of C, well under the size of the Unix kernel explained (very well) by Lions in his classic book.

Sure, language design is a deep field, with lots of subtlety and complexity. And people spend years studying it. That doesn't mean that every language requires a huge tome of background to implement.


"Your advice is good, but you're being a snob. The complexity of a simple compiler is not that high. "

Sure reccomending someone work through SICP chapters 4 and 5 (enough to write an ultra simple compiler/interpreter) is "snobbery". ;-)

So be it. :-P

That doesn't mean this book (referred to in the original posting) isn't a scam. It is.

Any reccomendation on the internet (including mine) is worth only the electrons it consumes. Caveat Emptor!

I've worked through the books I reccomended (and was careful not to reccomend great books like CTM which I have no experience of).

This is the best way I know how to get this knowledge. I am not claiming it is the most efficient method. feel free to provide better paths.

If that strikes you as "snobbery" , bleh to you ;-)


The part that strikes me as snobbery is your statement that you cannot learn language design from a small book. Based on my actual experience in the same regime, some of which involved reading books but far more of which involved thinking through code, I think you're just wrong.


"The part that strikes me as snobbery is your statement that you cannot learn language design from a small book. "

I stand by that. Design in any endeavor can't be learned from books, small or big. Before you can "design" you need the nuts and bolts skill to implement your designs.

The books I reccomended, if sincerely worked through, give you the nuts and bolts knowledge to implement the designs you do conceive. Reading through the source of languages you admire, will teach you a lot (I reccomended that too).

Since I never said you could learn language design (vs learning how to build interpreters and compilers - I started my reccomendation list with "If anyone is really interested in learning to build an interpreter or compiler, ..." -) by working though books, I fail to see what you are reacting against?

I maintain that a 44 page book (particularly this one which is an outright scam) doesn't have the space to cover even the basic implementation techniques, leave alone "design".

Please provide counter examples of such "small books" that teach "language design" if you disagree. One counter example is worth a lot of internet debate!

The shortest introduction I know capable of turning you into an interprter/compiler writer is Chapters 4 and 5 of SICP (and there is a lot of stuff in the previous 3 chapters that lead to these chapters).


Writing a compiler is pretty much trivial. Writing a good optimizing compiler is close to rocket science.


I doubt rocket science is as much harder than everything else as people make it out to be.


That is great advice if you are building an enterprise ready language, have no job and a year to devote to reading and digesting all that literature. This isn't an ivory tower book, it's how to bootstrap your own language quickly using open source tools (which is surprisingly simple once you know how, but very complicated if you don't know where to start).

I love when people create small books, video tutorials about complex subjects. They are an introductory peek at what is cool about a complex subject. Then you have the opportunity to learn more about the parts the interested you, rather than buying "Modern Compiler Design" and realizing you have no interest in writing your own lexer or parser.

Not to say the books/sites you recommend aren't great, they are just overkill.


" it's how to bootstrap your own language quickly using open source tools (which is surprisingly simple once you know how, but very complicated if you don't know where to start)."

You can't "bootstrap a language quickly" using open Source tools unless you already know what you are doing.

Learning how to build a decent language (leave alone an "enterprise ready" whatever that is) language does take more than a few days. Promises to make you the next Matz and Guido "in a few weeks" is outright fraud.

"rather than buying "Modern Compiler Design" and realizing you have no interest in writing your own lexer or parser."

It is obvious you haven't read the book before making this comment. MCD teaches you how grammars and grammer processors work.

Without understanding this you can't use lex/yacc etc properly. Being able to build your own lex/yacc type tools is a bonus.

"they are just overkill."

if you think EOPL, an undergrad text focusing directly on the core of your language interpreter (hint, lexing and parsing are not the core) is "overkill", I have nothing to say to you!

Good Luck with the "build a revolutionary programming language in 21 days" approach!

Coming up next, "Build an Operating System in 21 days and become the next Linus Torvalds!"

;-)


Ignore everything he said except this: "They are an introductory peek at what is cool about a complex subject. Then you have the opportunity to learn more about the parts the interested you..."

It's not a book that'll teach you how to actually do any of this stuff. It's an overview, a gloss, an extended Wikipedia entry in guide form, that shows you the work that goes into creating a programming language. It's like the show "How It's Made." If, at the end, you think you actually want to write a programming language, then by all means, read your set of books. (That's not to say that this was their goal--it was probably a stupid attempt to actually let people design and implement a language after reading one book--but this is what you should take away from it, and a perspective from which reading the book would be useful.)


Another neat book is "The Elements of Computing Systems" (http://www1.idc.ac.il/tecs/)

It is basically a really high level overview of a whole bunch of stuff from EE/CS, from logic gates through VM design through compilers (and sort of OSes, but not really). Each chapter is a project and build on each other (but you can actually do them in any order).

It isn't as in depth as many of these other books, but might be an easier first book.


Don't forget Peter van Roys excellent Concepts, Techniques and Models of Computer Programming


"Don't forget Peter van Roys Concepts, Techniques and Models of Computer Programming"

yes I have this too. But I haven't worked through it so I didn't want to reccomend it blindly. Many talented hackers(e.g Peter Norvig) say good things about this book so I am sure it is great. The language it uses (Oz) is a bit flaky wrt syntax but VERY powerful.

Another recent lovely book, though a bit on the formal side is Gifford and Turbak'S Design Concepts In programming languages. (Another 1000 + pages !! - the road to compiler gurudom has many 1000 page books to work through!).I am working though this and I am enjoying it thoroughly. I hope to finish it by the end of this year.


CTM is a great book, but not about programming language implementation so much as a tour through the big ideas in different programming paradigms. I can't recommend it too highly - it's one of the most readable textbooks I've seen, and it's refreshingly non-dogmatic about the subject material. Usually, language books are heavy-handed about OOP / Lisp / FP / whatever being best, but CTM's thesis is that, since they all have strengths and weaknesses, it's most practical to learn what they do best and how to use them in a complementary fashion.

It covers declarative programming, functional programming, several concurrency models, logic programming, object-oriented programming, dataflow programming, and probably a half dozen things I'm forgetting. The book uses Oz* , with major asides using Haskell, Erlang, Java, Prolog, and probably a couple others.

There's a draft PDF floating around, but if you like it, I'd highly recommend buying the book. (Same with SICP.)

* Which seems like an interesting language, though I've never gotten it to build on OpenBSD, so I've done exercises in OCaml, Lua, or Scheme instead.


By the way, thanks for the book suggestions - some great ones there that I have yet to read!

CTM is good, it covers a lot of theory of programming techniques and IMHO a must read for anybody interested in programming language design. Oz syntax is a bit quirky and weird, but the language seems to be quite powerful and very flexible, supporting many varied types of programming. I have not read all of it yet, but most - not exactly light reading :-)

I will definitely check out the other books which you mentioned though.


"By the way, thanks for the book suggestions - some great ones there that I have yet to read!"

You are welcome! I had to work through some really awful books before I put all the pieces together and stumbled onto the good books.

Even most good books omit some crucial piece (E.g EOPL , as good as it is, doesn't say anything about how to write a garbage collector/memory management infrastructure, SICP doesn't deal with lexing/parsing or type checking and so on.)


I think it's fairly in jest. Marc-Andé Cournoyer is a pretty smart guy. I'd say that this is most likely a nice light overview. That being said, I haven't read it, but I have looked at his code on GitHub.


$40 is a pretty hefty price for a jest, especially one that's only 44 pages and could soon get even more expensive.


Seems more like a prank than like a scam... Anyone tried actually buying it?


No, but clicking buy brings you to paypal.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: