coord-e / Mlml
Licence: mit
self-hosted compiler for a subset of OCaml
Stars: ✭ 41
Programming Languages
ocaml
1615 projects
Projects that are alternatives of or similar to Mlml
Pyast64
Compile a subset of the Python AST to x64-64 assembler
Stars: ✭ 93 (+126.83%)
Mutual labels: compiler, x86-64
Peachpy
x86-64 assembler embedded in Python
Stars: ✭ 1,592 (+3782.93%)
Mutual labels: compiler, x86-64
Babygo
Go compiler made from scratch, which can compile itself. It's going to be the smallest and simplest go compiler in the world.
Stars: ✭ 143 (+248.78%)
Mutual labels: compiler, x86-64
Lbforth
Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
Stars: ✭ 293 (+614.63%)
Mutual labels: self-hosted, compiler
Crust
C compiler toolchain in Rust. [WIP, early development stage]
Stars: ✭ 150 (+265.85%)
Mutual labels: compiler, x86-64
Mir
A light-weight JIT compiler based on MIR (Medium Internal Representation)
Stars: ✭ 1,075 (+2521.95%)
Mutual labels: compiler, x86-64
Ppci
A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python
Stars: ✭ 210 (+412.2%)
Mutual labels: compiler, x86-64
Minijit
A basic x86-64 JIT compiler written from scratch in stock Python
Stars: ✭ 185 (+351.22%)
Mutual labels: compiler, x86-64
Mazucc
A minimalist C compiler with x86_64 code generation
Stars: ✭ 437 (+965.85%)
Mutual labels: compiler, x86-64
Exoframe
Exoframe is a self-hosted tool that allows simple one-command deployments using Docker
Stars: ✭ 972 (+2270.73%)
Mutual labels: self-hosted
Opentorrentsite
A modern torrent site template that is easy to setup with an intuitive GUI. Currently in development.
Stars: ✭ 34 (-17.07%)
Mutual labels: self-hosted
Pytlas
An open-source 🤖💬 Python 3 assistant library built for people and made to be super easy to setup and understand
Stars: ✭ 34 (-17.07%)
Mutual labels: self-hosted
Forsaken Mail
a self-hosted disposable mail service
Stars: ✭ 974 (+2275.61%)
Mutual labels: self-hosted
mlml
mlml is a self-hosted toy compiler for a tiny subset of OCaml.
a detailed description can be found in my blog post (in Japanese): 自作OCamlコンパイラでセルフホストした - molecular coordinates
roadmap
- [x] basic arithmetic
- [x] variables
- [x] if-then-else
- [x] functions
- [x] recursion
- [x] mutual recursion
- [x] closure
- [x] currying
- [x] tuples
- [x] variants
- [x] records
- [x] pattern matching
- [x] structual comparison
- [x] primitive types
- [x] string
- [x] list
- [x] bytes
- [x] array
- [x] formatted output with
Printf
- [x] modules
- [x] definition
- [x] aliases
- [x]
open
- [x] dune-like bundler
- [x] self-hosting!
- [ ] exceptions
- [ ] type checker & type inference
self hosting
mlml is self-hosted. i.e. mlml can compile itself.
./dev/exec.sh ./dev/self_host.sh
To obtain build artifacts, pass a path to local directory as below. You will see compiled binaries under ./self_host
.
mkdir self_host
./dev/exec.sh ./dev/self_host.sh ./self_host
limitations
-
external
definitions are only available for functions - all modules and paths are statically-resolved
- all custom oeprators are left-associative
-
function
keyword does not make an expression
development
If you have docker installed in your system, simply run
./dev/start.sh
to start the development.
You can run tests manually by running the following command:
./dev/exec.sh dune runtest
thanks
The code and algorithm in parser and lexer is strongly inspired by ushitora-anqou/aqaml
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].