rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.98k stars 12.54k forks source link

Implement a Rust REPL #1120

Closed teratorn closed 11 years ago

teratorn commented 12 years ago

REPLs are great.

brson commented 12 years ago

It's true, REPLs are great!

kud1ing commented 12 years ago

See also https://github.com/killerswan/rustx

bstrie commented 12 years ago

See also https://github.com/bleibig/rust-repl

mcandre commented 12 years ago

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

bstrie commented 12 years ago

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.)

graydon commented 12 years ago

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

mcandre commented 12 years ago

--interactive would be helpful.

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

dbp commented 12 years ago

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

catamorphism commented 11 years ago

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

kud1ing commented 11 years ago

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

bstrie commented 11 years ago

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

brson commented 11 years ago

Closing.

rampion commented 10 years ago

Should this be reopened since rusti was removed? #9818

thestinger commented 10 years ago

9898

shaleh commented 10 years ago

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

pnkfelix commented 10 years ago

@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).

shaleh commented 10 years ago

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.

gsingh93 commented 10 years ago

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.

gsingh93 commented 10 years ago

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.

jansegre commented 10 years ago

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

kindlychung commented 8 years ago

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

tyoc213 commented 8 years ago

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

mitaa commented 8 years ago

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

PallHaraldsson commented 8 years ago

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

xfbs commented 6 years ago

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?

chkno commented 6 years ago

See https://github.com/rust-lang/rfcs/issues/655

joshlk commented 4 years ago

evcxr is currently the best REPL implementation

ibraheemdev commented 3 years ago

Rust already has a REPL. Try #bot-usage on the rust discord server 😄

Screen Shot 2020-11-26 at 4 57 12 PM

mental32 commented 3 years ago

Rust already has a REPL. Try #bot-usage on the rust discord server smile

Screen Shot 2020-11-26 at 4 57 12 PM

That's more like a REP than a REPL :smile: (evcxr is pretty cool)

timmyjose commented 1 year ago

evcxr is currently the best REPL implementation

Works rather nicely (if very slowly). Good for small bits of experimentation. Thanks for sharing!