I know have a macro package that can output guile-log to c-code directly. The key ingredients to make this work is to have tail call macros via trampolines and closures. With this one can device a macro framework
that outputs directly to C. The code look pretty much like the scheme code the prolog stuff is in 170 lines ontop of clambda. Using this 50 lines defining trhe queens example get compiled into about 3000 lines of C.
The findings shows for N=10 that code that takes 0.45s in the scheme version takes about 0.3s in the compiled to C version. Note here that this includes gc. without gc the algorithm takes about 0.22s.
If I recall correctly compiled gprolog takes around 0.1s for the same algorithm.
The scheme version in guile-unify is a mix of using promps and continuation closures and hence there is less pressure on the gc for the code above that places everything in tail call position. So it looks like the scheme version is an ok trade
off between stack usage and heap usage.
[Prev in Thread]
[Next in Thread]
scheme prolog compiled to c,
Stefan Israelsson Tampe<=