No user input in online IDE?

I'm completely new to Rust and try to get my initial hands-on training by reading the Book, running the code in the online IDE before I really need to install Rust on my system. Besides, there are exercises in the book that require user communication with the program during the runtime. But it seems the IDE doesn't have an option for user input (yet?) in its current state.
Are there any plans to include one in the future? Or, is there an option to "activate" the user input that I missed? The absence of user input is the only thing for now that makes me think of installing the language on computer (as most of you probably did).

Thanks!

No, there's no way to pass input to your running code on the playground. (There is an old open issue on the repo about this.) To run the guessing game example and try it out, you'll have to install Rust on your computer.

Fair enough. Thank you for the clarification! Time to install Rust on my computer then - it would happen anyway soon or later...

I'm guessing this will never happen, because it's a textbook definition of untrusted user input.

It's already running arbitrary user code, though?

2 Likes

I don't know this for sure, but I'd assume that is sandboxed.
Don't get me wrong, I see your point: if it already runs arbitrary code, what's some untrusted input?

However, technically it should be not all that difficult to do, so what other reason could there be?

For some reason I always thought it ran the code locally in the browser (through something like Emscripten/WebAssembly). But apparently runs in a backend running in docker.

That project predates WASM availability, so that's probably why.

1 Like