Interesting article on Prolog's relation to Lisp s-expressions

I stumbled on It Came from the S-Expressions while Googling for examples of using DCGs to parse Lisp and found it interesting.

It relates to my previous post on KIF, KIF being yet another Lisp version of Prolog.

I’ve pretty much sorted in my mind how to write the kif2prolog script, just need to tear myself away from stumbling on distractions such as the above blog and actually write it now.

Thanks for the interesting link.
If you’re still looking for examples of parsing S-expressions with DCGs, I’ve written a simple Lisp interpreter including a DCG-based lexer/parser that you can find at ~eshel/eshellisp: prolog/eshellisp/read.pl - sourcehut git. It even preserves source locations for debugging etc. :slight_smile:

1 Like