4 ms·
You could store them as source files with a hashbang, and make something like "rustrun" which compiles a single Rust source code file and runs the resulting exe
by dromen 10y ago
You could store them as source files with a hashbang, and make something like "rustrun" which compiles a single Rust source code file and runs the resulting executable? That should take ~15 minutes.
I do wish there was an actual Rust interpreter.
- jdormit 10y agoWhy? Rust is a systems-level language. It's not designed for scripting. If that's what you want, use Python/bash/{yourFavoriteScriptingLanguage}.
- ch4s3 10y agoWell, if you can interpret it then its easy to build a repl, and repls are nice.
- fiedzia 10y ago"being interpreted" in not enough to have useful repl. You also need to be dynamic and introspectable. There are interpreters for C, but it doesn't make it suitable to use with repl.
- baq 10y agothere's nothing bad about interpreting a systems language. there are C interpreters available, too. i'd argue it'd be a very useful feature since the compile times of rust are one of its biggest pain points right now.
- moosingin3space 10y agoThere is a dead project named `rusti` (fails to build on Rust nightly >= 2016-08-01) that can interpret Rust source, and a newer project named `miri` (last commit 3 days ago) that interprets MIR output from the compiler. Several of us in the community, me included, would like a REPL, so I'd keep an eye on these projects to see if they go anywhere.