Helvetia – A lightweight approach to embed new languages into the host language
scg.unibe.ch
scg.unibe.ch
Like many other scripting languages, Web Prolog lacks some of the capabilities of general purpose programming languages, such as file I/O, access to the OS and a foreign language interface, but since a Prolog Web node is implemented on top of a general purpose programming language it should be straightforward to delegate the need for such operations to this language. A programmer wishing to implement an application that needs to perform e.g. file I/O needs to be knowledgeable in the host language. For some nodes, it probably makes sense to offer an interface between Web Prolog and the host language. In the case of SWI-Prolog, such an interface is obviously already there.
Torbj¨orn Lager (2018, June 18). Web Prolog and the Programmable Web. Retrieved from: https://github.com/Web-Prolog/swi-web-prolog/raw/master/book...
I haven't realized that typing the above comment. :D
EDIT: Adding this since I found it after asking https://en.wikipedia.org/wiki/Talk%3AHell,_Norway
Answer seems to be "probably not"
https://wiki.osdev.org/Inline_Assembly
The power of this is that the compiler did the work of connecting variables from the two environments so we didn't have to write glue code.
There have been countless times where I've thought to myself "this would be trivial in another language". Can you write some kind of general purpose "embedder" that lets us use Javascript in C++, or PHP in Javascript even (PHP is simultaneously the best and worst language I've ever used). Maybe Swift or Kotlin or even Rust in Javascript. Stuff like that?
EDIT: I found this YouTube video from 2011 - and the source code has not been updated since 2012. I wonder if there are any newer projects inspired by it?