Repl / shell rant

Anyone else becoming more frustrated by the lack of a rust repl / shell ?

I have a 20k+ LOC app that I'm currently doing a lot "deserialize; do some computation; serialize" work with. Currently the best thing I can do is to create a crate, then "abuse" the unit test / example framework to run rust functions.

In a language like Python / Clojure / OCaml, I'd fire up a REPL, and type commands there. Instead, I'm in IntelliJ looking for the right "example / unit test" to trigger the "deserialize ; transform ; serialize to disk" sequence I want.

Anyone else run into this barrier / frustration?

If so, what are your workarounds ?

1 Like

I haven't tried evcxr but worth mentioning it.

1 Like

I've used cargo-script (due to lack of maintenance, there appears to be a fork: cargo-eval) and cargo-play for this sort of thing.

Having mostly come from a C and C++ world, I wasn't really expecting a REPL. Of course, if someone managed to pull it off, I would be thrilled. :slight_smile: (see also Introduction to the Swift REPL - Swift Blog - Apple Developer)

2 Likes

For C++, I have experimented with cling. It's pretty good. For data science type of applications, one can install it with conda pretty smoothly xeus-cling.

I've used https://repl.it/. It's not exactly a repl, but I learned a lot of Rust playing with it.

Yes, definitely! I've had great experiences with ruby and python, connecting to live environments, investigating live state and launching methods on live data manually. A good REPL is a great tool when things are hot, definitely not just a development/learning time toy.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.