Rust: Implement a Rust REPL

Created on 2 Nov 2011  Â·  27Comments  Â·  Source: rust-lang/rust

REPLs are great.

A-runtime E-hard

Most helpful comment

Should this issue be repopened? rusti hasn't seen much love recently and depends on a very old version of the compiler. Would anyone else like to see a REPL?

All 27 comments

It's true, REPLs are great!

REPLs are indespensible. CL sucks, but I'd almost rather use it than a better language without a good REPL.

Until bleibig's REPL is stable, feel free to use my stable-ish REPL-ish sort of thing: https://github.com/bstrie/rust-rustic

(But this is by no means a long-term solution.)

great. longer term I concur we should fold something like bleibig's repl into rustc. an --interactive flag would be great.

--interactive would be helpful.

Suggestion: When argc < 1, default to interactive like scripting languages do.

Somewhat along the same lines as bstrie's rustic, here is a repl that I wrote. The main difference is that it behaves somewhat like a future repl based on LLVM's interpreter probably should behave (ie, statement by statement evaluation, local definitions, imports, etc), but under the hood it is a hack - it is writing out temp files and using rustc to compile them. either way, it is really fun to use, and works right now!

http://github.com/dbp/rustrepl

This exists now (rusti) but is not working too well right now: #4407

Is the scope of this issue "create a REPL" fulfilled?

@kud1ing probably. Separate issues can be opened to address the current REPL breakage.

Closing.

Should this be reopened since rusti was removed? #9818

9898

Yes please!! I often just want to play with a function or two and see how things work.

@shaleh are you aware of this: http://play.rust-lang.org/ ?

It has the advantage over a local repl that it is really trivial to share your example with other people once you're done hacking (see the "share" button at the bottom).

On Jul 10, 2014, at 3:08 PM, Felix S Klock II wrote:

@shaleh are you aware of this: http://play.rust-lang.org/ ?

It has the advantage over a local repl that it is really trivial to share your example with other people once you're done hacking (see the "share" button at the bottom).

—
Reply to this email directly or view it on GitHub.

Yeah that's nice as long as you only hack where there is networking. Not all of my house gets decent WIFI much less trains, cars, etc.

If it can work as an online toy then surely we can get a real version at the shell.

Can this be reopened? I often don't want to share or save the stuff I do in a REPL, so I'd prefer a command line utility.

Oh, I didn't see #9898. I guess dicussion can continue there, but I'd like to see something like rusti for the command line soon, even if it isn't a "proper" REPL. That thread seems to be talking about the proper way to do it, which may take some time to implement.

Someone said something about cling, just to bring it up here. I think it's an awesome project to be based on.

Instant feedback is extremely gratifying. Even Java is going to have a repl in the next major release.

What would be the actual work on this? (even if external?) because rusti was removed as I see from #9818

rusti lives on here https://github.com/murarth/rusti

FYI: Julia language has a REPL, and looking at: https://github.com/iamed2/Rust.jl

it seems you can include Rust code in your files, just as you can C++ with Cxx.jl, or at the REPL, using either language interactively (while Cxx is more slick). [Already it was pretty simple to call Rust, no more difficult than C. If I ever need a non-GC language, I've been thinking Rust would be the preferred complementary language over C.]

Just looking at the code I see AST.jl, not sure you can generate Rust code from Julia (I recall having been told that, maybe a misunderstanding).

Note: https://github.com/iamed2/Rust.jl/blob/master/deps/deps.jl

Should this issue be repopened? rusti hasn't seen much love recently and depends on a very old version of the compiler. Would anyone else like to see a REPL?

evcxr is currently the best REPL implementation

Was this page helpful?
0 / 5 - 0 ratings