On Wed, May 29, 2013 at 12:03 AM, Alex Crichton <[email protected]> wrote:
> In my opinion, the point of rusti is to be a REPL for rust.

Is this a matter of opinion?  I thought it was a fact!  :)

> - What rusti is
>
> The way that rusti works today in my opinion is a bit hacky once you
> look inside. It will take your line of input, fmt! it into a template,
> and then compile the whole template (via rustc using LLVM). After
> compilation is successful, it walks down the ast to figure out what
> you just input, and it then records that line of input in its history
> *as a string*. What this means is that for the second line of input to
> rusti, it will put both the history and the input into the template,
> and re-run all the code again.

Yep, it's a hack.

> - Can rusti be my version of a REPL?
>
> Basically what all that means is that rusti has to save the world's
> state between your lines of input to be my version of a REPL. To the
> best of my knowledge (which could very well be wrong), this is not
> possible to do in Rust.

Why would this not be possible?

>  If someone new comes to rust and tries out the
> fancy 'rusti' command, they'll start to play around but very quickly
> run into some odd scenario that doesn't match what they think.

I agree, and I think this is a reason to try to improve rusti.

Lindsey

P.S. It might be interesting to look at the approach taken by Cling
(http://root.cern.ch/drupal/content/cling), an LLVM-based REPL for
C++.  There's an overview video at
http://www.youtube.com/watch?v=f9Xfh8pv3Fs.  I don't know a lot about
it, but I think the basic approach is: still JIT, but drastically
change the notion of "compilation unit".
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to