1. 40
  1. 6

    Great! I’m a great fan of DCGs. It reminds me of my PostgreSQL connector made using DCGs to decode/encode messages.

    1. 1

      Do you have a link to that? I’d like to read it.

    2. 5

      This is so cool! Reminds me a bit of Erlang’s bit-wise destructuring (see https://www.erlang.org/doc/programming_examples/bit_syntax.html for destructuring an IPv4 header).

      1. 5

        Oh, and of course Erlang syntax is pretty close to Prolog too, and not by a coincidence: the first implementation of Erlang was in Prolog.

        1. 1

          You got me curious, in turn:

          The first implementation of Prolog was an interpreter written in Fortran

      2. 2

        Wow! this is totally awesome! Love it.