FFI and current status...

emacstheviking <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <CAEiEuUJrb1gwSSTcz8LhDytuZAX9QU0tPn_bzRJ=sv0Suu3+SA@mail.gmail.com>
Hi,

Over the last two nights I have written an FFI to the GLFW (3.0.2) library
and on my iMac I now have a running system that shows a black window and
responds to key events, albeit using a C handler as I have not yet worked
out how to make an asynchronous event call back to a prolog predicate yet.
I have considered writing a custom main() function and starting from there
so that the prolog session is globally available to the callback and then I
can do it but I would have loved to have been able to write as little glue
code like that as possible, but if I have to...

I am currently sketching out some PHP code that uses the -xml output from
SWIG to attempt to create both the ':- foreign' declarations and the boiler
plate C code that will wrap each call. If it works as well as my
hand-crafted solution then I will be happy.

It will.

Which brings me to...OpenGL. That is a BIG cookie to eat and if I can
produce OpenGL bindings for GNU Prolog (SWI has them) then that would be
great. I have this made idea to somehow intercept the execution of a
predicate (like trace/spy does) and then produce some kind of 3D
representation of how that predicate was executed for inspection, purely as
a learning exercise. I see it as a way to actually enable people to really
see what backtracking gets up to at run time!

So... do I get ready to expend enormous amounts of efforts or do I wait a
little longer for GNU Prolog 1.4.X or 1.5 or whatever to be released that
has the new module system (and FFI?!) that Daniel mentioned a few months
back?

Thanks,
Sean.

_______________________________________________
Users-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/users-prolog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.