Inlining C

Hi Jan,

Have you considered inlining C – with “macro” wrappers to access terms … as an alternative to foreign predicates.

Perhaps now with a new construct for determinstic predicates, it could, in particular make sense – to focus on seamlessly supporting simpler C code that doesn’t need to be backtracked over.

Key benefit would be fast deterministic (functional) code; simplified, and seamless, foreign language support.

Drawback might be the difficulty of supporting a debugger that handles two languages seamlessly and a more elaborate prolog complier tool chain that now requires calling a c complier as well.

Dan

With a VM that won’t be easy. Even then, life is touch inside the VM as just about anything can move anywhere at any time. That is why we have the term_t abstraction for foreign code that makes all access of foreign code known to Prolog and makes sure that possible moved data can still be found.