News for hackers. Stuff that matters.
Re:The C3 Programming Language by gritzko on Saturday January 03, 2026 @03:11PM (#46481038)
I am a big fan of Ragel[1]. That is a high performance parser generator. In fact, it can generate different types of parsers, very powerful. Unfortunately, it takes a lot of skill to operate. I wrote a parser generator generator to make it all smooth[2], but after 8 years I still can't call it effortless. A colleague of mine once "broke the internet" with a Ragel bug. So, think twice. Still, for weekend activities I highly recommend it, just for the way of thinking it embodies.

[1]: https://www.colm.net/open-source/ragel/

[2]: https://github.com/gritzko/librdx/blob/master/rdx/JDR.lex

Re:The C3 Programming Language by fuzztester on Saturday January 03, 2026 @07:18PM (#46483338)
Is this the same Ragel that Zed Shaw wrote about in one of his posts back in the day, during Ruby and Rails heydays? I vaguely remwmber that article. I think he used it for Mongrel, his web server.

https://github.com/mongrel/mongrel

Re:The C3 Programming Language by sph on Sunday January 04, 2026 @08:03AM (#46487545)
The worst part of designing a language is the parsing stage.

Simple enough to do it by hand, but there’s a lot of boilerplate and bureaucracy involved that is painfully time-wasting unless you know exactly what syntax you are going for.

But if you adopt a parser-generator such as Flex/Bison you’ll find yourself learning and debugging and obtuse language that has to be forcefully bent to your needs, and I hope your knowledge of parsing theory is up-to-scratch when you’re facing with shift-reduce conflicts or have to decide whether LR or LALR(1) or whatever is most appropriate to your syntax.

Not even PEG is gonna come to your rescue.

Re:The C3 Programming Language by fuzztester on Friday January 09, 2026 @12:19AM (#46550320)
how is the boilerplate etc related to the syntax. not clear. i would have thought you first decide the syntax n only then start the work.

but i've never created an interpreter, let alone a compiler.