[HN Gopher] Langcc: A Next-Generation Compiler Compiler
___________________________________________________________________
Langcc: A Next-Generation Compiler Compiler
Author : mpweiher
Score : 51 points
Date : 2022-09-23 07:32 UTC (15 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| rurban wrote:
| Looks good, but I'm sceptical that I can specify perl5 or raku
| with it, as this would need dynamic flex rules. python, php or
| ruby should be fine though.
| KerrAvon wrote:
| It includes a grammar for Python but says it has some
| limitations, so maybe, sort of. Amusingly, the included C
| grammar is shorter than the Python grammar.
|
| Ruby has some syntactical edge cases that make parsing a bit
| tricky.
| benjaminjosephw wrote:
| > langcc is general enough that the tool is self-hosting: that
| is, one can express the "language of languages" in the "language
| of languages" itself
|
| There's something deeply satisfying about recursive tools who's
| inputs can include the definition of the tool itself. Brilliant.
| jupp0r wrote:
| > automatically generates a compiler front-end
|
| For a very narrow definition of compiler frontend. The missing
| piece to make this super awesome would be generating LLVM IR,
| which is where the semantics of the language would need to be
| understood (vs just the grammar).
| duped wrote:
| Does it generate a batch or reactive compiler and allow for
| custom error recovery/messaging?
|
| It's always cool to see new tools but at a glance this doesn't
| seem to solve the problems that necessitate a hand written
| parser.
| sanxiyn wrote:
| Just about all parser generators allow for custom error so this
| one does too. "Hand written parsers have better errors" is just
| an internet meme, not the actual state of the technology.
___________________________________________________________________
(page generated 2022-09-23 23:00 UTC)