Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, definitely, there are several recent advances in Prolog implementation techniques!

For example, just-in-time (JIT) compilation, i.e., compilation to native code. Quoting from the SICStus documentation https://sicstus.sics.se/sicstus/docs/latest4/pdf/sicstus.pdf :

"Since release 4.3, on 32 and 64 bit x86 platforms running Windows, OS X, and Linux, SICStus Prolog has the ability to compile predicates from virtual machine code to native code. This process, known as Just In Time (JIT) compilation, is controlled by a couple of system properties (see Section 4.17.1 [System Properties and Environment Variables], page 224), but is otherwise automatic. JIT compilation is seamless wrt. debugging, profiling, coverage analysis, etc. JIT compiled code runs up to 4 times faster than virtual machine code, but takes more space."

As another example, one of the most recent and also very significant innovations in Prolog implementations happened in 2020, when Scryer Prolog became the first Prolog system to implement a very compact internal representation of lists of characters, internally storing them as sequences of raw bytes in UTF-8 encoding instead of compound terms, while Prolog code "sees" them as lists and can therefore reason about them with conventional predicates over lists.

Trealla Prolog took up this idea and now already allows the efficient application of Prolog definite clause grammars (DCGs) to entire files (using phrase_from_file/2) by mmapping the entire file to memory, i.e., using the operating system to transparently process the file as if it were loaded, without having to load it in its entirety into memory. This paves the way for the use case Prolog was designed for: efficient and convenient reasoning about large amounts of text.



Thanks for mentioning traella - doesn't look like it gained much traction last time it was brought up:

https://news.ycombinator.com/item?id=26313792


I wonder how Tauprolog with all the JS jit-stuff compares.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: