News for hackers. Stuff that matters.
Re:Show HN: How to write a recursive descent parser by dukoid on Monday March 20, 2017 @11:10AM (#13914835)
Because the problem is not parsing alone, but doing type checks / ambiguity resolution during parsing and linking up the parse tree with type information etc.

See http://stackoverflow.com/questions/6319086/are-gcc-and-clang...

Also, you people may just want to learn how to build a parser.

Shameless plug if you need a small but flexible expression parser for java: https://github.com/stefanhaustein/expressionparser

Re:Show HN: How to write a recursive descent parser by Drup on Monday March 20, 2017 @11:16AM (#13914878)
My point is precisely that, if you are creating your language from scratch, you shouldn't have to do that. Those are mistake needed because the C grammar is full of cruft (and the C++ one is even worse).

It's much better, for a new language, to separate type checking from parsing completely, and to avoid any ambiguity.

Re:Show HN: How to write a recursive descent parser by PaulHoule on Monday March 20, 2017 @12:47PM (#13915625)
In theory yes, in practice, if you want to make a serious improvement in the ergonomics of programming languages for "ordinary" folks, you have to face up to the fact that natural languages don't make an artificial distinction between different aspects of language.
Re:Show HN: How to write a recursive descent parser by Ericson2314 on Monday March 20, 2017 @11:37AM (#13915053)
> Because the problem is not parsing alone, but doing type checks / ambiguity resolution during parsing and linking up the parse tree with type information etc.

Holy shit, people think that's a good idea? Pipelines please!

Re:Show HN: How to write a recursive descent parser by munificent on Monday March 20, 2017 @12:19PM (#13915383)
It's often faster to do as much as you can in a single pass, and language front ends are one of those areas where squeezing every last drop of performance out still really matters.
Re:Show HN: How to write a recursive descent parser by Drup on Monday March 20, 2017 @01:17PM (#13915889)
It's actually faster to separate things, because you will be able to implement them cleanly. Having a good pipeline such as "text -> AST -> typed AST -> IR -> .... -> ASM/VM code" is very valuable.

The costy parts are the middle layer optimization anyway. Typechecking time, for a well written type checker, is not that big.

Re:Show HN: How to write a recursive descent parser by Ericson2314 on Tuesday March 21, 2017 @11:29AM (#13923052)
I think incremental compilation is a far more elegant and efficient way to shorten debug cycles.

Also makes IDE stuff easier too.