News for hackers. Stuff that matters.
Re:Racket: Parsing propositional logic in 33 lines by AQXt on Friday October 16, 2020 @03:58AM (#24798646)
This is quite impressive!

I don't know any other programming language that implement grammars in such a clean way.

Re:Racket: Parsing propositional logic in 33 lines by ceceron on Friday October 16, 2020 @01:05PM (#24802767)
Prolog implements Definite Clause Grammars[0] which can express context-sensitive grammars. In Prolog there is a simple DSL to express DCGs, but in fact DCG just uses Prolog runtime features. I don't believe there is aanother general purpose language with such complex parsing just built-in the runtime.

Here you can see my version of the raku parser, it's arguably shorter (I'm not a Prolog expert): https://swish.swi-prolog.org/p/basic_logic_parser.pl

[0] https://en.wikipedia.org/wiki/Definite_clause_grammar

Re:Racket: Parsing propositional logic in 33 lines by moonchild on Friday October 16, 2020 @04:44AM (#24798883)
It was a logical extension of regexes, which were a very important part of perl (raku was originally perl 6). It also integrates very well with the rest of the language—even more so than does regex with perl.

However, though I think raku's reimagination of regexes is probably the best one—and the one that feels the least bound to legacy—there are other developments in that area. For instance, oil's egg expressions - http://www.oilshell.org/preview/doc/eggex.html

Re:Racket: Parsing propositional logic in 33 lines by 9214 on Friday October 16, 2020 @06:36AM (#24799430)