Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you want to build a parser, I recommend Lexy, it's a parser combinator.

It's a bit difficult to use because it makes extensive use of templates.



Alternatively use lemon (like bison but much easier to hack on) and re2c (or equivalent). LALR parsing turns out to be magic - in exchange for an unambiguous grammar you get linear time parsing to a tree.

Very easy to use. Build a parse tree from it, deal with the ambiguous nonsense of your language in a translation to AST.


The C++ requirement seems to place this dead in the water. In 2024 there is no shortage of better runtimes.


While I don't know anything about that project, your comment sounds a bit unwarrantingly anti-C++.

Most compilers and operating systems are built in C++ nowadays, it's the industry standard for any systems-level programming.


Most compilers are not based on C++. C++ compilers (namely, GCC, LLVM, and Visual Studio) are based in C++.

Anyway, no point in cargo culting the use any further.


Those are the main compiler frameworks used by all the major platform providers (Microsoft, Google, Apple, Facebook, IBM...) and support dozens of languages...


Yeah but only because Rust (and arguably Zig) didn't exist when those compilers and operating systems were written.

C++ is the industry standard for existing software but it would be dubious at best to start a new project in C++. Especially something that has essentially no dependencies like a compiler. GUIs and games, sure.


ha, you're a Rust zealot; that explains it.

Believing that all new software should be written in Rust rather than C++, and that this situation is inevitable anyway, is one of the core tenets of this church.


> you're a Rust zealot; that explains it.

I bet you were one of those people that dismissed anyone that liked the iPhone as being an Apple fanboy.

You know people really like Rust because it's good right? I'm curious what other reason you think people have for promoting it?

Even the White House says you should use Rust instead of C++. Are they Rust zealots?


Yeah, Biden is a Rust fanboy. Thankfully he won't last beyond November.


Ha on any other website I would confidently assume this is sarcasm. Good job!


Obviously you shouldn't start any project in any language because you have no idea what you're talking about. Spitting myths and folklore stripped of context is not what engineers do.


What are you talking about? Myths and folklore? Are you ok?


I am perfectly fine, thank you.




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

Search: