11 points xqb64 | 7 comments | | HN request time: 0.94s | source | bottom

Hello.

I wanted to share what I had been working on for the past couple of months or so. It's an optimizing C compiler for a large subset of the C programming language written in Rust. It's basically a Rust implementation of the C compiler from Nora Sandler's book[1].

It has been a great educational exercise and I wholeheartedly recommend it to everyone.

[1]: https://nostarch.com/writing-c-compiler

1. lutusp ◴[] No.41910319[source]
It's my hope that people will take the hint: "Wait ... if Rust is a better way to compile C than C itself, maybe I should learn Rust."
replies(4): >>41950482 #>>41950572 #>>41950577 #>>41950633 #
2. kif ◴[] No.41950482[source]
I've tried Rust, and it's just too much cognitive overhead. C is simple, and that simplicity is hard to beat. Go on the other hand is more like C in that regard.
3. hu3 ◴[] No.41950572[source]
Currently, that would be Zig.
4. yjftsjthsd-h ◴[] No.41950577[source]
What makes you think Rust is a better way to compile C than C?
replies(1): >>41950653 #
5. unclad5968 ◴[] No.41950633[source]
Rust itself is compiled with LLVM which is millions of lines of C++. Does that mean that C++ is better than rust?
6. fanf2 ◴[] No.41950653{3}[source]
Algebraic data types