
A PLT Redex model of Rust, almost - luu
https://github.com/lkuper/rust-redex
======
larsberg
From lkuper (on the #rust IRC channel):

If anyone here has an HN account, perhaps you could comment and clarify that I
wrote that thing in April 2011, when Rust was a very different language, and
even then, I only modeled a tiny subset of the language.

~~~
bjz_
Thanks for the headsup. Would be interesting to know more about in what
respects Rust was different, and why this lang is out of date.

~~~
kd0amg
I don't really know what has changed in Rust over time (though a fair amount
has changed in Redex (and some in Racket) since this was written, particularly
an improved way to write a type checker). Skimming over the current version of
the Rust tutorial, it looks like the model doesn't include the full variety of
pointer types (just boxes with no notion of ownership), pattern
matching/algebraic data types (it does have tuples and projection), or
concurrency, and the model's type system is monomorphic. One TODO is for the
stack (I'm not sure what there is to do for that). The other is for
assignment. This would typically be a reduction step that changes the contents
of the heap, but maybe there was still some question about the details of that
change (such as whether/when to drop unreachable heap cells). I expect Rust's
concurrency would require some more thought about how best to represent
program state and some changes to the type system.

------
kristianp
What's a PLT Redex, you ask? [http://redex.racket-
lang.org/](http://redex.racket-lang.org/)

------
sanxiyn
If you are interested in a formal model of Rust,
[https://github.com/nikomatsakis/rust-
formal](https://github.com/nikomatsakis/rust-formal) is probably a better
choice.

~~~
dbaupp
(Note that this is also very old.)

~~~
felixr
It seems as if formal models of Rust have a tendency to rust.

~~~
dbaupp
Haha, anything not in the source tree of Rust (or Servo) tends to rust...
things change quickly.

