llvm-cbe
mrustc
Our great sponsors
llvm-cbe | mrustc | |
---|---|---|
14 | 75 | |
783 | 2,069 | |
2.0% | - | |
6.5 | 9.0 | |
about 1 month ago | 5 days ago | |
C++ | C++ | |
GNU General Public License v3.0 or later | MIT License |
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.
llvm-cbe
-
Ask HN: LLVM vs. C
So how does the LLVM C backend work then?
-
rust to c complication?
One alternative worth mentioning, though, would be the LLVM C Backend maintained by the Julia community.
-
Programming language that compiles to clean C89 or C99?
If you drop "easily" and "human" (/s) from your requirements list, then the C backend for LLVM might work. Then you can choose any programming language you want that has LLVM 10-compatible frontend.
- Snowman native code to C/C++ decompiler for x86/x86_64/ARM
-
Can Rust do every low level stuff C/C++ do?
You can convert llvm bitcode to C and then use C compiler, there is such project https://github.com/JuliaComputingOSS/llvm-cbe .
-
lipstick: a Rust-like syntax frontend for C
I'm really surprised that the LLVM C backends have continually been resurrected then abandoned over the years. It's a good solution to this sort of thing and would enable a lot of cool stuff like Rust to weird embedded platforms. The most recent one is the Julia backend: https://github.com/JuliaComputingOSS/llvm-cbe
-
Show HN: prometeo – a Python-to-C transpiler for high-performance computing
Well IMO it can definitely be rewritten in Julia, and to an easier degree than python since Julia allows hooking into the compiler pipeline at many areas of the stack. It's lispy an built from the ground up for codegen, with libraries like (https://github.com/JuliaSymbolics/Metatheory.jl) that provide high level pattern matching with e-graphs. The question is whether it's worth your time to learn Julia to do so.
You could also do it at the LLVM level: https://github.com/JuliaComputingOSS/llvm-cbe
For interesting takes on that, you can see https://github.com/JuliaLinearAlgebra/Octavian.jl which relies on loopvectorization.jl to do transforms on Julia AST beyond what LLVM does. Because of that, Octavian.jl beats openblas on many linalg benchmarks
-
Writing a SQLite clone from scratch in C
You can try your luck with the "resurrected" C backend: https://github.com/JuliaComputingOSS/llvm-cbe
I don't understand why I see so many requests for LLVM-based languages to change around their backend or IR, that seems to be a huge amount of work for comparatively little benefit. The correct thing to do there is to just add support for those to LLVM.
-
uLisp
Just to clarify - Gambit, Chicken, and Carp all compile to portable C.
I hadn't realized LLVM mainline doesn't support Xtensa. I'm surprised.
D does support Xtensa via LDC (https://forum.dlang.org/thread/[email protected]...). It looks like GDC also nearly supports it, requiring only a minor patch at present.
A functioning LLVM backend does exist (https://github.com/espressif/llvm-project/issues/4) and might be making very slow progress towards being merged. A quick search shows that it works for Rust. I suspect (but don't know) that it might work for Terra as well.
There's also the LLVM C backend (https://github.com/JuliaComputingOSS/llvm-cbe) but I've no idea how efficient such an approach is when applied to real world embedded tasks.
-
Speed of Rust vs C
The Julia community maintains llvm-cbe, a C-backend for LLVM.
mrustc
-
Why do lifetimes need to be leaky?
No, you don't. Existential proof: mrustc ignores lifetimes. Just flat out simply ignores. It changes some corner-cases related to HRBT, yet rustc compiled by mrustc works (that's BTW mrustc exist: to bootsrap the rustc compiler).
-
I think C++ is still a desirable coding platform compared to Rust
Incidentally C++ is the only way to bootstrap rust without rust today.
-
Rust – Faster compilation with the parallel front-end in nightly
Well, there is mrustc[0], a Rust compiler that doesn't include a borrow-checker, so it's possible to compile (at least some versions of) Rust without a borrow checker, though it might not result in the most optimized code.
AFAIK there are some optimization like the infamous `noalias` optimization (which took several tries to get turned on[1]) that uses information established during borrow checking.
I'm also not sure what the relation with NLL (non-lexical lifetimes) is, where I would assume you would need at least a primitive borrow-checker to establish some information that the backend might be interested in. Then again, mrustc compiles Rust versions that have NLL features without a borrow-checker, so it's again probably more on the optimization side than being essential.
- Running the "Reflections on Trusting Trust" Compiler
-
GCC 13 and the state of gccrs
Mrustc supports Rust 1.54.0 today
- Any alternate Rust compilers?
-
Stop Comparing Rust to Old C++
There are three. The official one, mrustc (no borrow checker, but can essentially compile the official rustc) and GCC (can't really compile anything substantial yet). Only rustc is production-ready though.
-
“33% of GStreamer commits are now in Rust”, from the 1.22 release notes
Otherwise you could try compiling to C using mrustc and going from there, but as mrustc is really only intended for compiler bootstrapping it won't be a fun experience. Mrustc mostly just assumes that the code you're compiling is valid, so you lose all the advantages of choosing Rust over C in the first place. It also targets x86-64 so the C it emits might need some work before it'll compile.
-
Am I dumb or does rust have a garbage collector?
In fact, https://github.com/thepowersgang/mrustc compiles code without the need for a borrow checker :-)
-
GCC Rust Front-End Cleared For Merging In GCC 13
Instead of an independent re-implementation, a small niche implementation whose only purpose is to bootstrap, like mrustc. Since its a much smaller scope, and only intended to work on known correct code, its much simpler and easier to do. It doesnt need to do any type or borrow checking or much of anything, because the rust source is already known to be correct/checked by itself.
What are some alternatives?
gccrs - GCC Front-End for Rust
gccrs - GCC Front-End for Rust
rust-ttapi
nim-esp8266-sdk - Nim wrapper for the ESP8266 NON-OS SDK
miri - An interpreter for Rust's mid-level intermediate representation
gcc-rust - a (WIP) Rust frontend for gcc / a gcc backend for rustc
llvm-project - Fork of LLVM with Xtensa specific patches. To be upstreamed.
winlamb - A lightweight modern C++11 library for Win32 API, using lambdas to handle Windows messages.
ponyc - Pony is an open-source, actor-model, capabilities-secure, high performance programming language
rustls - A modern TLS library in Rust
reference - The Rust Reference
ulisp - A version of the Lisp programming language for ATmega-based Arduino boards.