4 ms·
They show it on the landing page, but having first class support for CTF grammars is such an interesting niche for a language. Perl (Rake was originally Perl 6
by jjice 2y ago
They show it on the landing page, but having first class support for CTF grammars is such an interesting niche for a language. Perl (Rake was originally Perl 6 if I recall) always had solid tooling for dealing with text manipulation, but adding context free grammars in directly is another level. I have to imagine it ends up being seldom used for a lot of applications, but I wonder if you end up with a "see nails when you have a hammer" situation (and not necessarily in a bad way).
I personally have never used a context free grammar outside of writing a programming language parser.
- etyp 2y agoYeah, I've never really considered using a grammar like that for string processing like they suggest. And it's the first thing they show. Maybe I'm missing out and I just haven't had the tooling.
- giraffe_lady 2y agoI first came across something like this in janet, which includes a PEG system in the standard library. It definitely changed how I think about text processing. Very much of the time what I find myself doing with regex is defining a grammar, but I didn't realize that. I wish more languages included the tools for it, it's a core operation of practical programming. https://janet-lang.org https://janet-lang.org