frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Lexy: A parser combinator library for C++17

https://github.com/foonathan/lexy
73•klaussilveira•5mo ago

Comments

o11c•4mo ago
This appears to avoid one of the classic bugs with parser combinators (expensive backtracking and/or memory-use), but appears not to fix one of the other catastrophes.

To be explicit: one of the "features" this advertises is equivalent to saying "if you stop compiling your code with `-Wall`, you don't have to deal with all those pesky warnings!"

jibal•4mo ago
You have an odd notion of "explicit". There's no need to be coy ... spell it out.
jibal•4mo ago
[crickets]
tempodox•4mo ago
What “other catastrophes”? Are you being deliberately mysterious?
ginko•4mo ago
>To be explicit: one of the "features" this advertises is equivalent to saying "if you stop compiling your code with `-Wall`, you don't have to deal with all those pesky warnings!"

You're still not being explicit. Are you referring to the error recovery? Do you disagree that this is useful in real world applications? A C++ parser with `-Wall` would do error recovery and keep going on syntax errors.

jokoon•4mo ago
I parsed my language with it, it's fast and works well.

Pressing rules are written in c++ directly, with templates.

Although if you have no experience in parsing, the learning curve could be a bit steep.

fooker•4mo ago
Neat. If you add some automatic memoization, I'll use it for my next project!

Here's the use case:

expr := ...

rule1 := expr foo expr

rule2 := expr bar

When trying to match rule1 and failing, it is great to have the expr part of it already parsed and ready for trying out rule2.

This doesn't have to be done extremely well (see PEG/Packrat parsing for that) but even a little bit, maybe one term or something like that helps a lot.

hackrmn•4mo ago
It's been a while I've had to sit down applying or writing a parser or a parser generator, but it being/offering a "simple recursive descent" parser, does that mean left-recursion is a no-go?

In my opinion, parser libraries/frameworks indeed are all mired by the usual suspects which make adoption painful:

* Must learn another grammar language which for some strange reason I suspect has to do with "tradition", must reside in _a file_ -- as opposed to just be expressed with code (i.e. `bin_expr = Concatenation(Ref('expr'), bin_op, Ref('expr'))`); if a BNF language _is_ used for grammar, it almost always is used with some non-standard syntax for helping resolve shift/reduce errors, etc -- which for me puts it into the same "this is not needed" category

* Defined by the kind of parser that is generated, so implying you have to know parser theory in order to know what languages you will never be able to parse with said library/framework; made even worse when some kludge is added with extensive documentation on how to get out of the predicament because "the parser cannot theoretically handle the grammar/language but it otherwise is really great because it uses ABC kind of parsing which is why we chose it" -- the impression it gives a person who knows parsing enough to know they need to construct a grammar and that the grammar may feature ambiguities, is that they have to learn more parser theory; when you learn more parser theory, you usually just implement your own parser unless you need to parse e.g. C++, admittedly; for case in point, see my remark on the "recursive descent parser" being used with Lexy

To be frank, I like the addition of yet another parser generator -- the more the merrier, because contrary to that one earlier statement, that "parsing is a solved problem", I think it is not -- the theory has substantial headway on the practice, meaning that in theory it is [a solved problem], but in practice it is not, in my experience.

troupo•4mo ago
The practice also lacks the answer to "when do you skip all the libraries and go for a hand rolled parser which gives you better control over errors, rollbacks, decision trees etc." step.
teo_zero•4mo ago
I assume yours is a general comment about parser generators and not specifically about Lexy, which in fact contradicts your first bullet point by providing templates to express your grammar directly in the C++ code.
hackrmn•4mo ago
Indeed, on the point of parser generators utilizing "text"-based grammar [files], Lexy is not among these.

Tiny C Compiler

https://bellard.org/tcc/
76•guerrilla•2h ago•33 comments

SectorC: A C Compiler in 512 bytes

https://xorvoid.com/sectorc.html
163•valyala•6h ago•30 comments

Speed up responses with fast mode

https://code.claude.com/docs/en/fast-mode
99•surprisetalk•5h ago•99 comments

The F Word

http://muratbuffalo.blogspot.com/2026/02/friction.html
90•zdw•3d ago•40 comments

Brookhaven Lab's RHIC concludes 25-year run with final collisions

https://www.hpcwire.com/off-the-wire/brookhaven-labs-rhic-concludes-25-year-run-with-final-collis...
40•gnufx•5h ago•43 comments

You Are Here

https://brooker.co.za/blog/2026/02/07/you-are-here.html
48•mltvc•2h ago•58 comments

Software factories and the agentic moment

https://factory.strongdm.ai/
123•mellosouls•9h ago•255 comments

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
872•klaussilveira•1d ago•267 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
163•AlexeyBrin•11h ago•29 comments

Stories from 25 Years of Software Development

https://susam.net/twenty-five-years-of-computing.html
121•vinhnx•9h ago•14 comments

FDA intends to take action against non-FDA-approved GLP-1 drugs

https://www.fda.gov/news-events/press-announcements/fda-intends-take-action-against-non-fda-appro...
48•randycupertino•1h ago•46 comments

First Proof

https://arxiv.org/abs/2602.05192
87•samasblack•8h ago•61 comments

Show HN: A luma dependent chroma compression algorithm (image compression)

https://www.bitsnbites.eu/a-spatial-domain-variable-block-size-luma-dependent-chroma-compression-...
24•mbitsnbites•3d ago•1 comments

Show HN: Browser based state machine simulator and visualizer

https://svylabs.github.io/smac-viz/
7•sridhar87•4d ago•3 comments

Al Lowe on model trains, funny deaths and working with Disney

https://spillhistorie.no/2026/02/06/interview-with-sierra-veteran-al-lowe/
76•thelok•8h ago•16 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
256•jesperordrup•16h ago•84 comments

Show HN: I saw this cool navigation reveal, so I made a simple HTML+CSS version

https://github.com/Momciloo/fun-with-clip-path
45•momciloo•6h ago•6 comments

Start all of your commands with a comma (2009)

https://rhodesmill.org/brandon/2009/commands-with-comma/
542•theblazehen•3d ago•199 comments

I write games in C (yes, C) (2016)

https://jonathanwhiting.com/writing/blog/games_in_c/
157•valyala•6h ago•138 comments

The AI boom is causing shortages everywhere else

https://www.washingtonpost.com/technology/2026/02/07/ai-spending-economy-shortages/
225•1vuio0pswjnm7•12h ago•355 comments

Microsoft account bugs locked me out of Notepad – Are thin clients ruining PCs?

https://www.windowscentral.com/microsoft/windows-11/windows-locked-me-out-of-notepad-is-the-thin-...
65•josephcsible•4h ago•81 comments

Reinforcement Learning from Human Feedback

https://rlhfbook.com/
104•onurkanbkrc•11h ago•5 comments

Selection rather than prediction

https://voratiq.com/blog/selection-rather-than-prediction/
19•languid-photic•4d ago•5 comments

72M Points of Interest

https://tech.marksblogg.com/overture-places-pois.html
45•marklit•5d ago•6 comments

Coding agents have replaced every framework I used

https://blog.alaindichiappari.dev/p/software-engineering-is-back
287•alainrk•11h ago•464 comments

Unseen Footage of Atari Battlezone Arcade Cabinet Production

https://arcadeblogger.com/2026/02/02/unseen-footage-of-atari-battlezone-cabinet-production/
131•videotopia•4d ago•43 comments

A Fresh Look at IBM 3270 Information Display System

https://www.rs-online.com/designspark/a-fresh-look-at-ibm-3270-information-display-system
54•rbanffy•4d ago•15 comments

France's homegrown open source online office suite

https://github.com/suitenumerique
666•nar001•10h ago•289 comments

Where did all the starships go?

https://www.datawrapper.de/blog/science-fiction-decline
113•speckx•4d ago•157 comments

Learning from context is harder than we thought

https://hy.tencent.com/research/100025?langVersion=en
215•limoce•4d ago•123 comments