An example of Brainf*** JIT-compiler with only the standard library.

Overview

jit-compiler

An example of Brainf*** JIT-compiler with only the standard library.

Prerequisite

  • Rust(1.56.0-nightly or later, but it must work kind of older version)
  • Linux or WSL, on X64

How to run

$ cargo run
Hello World!

How it works

allocate function calls the systemcall mmap directly with an executable flag. This allocates memories when a file descriptor isn't given. In macOS, how to call mmap is different, so rewrite the code appropriately. Also, if you use M1 mac, ISA is different from X86/64 and must rewrite the code. I don't know the details about Windows API, but to just try it, you should use WSL.

assemble function translates an AST into machine code. If you rewrite it, refer to mnemonics at the comments. It must be easier to do on other architecture than X86/64 ISA.

License

This code is licensed under Unlicense.

You might also like...
A standard for fungible tokens on Move.

Move Program Kit (MPK) The Move Program Kit (MPK) is a collection of software written in the Move programming language for the Aptos blockchain. Modul

Shows only the first page of rustc output

cargo-first-page Shows only the first page of rustc output. Installation cargo install cargo-firstpage Usage Prefix the cargo command by firstpage: T

A simple and fast FRC autonomous path planner (designed for swerve drive)! (Desktop/Laptop only)

This is a website developed for planning autonomous paths for FRC robots. It is intended to be a simple and fast tool to create autos, which works offline at competitions.

Try to find the correct word with only first letter and unknown letter count

Try to find the correct word with only first letter and unknown letter count

`Debug` in rust, but only supports valid rust syntax and outputs nicely formatted using pretty-please
`Debug` in rust, but only supports valid rust syntax and outputs nicely formatted using pretty-please

dbg-pls A Debug-like trait for rust that outputs properly formatted code Showcase Take the following code: let code = r#" [ "Hello, World!

The official zeta compiler
The official zeta compiler

Torq What makes Torq the goto language for creating CLI's? Smaller Executables Inbuilt argument and flag parser Your code will work anywhere in any OS

The nightly_crimes!{} macro commits horrible crimes to allow you to enable nightly features on the stable compiler.

The nightly_crimes!{} macro commits horrible crimes to allow you to enable nightly features on the stable compiler.

A compiler for the esoteric language ℂ.

The ℂ Programming Language It's a language where the only types are "complex number" and "matrix of complex numbers". In particular, this means you ca

Solidity-Compiler Version Manager

Solidity Compiler Version Manager

Owner
Akihito KIRISAKI
I love lolita fashion and static typing languages, especially Haskell :sparkling_heart:
Akihito KIRISAKI
dm-jitaux is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle!

dm-jitaux is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle (such as rewriting/refactroing your DM code).

SS220 20 Dec 13, 2022
JIT compiler and runtime for a toy language, using Cranelift

Hello! This is a simple demo that JIT-compiles a toy language, using Cranelift. It uses the new JIT interface in development here. JIT takes care of m

Bytecode Alliance 468 Jan 7, 2023
🤯 A brainf*ck-style programming language, but readable

?? Brainease Brainease is a brainf*ck-style programming language, but readable. $ cargo install brainease # brainease -f examples/hello.bz save 'H

Arthur Fiorette 11 Sep 30, 2022
A Brainf** interpreter written in rust 🦀

Brainf Interpreter An interpreter for the esoteric programming language Brainfuck written in rust ?? Compilation NOTE: To compile the project, you nee

Chitram Dasgupta 2 Sep 12, 2022
Brainf - A brainfuck interpreter written in Rust 🦀

brainf A brainfuck interpreter written in Rust ?? . Do not I wrote this in my spare time... but still its good! Run Locally Clone the project git cl

Nav 3 Oct 8, 2022
The 峨眉 (EMei) JIT/AOT backend framework.

emei The 峨眉 (EMei) JIT/AOT backend framework. Support Instructions x86_64 mov mov mov_zero_extend_bit8/16 mov_sign_extend_bit8/16/32 mov_rev movs(is m

Lyzh 14 Apr 11, 2022
Sway-lib-core - Sway standard library core primitives.

lib-core This Sway project contains core operators and extremely primitive logic for use in the standard library of the Sway programming language. Usa

Fuel Labs 8 Mar 29, 2022
Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction.

Paru Feature packed AUR helper Description Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction. Installatio

Lulu 4k Jan 9, 2023
This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity.

bottom-bot This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity. Ever had this pro

Bottom Software Foundation 11 Dec 10, 2022
A tool to calculate mean and standard deviation from multiple tests using PageSpeed Insights API.

psi-sample PSI Test tool is an open source tool to assist web developers that runs Page Speed Insight test manually! Installing To install the psi-tes

Igor Brasileiro 14 Sep 10, 2022