Email or username:

Password:

Forgot your password?
notgull

A while back I said it would be really nice for bootstrapping if there was a Rust compiler or interpreter written in C. Of course, that would be ridiculous.

But it’s worth trying.

I’ve written a tokenizer for Rust in pure C. I’ve tested it on a few Rust crates and it seems to work. Now moving on to the syntax tree parser.

Effectively rewriting the syn crate in C, with no real tools (no yacc!). I’ll probably give up on this eventually, but let’s see how far I can push it.

2 comments
aismallard

@notgull Doesn’t Rust have its own bootstrapping compiler, which uses a non-safety checked subset of Rust or something like that? You could target that in portable C and then have that as your C bootstrapper compiler perhaps

notgull

My goal is that it should be possible to bootstrap a working copy of rustc using nothing but a basic C compiler (I'm targeting cproc and tinycc) as well as a basic shell interpreter (Kaem). This would mean Rust can be introduced at a very early point in the Live Bootstrap process.

Go Up