rustc_codegen_cranelift
foth
Our great sponsors
rustc_codegen_cranelift | foth | |
---|---|---|
44 | 9 | |
1,434 | 69 | |
5.2% | - | |
9.7 | 5.1 | |
5 days ago | 2 months ago | |
Rust | Go | |
Apache License 2.0 | GNU General Public License v3.0 only |
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.
rustc_codegen_cranelift
-
Cranelift code generation comes to Rust
Windows is supported. See https://github.com/rust-lang/rustc_codegen_cranelift/issues/....
- What part of Rust compilation is the bottleneck?
-
A Guide to Undefined Behavior in C and C++
> When this happens, it seems like it'll be possible to get the LLVM bits out of the bootstrap process and lead to a fully self-hosted Rust.
What do you mean by "when this happens"? GP's point is that this has already happened: the Cranelift backend is feature-complete from the perspective of the language [0], except for inline assembly and unwinding on panic. It was merged into the upstream compiler in 2020 [1], and a compiler built with only the Cranelift backend is perfectly capable of building another compiler. LLVM hasn't been a necessary component of the Rust compiler for quite some time.
-
What are some stuff that Rust isn't good at?
Note that the Cranelift codegen will eventually become standard for debug builds to speed them up.
-
Rust port of B3 from WebKit, LLVM-like backend
Maybe one day we'll have rustc b3 backend like what they did with Cranelift
-
Any alternate Rust compilers?
Additionally, there is gcc codegen for rustc (https://github.com/rust-lang/rustc_codegen_gcc), which is not a compiler per se, but an alternative code generator, with more architectures supported and other nice things. It's also coming along, but there's still a lot of work to do there too. There's also Cranelift codegen (https://github.com/bjorn3/rustc_codegen_cranelift), which is designed to make debug builds faster, but this is not as exciting/useful as the other 2.
-
Capsules, reactive state, and HSR: Perseus v0.4.0 goes stable!
For the instant reloading, that's in Sycamore, so you should speak to its devs, but as for the alternative compiler backend, it's not my project, but it uses Cranelift and works pretty well! See https://github.com/bjorn3/rustc_codegen_cranelift for details.
- Security Engineer looking for ways to see if any of my tasks could slowly be ported to Rust or should I just stick with Python.
- Rust is now officially supported on some Infineon microcontrollers! (more to come later this year)
-
Improving Rust compile times to enable adoption of memory safety
The more immediate goal of "distribute the cranelift backend as a rustup component" has been making good progress and seems like it might happen relatively soon https://github.com/bjorn3/rustc_codegen_cranelift/milestone/...
foth
- Show HN: Writing a simple FORTH-like system, in simple steps
- Show HN: Implementing a simple FORTH, inspired by a Hacker News thread
-
Byte Magazine: The FORTH programming language
I hacked up a simple forth-like system in golang, by following the overview posted in this hackernews comment-chain:
https://news.ycombinator.com/item?id=13082825
The result is here:
It's not real, but it was a pretty fun experiment regardless.
-
Jonesforth – A sometimes minimal FORTH compiler and tutorial (2007)
Here's one of the many forks that brings it up to 64-bit:
https://github.com/matematikaadit/jombloforth
If you like forth there's an awesome series of comments here on hacker news on building a simple variant in a few simple steps:
https://news.ycombinator.com/item?id=13082825
I took that, and built a simple forth-like system, in golang following the original recipe and breaking it down into simple steps for learning-purposes:
- Forth control flow execution steps.
-
ColorForth (2009)
I'll always vote up submissions referencing anything FORTH related. For me FORTH is as much fun as lisp appears to be for others. I've never really done much with it, but I always like the simplicity and the ability to reason about it.
Sure FORTH has problems of its own, but it's always nice to use. I've hacked up a couple of simple FORTH-like systems over the years, most recently this one which was inspired by a thread on this site:
A lot of people go through guides of writing a lisp, I'd love to urge people to try writing a simple FORTH interpreter instead, or even something somewhat related such as TCL.
-
Lang Jam: create a programming language in a weekend
There's even a recipe posted in a couple of comments here:
https://news.ycombinator.com/item?id=13082825
I followed that guide to implement a simple FORTH-like system in golang:
As I was following the implementation recipe I broke it down into "educational steps". Although it isn't a true FORTH it is pretty easy to understand and useful enough to embed inside other applications.
Now and again I consider doing it again, but using a real return-stack to remove the hardcoded control-flow words from the interpreter, but I never quite find the time.
- Tutorial-style FORTH implementation written in Golang
-
Wisp: A light Lisp written in C++
I actually hacked up a simple forth-like system, after reading a brief howto here on hackernews:
Here's the thread which has the barebones overview which inspired me:
https://news.ycombinator.com/item?id=13082825
I could have taken it further, but the implementation there is not "real" in the sense that there is no real return-stack, so you can't implement IF-statements using the lower-level primitives.
That said it is a good starting point, and I had some fun doing it. I'd guesstimate it is more of a single weekend project though, rather than longer.
What are some alternatives?
wasmtime - A fast and secure runtime for WebAssembly
wisp - A little Clojure-like LISP in JavaScript
gccrs - GCC Front-End for Rust
cling - The cling C++ interpreter
sccache - Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
sectorlisp - Bootstrapping LISP in a Boot Sector
mrustc - Alternative rust compiler (re-implementation)
factor - Factor programming language
cranelift-jit-demo - JIT compiler and runtime for a toy language, using Cranelift
zForth - zForth: tiny, embeddable, flexible, compact Forth scripting language for embedded systems
tch-rs - Rust bindings for the C++ api of PyTorch.
Vacietis - C to Common Lisp compiler