proj-oot-ootInterop

See also ootFfi

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 Oot instead, and just switch to Oot without throwing out the existing code.

Oot 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 Oot, 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 Oot 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. Oot 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 Oot project has chosen a few languages for which interop is supported as part of the core Oot project:

C, Javascript, JVM, Python, asm.js, webassembly

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 Oot is considered as good as interoping with Oot 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 Oot to Java and compile the JVM to Oot, but cannot compile Oot to JVM or Java to Oot or Oot directly to Java. In the future we may tighten this up for some languages.)

Justification for interop targets

Other potential interop targets

Oot interop design todos

Oot interop design toreads

Oot optional features