guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile-log musings


From: Stefan Israelsson Tampe
Subject: guile-log musings
Date: Wed, 14 Jan 2015 15:59:27 +0100

Hi All,

I managed to get guile-log and guile-syntax-parse to work under guile-2.2. So It looks 
like it will be a smooth transition from here. I did have a few hiccups but managed to 
clean them out. No issues with guile-2.2. Master is looking good.

But most of my work recently have been on making it possible to run swi-prolog code 
and use the prolog module system. I can compile pretty advanced code quite well 
almost without no hiccups. So if you stay out of swi prolog internals in your prolog 
code guile-swi-prolog will be able to compile and parse it. mainly swi prolog macros
 is partly implemented and needs some rework to use it. And getting prolog 
macros to work is where I am atm.

I did a small test with swi prologs assoc data structure which is a functional tree. 
I also compared with an internal vhash that i'm using as an assoc looking upp all 
the 1 .. 10.000 numbers in an assoc data structure, here is the finding


Number of operations / second:

swi
     assoc.pl  100.000                       
guile-prolog (guile 2.0)
     assoc        10.000
     vhash      100.000
guile-log (guile 2.0)
     vhash    1.000.000

So although guile-log is 10x slower when you run the same code as in prolog, using an
internal data structure, you gain 10x, and skipping the overhead of guile-log's prolog
 implementation another 10x is gained.

So actually a prolog on scheme can be really fast, if you do it right. Unfortunately 
pure prolog is too slow atm, but it will be better as the prolog implementation get's
 better and guile get's it code all the way to assembler.

Swi prolog has a lot of cool features, many of them are implemented. That together 
with a really good implementation of tablating and continuations makes guile-log's 
prolog unique.

Right now I'm trying to compile clpfd which is a finite domain solver, something that one 
just must have in order to call oneself a prolog environment.

Happy hacking!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]