perry
cranelift-jit-demo
| perry | cranelift-jit-demo | |
|---|---|---|
| 12 | 8 | |
| 3,610 | 748 | |
| 38.2% | 1.1% | |
| 9.9 | 3.3 | |
| 7 days ago | 7 months ago | |
| Rust | Rust | |
| MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
perry
-
Perry Compiles TypeScript directly to executables using SWC and LLVM
On other sites, like github and reddit. This exchange was funny though. He eventually gets called out by the other commenter to stop responding with an LLM: https://github.com/PerryTS/perry/issues/139#issuecomment-429...
- I am worried about Bun
- Perry compiles TypeScript to native GUI and CLI apps on 10 platforms
- Perry – TypeScript → Native
- PerryTS: Compile TypeScript to native executables with LLVM
-
Show HN: Pry – TypeScript compiled to native code, no Electron or V8
Hey HN — I've been building Perry, a compiler that takes TypeScript and emits native binaries. No V8, no runtime, no Electron. It maps to platform-native UI widgets: AppKit on macOS, UIKit on iOS, Android Views on Android, GTK4 on Linux, Win32 on Windows.
Pry is the first real app built with it — a JSON viewer, deliberately small.
It's in the iOS/macOS App Store and Google Play right now. Linux build works, Windows is waiting on code signing.
The compiler itself is written in Rust. It handles TypeScript parsing, type checking, and lowers to native code. The UI bindings aren't a wrapper library — the compiler generates the actual platform API calls.
This is a building-in-public thing. Pry is the proof-of-concept. The bigger goal is a full IDE. Happy to answer questions about the compiler architecture, the app store submission process, or anything else.
Compiler repo: https://github.com/PerryTS/perry
cranelift-jit-demo
-
Allocating Heap with Cranelift
I'm working on a small stack-based programming language. I'm currently at a stage where I'm trying to compile it using Cranelift. Altrough the Cranelift documentation is extensive, I'm lacking a broader picture on how to approach some things like heap-allocations and stack-management. The only example project I found are cranelift-jit-demo and this wonderful post.
-
JITting functions in Rust for runtime performance flexibility
First, it's much easier than you think, I swear. I strongly suggest that you start with the cranelift JIT toy language demo, it has everything that you need to get started.
-
We're working on a new WASM/Rust scripting system. Here I'm playing around with a script that changes the day/night cycle.
Fyi I've checked a few (from here; https://github.com/appcypher/awesome-wasm-langs): - assembly script complier is written is typescript/javascript and in theory could be compiled to wasm, and hence could be embedded, but it is only theory as noone has managed to complete this flow - rust-driver requires the linker and calls it as an external tool to link the rustcore to the user code. without the core lib i could not manage to create anything usable. - zig (somewhat similar to rust): on discord some experr said it cannot be embedded and he see no option/plan for it. - lua: they have lua runtime running in wasm, but no transpiller to wasm I've also checked a few other without any success and closest I coild get was the example language for cranelift (https://github.com/bytecodealliance/cranelift-jit-demo)
-
Rust libraries to build a compiler for my language?
JITs are somehow more tricky and differ in the a few points including: a) Codegen is much more time critical. b) JITs must know what's allready generated and what isn't. c) JITs often rely on informations only generated at runtime and must respond to that. See here for a JIT example witten with cranelift: https://github.com/bytecodealliance/cranelift-jit-demo.
-
What is a really cool thing you would want to write in Rust but don't have enough time, energy or bravery for?
You could also try Cranelift. The resulting code isn't as optimized as with LLVM, but it's faster and pleasant to use (and is written in Rust).
-
How to write a compiler or interpreter in rust
Backend IRs for code generation: - Cranelift (see https://github.com/bytecodealliance/cranelift-jit-demo as well as the messages on the Zulip chat if you get stuck)
-
So about the right way to write an interpreter
As for LLVM, I'm not sure if there are any tutorials but I would really advise writing a bytecode interpreter first, unless you already have some grasp of assembly. However, this repository: https://github.com/bytecodealliance/cranelift-jit-demo is really great for learning cranelift which is essentially an LLVM alternative.
-
Cranelift, Part 2: Compiler Efficiency, CFGs, and a Branch Peephole Optimizer
It was mainly built for wasm compilation. So no it is not married to rust. https://github.com/bytecodealliance/cranelift-jit-demo
What are some alternatives?
rustc_codegen_cranelift - Cranelift based backend for rustc
rust-langdev - Language development libraries for Rust
lumina - Lumina is an eager-by-default natively compiled functional programming language with the core goals of readibility, practicality, compiler-driven development and simplicity.
lineiform - A meta-JIT library for Rust interpreters
wasmtime - A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
crafting-interpreters-rs - Crafting Interpreters in Rust