Get the latest tech news

Rust to C compiler – 95.9% test pass rate, odd platforms


This is an update on the progress I have made on my Rust to C compiler. I am experimenting a bit with a new article format: instead of an overarching theme, this is more of a collection of smaller bits and pieces, sewn together.

So, the ability to just use a built-in emulated version of this intrinsic is amazing: this means I don’t need to fiddle around and find my own solution to this problem. For now, the plan is to get as close to standard-compliant C99(or maybe even ANSI C) as possible, and only use standard POSIX APIs(I need some threading support to properly initialise thread-locals). The main issue is that there exist some rather exotic r/lvalues which don’t map too well to C. They are quite hard to show without going into some more obscure features of Rust, like dynamically sized types.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of C Compiler

C Compiler

Photo of odd platforms

odd platforms

Photo of % test pass rate

% test pass rate

Related news:

News photo

The earliest versions of the first C compiler known to exist

News photo

Why GCC 1.42 on the Tektronix 4404 – with a C compiler from 1979

News photo

Show HN: My C compiler compiled itself