Re:Learn C and build your own Lisp
by SneakerXZ on Friday April 04, 2014 @09:04AM
(#7531070)
Does it use a generator to generate lexer and parser or author is suggesting to write them manually?
[ Parent
| on HN ]
I imagine if the goal is to design from the ground up, you wouldn't be using a generator.
Re:Learn C and build your own Lisp
by orangeduck on Friday April 04, 2014 @09:32AM
(#7531227)
Author here. A parser combinator library is used to do the parsing.
Re:Learn C and build your own Lisp
by hamburglar on Friday April 04, 2014 @04:37PM
(#7534178)
My one criticism is that it's a fairly big leap from learning C from ground zero to being a client of a complex, high-level library like mpc. I feel like the moment you hit the call to mpca_lang, anyone who really was learning C at the beginning shifted from "learning C" mode to "copy and paste C code I don't understand" mode.
Too bad, always everyone who teaches how to write a programming language uses generators but actual production programming languages never use them. Except of a few langugages.
I wonder why...
It's hard to generate high quality error messages with current generators unfortunately. More common nowadays is building first with a generator and switching to recursive decent when it becomes too unwieldy.