triska 6 hours ago

Regarding the comment "13211-3 conformity approved" that appears in the thread:

This refers to the newly published Technical Specification (TS) of Definite Clause Grammars which are part of the Prolog standard since June 2025 via ISO/IEC TS 13211-3:2025:

https://www.iso.org/standard/83635.html

This standard was achieved thanks to the great cooperation between many experts over many years. Its publication is an important milestone in the development of Prolog, since this grammar mechanism can be rightly said to mark the beginning of Prolog, a programming language rooted in natural language processing tasks:

https://en.wikipedia.org/wiki/METEO_System

With recent Prolog systems such as Scryer Prolog and Trealla Prolog, also very large amounts of text can be efficiently processed with this formalism, using library(pio) to apply such a grammar directly to files.

mcphage 3 hours ago

What exactly is this?

  • Jtsummers an hour ago

    https://en.wikipedia.org/wiki/Tacit_programming

    Tacit programming basically means constructing new function/routines without introducing explicitly named parameters.

    In an ML-family language, you can construct `double` with something like:

      double = 2*
    
    Partial application of the binary function * means we don't need to be explicit like this:

      double x = 2 * x
    
    The linked Prolog is implementing an interpreter for a Forth-like language. Forths let you do tacit programming via operations on the stack. The above example, in Forth, would be:

      : double dup + ;
      : double 2 * ;
    
    Neither of which has an explicit variable. The first duplicates the top of the stack then adds the top two items on the stack, the second pushes 2 onto the stack and then multiplies the top two items.

    If you copy/paste the gist into the site below you can play around with the program stored in `main`. Change `main` to just:

      main --> mul, add.
    
    With the query `main(R).` you'll get a result of `R = 1*2.`. Add each instruction one at a time and re-execute the query. The result will always be the top of the stack, before the last `is_` you'll get this:

      R = abs(5^(pi-5)).
    
    Which is then processed by the last `is_` into the result, 0.05023...

    https://play.scryer.pl/