Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One of my favorite early Rust features, in theory, was the interactive shell called "rusti". In practice it was awful to use because it was slow, crashed all the time, and required whole blocks of code be entered at once (declaring, defining, and using a variable for example). Some of that was attributable to beta status of the language but it seems like they ditched it in the end. Is there actual value to this sort of thing for languages that are classically compiled instead of interpreted? At least for Go, Rust, and C speed of compilation is less of an issue overall but compiling C++, even with clang, is so much of a bear that I can't see this catching on.


Slow compilation time is actually a great reason for having a REPL. e.g. Clojure and Julia are both REPL-based languages, though both secretly need to be compiled (and do so relatively slowly). In practice you don't notice the compile step at all, since after compiling and running once you can just compile 1-2 lines at a time in the REPL and it patches the running program for you – it's all instant.

A more interesting issue for REPLs is how expression- or statement-oriented the language is (c.f. Martin Odersky's concerns about the upcoming Java REPL). In Java/CXX it's much more likely for a function to want to change an external object, in which case you'll need to set up the environment, run the code, check the environment for the change, for every line you write. That's much more likely to be the nail in the coffin for this.




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

Search: