Hacker News new | past | comments | ask | show | jobs | submit login

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.



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


I think Rust's attractiveness is due to its type system, which does not necessarily need to be statically compiled.


Conversedly, 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..., GHCi's name doesn't lie and it's actually an interpreter.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: