CensoredUsername / Dynasm Rs
Licence: mpl-2.0
A dynasm-like tool for rust.
Stars: ✭ 432
Labels
Projects that are alternatives of or similar to Dynasm Rs
eleventy solo starter njk
Further development suspended as of 2021-09-11. Please refer instead to https://www.11ty.dev/docs/starter/ for a wide selection of other Eleventy starter sets.
Stars: ✭ 22 (-94.91%)
Mutual labels: jit
Enso Archive
Looking for Enso, the visual programming language? ➡️ https://github.com/enso-org/enso
Stars: ✭ 305 (-29.4%)
Mutual labels: jit
yarrow
[yarrow] JVMCI based optimizing compiler for HotSpot VM
Stars: ✭ 21 (-95.14%)
Mutual labels: jit
Cranelift Jit Demo
JIT compiler and runtime for a toy language, using Cranelift
Stars: ✭ 297 (-31.25%)
Mutual labels: jit
Opensmalltalk Vm
Cross-platform virtual machine for Squeak, Pharo, Cuis, and Newspeak.
Stars: ✭ 345 (-20.14%)
Mutual labels: jit
Awesome Graal
A curated list of awesome resources for Graal, GraalVM, Truffle and related topics
Stars: ✭ 302 (-30.09%)
Mutual labels: jit
Codegen
Experimental wrapper over LLVM for generating and compiling code at run-time.
Stars: ✭ 362 (-16.2%)
Mutual labels: jit
Devito
Code generation framework for automated finite difference computation
Stars: ✭ 285 (-34.03%)
Mutual labels: jit
Monohook
hook C# method at runtime without modify dll file (such as UnityEditor.dll)
Stars: ✭ 348 (-19.44%)
Mutual labels: jit
dmr c
dmr_C is a C parser and JIT compiler with LLVM, Eclipse OMR and NanoJIT backends
Stars: ✭ 45 (-89.58%)
Mutual labels: jit
Firebird
Third-party multi-platform emulator of the ARM-based TI-Nspire calculators
Stars: ✭ 374 (-13.43%)
Mutual labels: jit
Numpile
A tiny 1000 line LLVM-based numeric specializer for scientific Python code.
Stars: ✭ 341 (-21.06%)
Mutual labels: jit
Cascade
A Just-In-Time Compiler for Verilog from VMware Research
Stars: ✭ 413 (-4.4%)
Mutual labels: jit
Ilgpu
ILGPU JIT Compiler for high-performance .Net GPU programs
Stars: ✭ 374 (-13.43%)
Mutual labels: jit
Easy Just In Time
LLVM Optimization to extract a function, embedded in its intermediate representation in the binary, and execute it using the LLVM Just-In-Time compiler.
Stars: ✭ 361 (-16.44%)
Mutual labels: jit
A Dynamic assembler written in Rust for Rust.
The purpose of this tool is to ease the creation of programs that require run-time assembling.
It is compatible with stable rustc 1.45 and higher.
##dynasm-rs
on irc.freenode.net
Features
- Fully integrated in the rust toolchain, no other tools necessary.
- The assembly is optimized into a series of
Vec.push
andVec.extend
statements. - Errors are almost all diagnosed at compile time in a clear fashion.
- Write the to be generated assembly inline in nasm-like syntax using a simple macro.
Documentation
Architecture support
- Supports the x64/x86 instruction sets in long and protected mode with every AMD/Intel/VIA extension except for AVX-512.
- Supports the aarch64 instruction set up to ARMv8.4 except for SVE instructions. The development of this assembler backend has been generously sponsored by the awesome folks at Wasmer!
Example
use dynasmrt::{dynasm, DynasmApi, DynasmLabelApi};
use std::{io, slice, mem};
use std::io::Write;
fn main() {
let mut ops = dynasmrt::x64::Assembler::new().unwrap();
let string = "Hello World!";
dynasm!(ops
; .arch x64
; ->hello:
; .bytes string.as_bytes()
);
let hello = ops.offset();
dynasm!(ops
; .arch x64
; lea rcx, [->hello]
; xor edx, edx
; mov dl, BYTE string.len() as _
; mov rax, QWORD print as _
; sub rsp, BYTE 0x28
; call rax
; add rsp, BYTE 0x28
; ret
);
let buf = ops.finalize().unwrap();
let hello_fn: extern "win64" fn() -> bool = unsafe { mem::transmute(buf.ptr(hello)) };
assert!(hello_fn());
}
pub extern "win64" fn print(buffer: *const u8, length: u64) -> bool {
io::stdout()
.write_all(unsafe { slice::from_raw_parts(buffer, length as usize) })
.is_ok()
}
Background
This project is heavily inspired by Dynasm
Sponsorship
The development of the Aarch64 assembler backend has been sponsored by Wasmer.
License
Mozilla Public License, v. 2.0, see LICENSE
Copyright 2016 CensoredUsername
Guaranteed to be working compiler versions
This project used to be a compiler plugin, so for old compilers, here's a list of which version of dynasm was guaranteed to work with which compiler. As the project has since transitioned to be a proc macro, this is not relevant for modern versions of the compiler.
-
v0.2.0
:rustc 1.27.0-nightly (ac3c2288f 2018-04-18)
-
v0.2.1
:rustc 1.28.0-nightly (a1d4a9503 2018-05-20)
-
v0.2.3
:rustc 1.31.0-nightly (96cafc53c 2018-10-09)
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].