neos Universal Compiler and Bytecode JIT -- Coming Soon


Introduction

neos is a cross-platform (C++) universal compiler that can theoretically compile any scripting/programming language. The compiler targets custom bytecode used by a custom VM with JIT. neos will be used as the scripting engine in the neoGFX project.

The plan is for version 1.0 of neos to ship with implementations of the following scripting/programming languages:

neos is open source and the source is available from: https://github.com/i42output/neos.

Features

Mixing Programming Languages

An interesting side effect of the neos architecture that comes almost for free is the possibility of mixing code from different programming languages in the same source file. These source files have the .mix file extension. Here is an example .mix file:

# The following line defines the language selection character (.mix files are UTF-8 encoded)...
%%%⚛%
⚛⚛c⚛ /* make c the default language and select it */
#include <stdio.h>
⚛c++⚛ /* select the c++ language */
#include <iostream>
⚛ada⚛
with Ada.Text_IO;
use Ada.Text_IO;
⚛⚛ /* select the default language (c in this example) */
void hello_from_c()
{
printf("Hello, world (from C)!\n"); } ⚛ada⚛ procedure Hello is begin Put_Line("Hello, world (from Ada)!"); end Hello; ⚛⚛ int main() { hello_from_c(); ⚛c++⚛ std::cout << "Hello, world (from C++)!" << std::endl; ⚛ada⚛ Hello(); ⚛⚛ printf("Hello again from C!\n"); }