4 ms·
What is the use case for a Rust JIT? A REPL or runtime eval()? I though the static compilation of Rust code was one of it selling points.
by cpeterso 14y ago
What is the use case for a Rust JIT? A REPL or runtime eval()? I though the static compilation of Rust code was one of it selling points.
- dmorgan 14y agoProminently, on the parent comment: it makes stuff like this possible: https://github.com/bleibig/rust-repl* https://github.com/bleibig/rust-repl*
- duaneb 14y agoI think Rust's attractiveness is due to its type system, which does not necessarily need to be statically compiled.
- masklinn 14y agoConversedly, you can have compilation and a REPL, Clojure has a repl yet is always compiled (repl instructions are compiled to JVM bytecode using the usual compilation toolset, then that bytecode is loaded and executed). According to http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-compiled.html http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci..., GHCi's name doesn't lie and it's actually an interpreter.
- Tobu 14y agoA REPL is extremely useful for learning, debugging (instead of using print statements, embed an interpreter to see exactly what is going wrong — IPython's one-line embed() for example), sketching (embed into an incomplete part of your program, try out a few things, when it works paste it to your source), and documentation (IPython's ? and ?? — completion is also part of that).
- kibwen 14y agoNotice that the first link I posted there is to a working Rust REPL (though it's rather rough at the moment, there's a lot that could be done to improve it).