Ask HN: Recommendation for general purpose JIT compiler

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • qbe-rs

    QBE IR in natural Rust data structures

    The usual recommendation have been given. Now for more touristic approach what I would like to use if given excuse and time. All those options are mostly written in C:

    - QBE [1] - small compiler backend with nice IL

    - DynASM [2] - IIUC the laujit's backend, that can and is used by other languages

    - uBPF - Userspace eBPF VM. Depending on your DSL the eBPF toolchain could fit your use-case, but this would probably be the biggest excursion.

    [1] https://c9x.me/compile/

    [2] https://luajit.org/dynasm.html

    [3] https://github.com/iovisor/ubpf

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • mir

    A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR

  • asmjit

    Low-latency machine code generation

  • Oberon

    Oberon parser, code model & browser, compiler and IDE with debugger, and an implementation of the Oberon+ programming language

    If your DSL is statically typed then I recommend that you have a look at the Mono CLR; it's compatible with the ECMA-335 standard and the IR (CIL) is well documented, even with secondary literature.

    If your DSL is dynamically typed I recommend LuaJIT; the bytecode is lean and documented (not as good as CIL though). LuaJIT also works well with statically typed languages, but Mono is faster in the latter case. Even if it was originally built for Lua any compiler can generate LuaJIT bytecode.

    Both approaches are lean (Mono about 8 MB, LuaJIT about 1 MB), general purpose, available on many platforms and work well (see e.g. https://github.com/rochus-keller/Oberon/ and https://github.com/rochus-keller/Som/).

  • Som

    Parser, code model, navigable browser and VM for the SOM Smalltalk dialect (by rochus-keller)

    If your DSL is statically typed then I recommend that you have a look at the Mono CLR; it's compatible with the ECMA-335 standard and the IR (CIL) is well documented, even with secondary literature.

    If your DSL is dynamically typed I recommend LuaJIT; the bytecode is lean and documented (not as good as CIL though). LuaJIT also works well with statically typed languages, but Mono is faster in the latter case. Even if it was originally built for Lua any compiler can generate LuaJIT bytecode.

    Both approaches are lean (Mono about 8 MB, LuaJIT about 1 MB), general purpose, available on many platforms and work well (see e.g. https://github.com/rochus-keller/Oberon/ and https://github.com/rochus-keller/Som/).

  • minivm

    A VM That is Dynamic and Fast

    Maybe take a look at MiniVM[0]? It was on HN a couple months ago[1].

    [0]: https://github.com/fastvm/minivm

  • wasmtime

    A fast and secure runtime for WebAssembly

    I haven't used it, but cranelift is also my first thought for this.

    If you want a stable interface though, I might use wasm on top of it via wasmtime. I'm not sure how stable the API for wasmtime is, but at least the IR (wasm) is, and there's an ecosystem of tools around it.

    https://github.com/bytecodealliance/wasmtime

  • ubpf

    Userspace eBPF VM

    The usual recommendation have been given. Now for more touristic approach what I would like to use if given excuse and time. All those options are mostly written in C:

    - QBE [1] - small compiler backend with nice IL

    - DynASM [2] - IIUC the laujit's backend, that can and is used by other languages

    - uBPF - Userspace eBPF VM. Depending on your DSL the eBPF toolchain could fit your use-case, but this would probably be the biggest excursion.

    [1] https://c9x.me/compile/

    [2] https://luajit.org/dynasm.html

    [3] https://github.com/iovisor/ubpf

  • Befunge

    lang befunge 93 fast

  • simplelanguage

    A simple example language built using the Truffle API.

  • sljit

    Platform independent low-level JIT compiler

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Book – Writing a C Compiler: Build a Real Programming Language from Scratch

    6 projects | news.ycombinator.com | 15 Aug 2024
  • What part of Rust compilation is the bottleneck?

    1 project | news.ycombinator.com | 16 Mar 2024
  • Rust port of B3 from WebKit, LLVM-like backend

    2 projects | /r/ProgrammingLanguages | 14 Apr 2023
  • Rust is now officially supported on some Infineon microcontrollers! (more to come later this year)

    1 project | /r/rust | 8 Mar 2023
  • What is the LLVM archive rewrite in Rust all about?

    2 projects | /r/rust | 26 Jan 2023

Did you konow that C is
the 7th most popular programming language
based on number of metions?