Skip to content

Oberon+ cross-platform FFI language MVP

Compare
Choose a tag to compare
@rochus-keller rochus-keller released this 31 Dec 11:23
· 102 commits to master since this release

I'm pleased to announce the MVP release of the Oberon+ foreign function interface (FFI) language.

The FFI language is a first-class citizen of Oberon+ and allows the use of existing C shared libraries in Oberon+ applications and thus the reuse of a huge pool of proven libraries without having to program directly in C and without adaptation/integration efforts. And yes, if the library is available on different platforms/architectures, an Oberon+ program can access these libraries directly and unmodified on all these platforms/architectures.

Here is the section of the FFI language in The Programming Language Oberon+, and here is a background article.

The FFI language is now implemented in both the CLI bytecode generator and also the new C99 transpiler.

As an example here is the CLI version of the Oberon System using the well-known SDL2 library as a cross-platform keyboard/mouse/window abstraction: OberonSystem_ObxIDE_CIL_2021-12-30.zip. And here is the corresponding C99 version: OberonSystem_ObxIDE_Cgen_2021-12-30.zip; it was generated with the "Build & Run/Export C" menu item of the IDE and can be compiled e.g. with GCC using gcc -O2 --std=c99 *.c -lm -o obs or with MSVC using cl /O2 /MD /Fe:obs.exe *.c. To run the example you need the SDL2 shared library; it can e.g. be downloaded from here or installed from your Linux distribution (actually only the SDL2.dll/.so/.dylib file is required; the file is included in the pre-compiled versions of the IDE, see below).

Here is the code where the Oberon System uses the SDL library. And here is the Oberon+ external library module of the SDL2 library; it was automatically generated from the SDL2 C header files using my C2OBX tool with just a few manual adjustments.

Here are the pre-compiled versions of the IDE with integrated CLI and C99 compiler (download, unpack/mount and run, no installation requried):

http://software.rochus-keller.ch/OberonIDE_win32.zip (a copy is also attached to this post, see below)

http://software.rochus-keller.ch/OberonIDE_macOS_x64.dmg (a copy is also attached to this post, see below)

http://software.rochus-keller.ch/OberonIDE_linux_i386.tar.gz

See also https://github.com/rochus-keller/Oberon/blob/master/README.md and http://oberon-lang.ch.

🎉 🎆 🎊 HAPPY NEW YEAR!