Onramp is a virtualized implementation of C that can be bootstrapped from scratch on arbitrary hardware. Starting in machine code, we implement a tool to convert hexadecimal with comments to raw bytes, then a virtual machine to run a simple bytecode, then a linker, then an assembler for a custom assembly language, and then the preprocessor and compiler for a minimal subset of C.
From that subset of C we implement a partial C99 compiler and libc, which then compiles a C17 compiler toolchain. The resulting toolchain can (soon) bootstrap a native C compiler (e.g. TinyCC), which can bootstrap GCC, which can then compile an entire system.
Only the first two steps are platform-specific. The entire rest of the process operates on a platform-independent bytecode. Onramp bytecode is simple to implement, simple to hand-write, and simple to compile to, making the entire bootstrap process as simple and portable as possible. The platform independence of Onramp makes present-day C trivially compilable by future archaeologists, alien civilizations, collapse recovery efforts and more. The goal of Onramp is to maintain a timeless and universal bootstrapping path to C.
A sub-1KB, self-hosting, native code Forth without compromise
At the core of paraforth is a very small assembly program - just an association list of names to subroutines, and an input loop for invoking them. By pre-populating the list with just enough functionality to build a macro assembler, a self-extensible language kernel is born.
This project is a long-running exercise in building the smallest self-sufficient Forth possible, without ANY sacrifices in speed or usability. No inputting pre-assembled machine code at runtime, and no cobbling together logic operations from NAND.
The entire language, save for just 15 words and 756 bytes of machine code, is implemented in itself - legibly - and builds in place on startup. Additionally, support for full bootstrapping coming soon.
Another modern C compiler. It has a heap system that is a cross between an automatically-free-system and a reference-counted GC, and includes a collection library and a string library. In debug mode, we add as many memory-safe features as possible to the C language. It actively tries to detect memory leaks; it also makes the claim that it has no memory leaks, seeing as how it's self-hosted (which means that it can compile itself).
Requires clang, make, autoconf, valgrind, gdb, lldb, musl-dev (alpine linux), and pcre-dev.
Supports Linux, MacOS (Darwin), iSH (iPhone), termux (Android) userland (Android), and Raspberry Pi.
The syntax is almost the same as C language. It may not be POSIX compliant. If you do not #include <neo-c.h>
, you can use it as a normal C compiler.
Ever dream of compiling your own Commodore 64 BASIC language programs into fast, efficient machine language programs? This is now a reality once again. Previously a tool used especially by only the last century's elite Basic programmers, wielded with almost godly power to turn many raw basic .prg (programs) into fast lean performing programs (.prg) [ .prg file on disk >> faster ,prg on disk], Kraksnax has released once again this classic diskette tool in late Summer 2023.
Available as a .d64 disk image as well as a native .prg executable.
Codon is a high-performance Python compiler that compiles Python code to native machine code without any runtime overhead. Typical speedups over Python are on the order of 10-100x or more, on a single thread. Codon's performance is typically on par with (and sometimes better than) that of C/C++. Unlike Python, Codon supports native multithreading, which can lead to speedups many times higher still.
Melody is a language that compiles to ECMAScript regular expressions, while aiming to be more readable and maintainable. This:
16 of "na";
2 of match {
<space>;
"batman";
}
turns into this: /(?:na){16}(?: batman){2}/
What can you do with Vision BASIC? Pretty much anything you want to. Speed will no longer be a problem! Why? Because on it's own, Vision BASIC is VERY fast! But when you need to crank out even more speed, all you need to do is insert machine language anywhere you wish to. Yes, you can actually type machine language instructions right next to BASIC commands! You won't need to load in external machine language files, and you won't need to poke machine language code to memory. This is because Vision BASIC also doubles as an assembler – you can write BASIC programs with it or machine language programs with it, or a blend of the two!
Vision BASIC also includes a whole new batch of commands to help you realize your programming dreams! Need sprites? Vision BASIC's got you covered! Need sound and graphics? Yep, gotcha covered there too! Vision BASIC was designed to greatly minimize your need to POKE around with all those crazy registers. In fact, you might never need to POKE again! And if you find yourself needing a command or function that isn't available, you can simply create it yourself – by creating the needed subroutine and calling it by whatever name you choose to give it. These "user defined" commands and functions can be saved into separate files and added to your programs whenever you need them!
The Selfie Project provides an educational platform for teaching undergraduate and graduate students the design and implementation of programming languages and runtime systems. The focus is on the construction of compilers, libraries, operating systems, and virtual machine monitors. The common theme is to identify and resolve self-reference in systems code which is seen as the key challenge when teaching systems engineering, hence the name.
Selfie is a self-contained 64-bit, 11-KLOC C implementation of:
Selfie generates ELF binaries that run on real RISC-V hardware as well as on QEMU and are compatible with the official RISC-V toolchain, in particular the spike emulator and the pk kernel.
In this Github repository, I'm documenting my journey to write a self-compiling compiler for a subset of the C language. I'm also writing out the details so that, if you want to follow along, there will be an explanation of what I did, why, and with some references back to the theory of compilers.
But not too much theory, I want this to be a practical journey.
Emscripten plugs into llvm-gcc or CLANG and intercepts the intermediate code, which it then translates into JavaScript. That JavaScript then runs natively in modern browsers with little evidence of slowdown. As proofs of concept they compiled Unreal 3, the Nebula3 engine, ScummVM, VICE, OpenSCAD, itself (yes, it's self-hosting), and a half-dozen popular programming languages into JavaScript and run them inside of web browsers.