proj-jasper-jasperInterop

See also jasperFfi

It should be easy to take an existing program written in, say, C or Python, one which you are currently working on, and decide that you'd rather work on it in Jasper instead, and just switch to Jasper without throwing out the existing code.

Jasper should be a good language for "looking thru" an interpreter. E.g. you should be able to (easily) write an emulator of a VM in Jasper, and then, within that VM, run an interpreted or compiled higher-level program targetting that VM, and then (to the extent that the conventions of the higher-level language interpreter or compiler are understood by the programmer) easily write a debugger in Jasper that can dynamically inspect the variables (and decompile the code of) the higher-level program for easy viewing and modification.

The facilities to make this easy will also make interoperability easy, e.g. Jasper could in theory be programmed to emulate both the JVM and the Python VM and then to transfer data from the JVM variables to the Python ones and vice versa, or even to thread control between them, allowing one to call th other and vice versa.

Interop target languages/platforms

The Jasper project has chosen a few languages for which interop is supported as part of the core Jasper project:

JVM, C, CLR, Javascript, Python, Haskell, OpenCL?

Why did i choose these? C, JVM, Javascript, and .NET are very popular platforms. Haskell is very different from the others and so will cause us to create powerful and general interop mechanisms. Python is there because Python is my personal favorite language, and also because Python and C are, in my reckoning, the only languages which are both extremely popular and extremely beloved. OpenCL? is there because the concurrency we are seeking is currently available in GPUs.

This list may change in the future. High-priority candidates for future interop targets include: Lua, LLVM, Ruby, as well as more specific support for Java, Clojure, Objective-C, C++, C#, Rpython. Other current candidates include PHP, Visual Basic, Golang, Erlang, Rust, although we're open to considering other languages if someone volunteers to contribute and maintain the interop for it.

For each blessed language, the core development project includes support for:

('relatively readable' is to be interpreted as a rather low bar; i just mean, don't unnecessarily convert everything to continuation-passing style or something like that that is especially hard to read)

(in the above, for now the condition is considered satisfied if it pertains with substitution between a language and a core language or platform, e.g. interoping with Core Jasper is considered as good as interoping with Jasper and vice versa, and interoping with the JVM is considered as good as interoping with Java and vice versa, even if some of the above bullet points are satisfied in different ways, e.g. maybe we compile Core Jasper to Java and compile the JVM to Jasper, but cannot compile Jasper to JVM or Java to Jasper or Jasper directly to Java. In the future we may tighten this up for some languages.)

Jasper interop design todos

Jasper interop design toreads