3 ms·
Rust as a language is compiled, so interpreting it doesn't make much sense, and JIT only makes sense for interpreters.
by keeperofdakeys 13y ago
Rust as a language is compiled, so interpreting it doesn't make much sense, and JIT only makes sense for interpreters.
- Jweb_Guru 13y agoLike the interpreted language that is Java? :) A JIT compiler could make sense for Rust, though I'd agree that the usecases for that are probably not very interesting compared to some other languages.
- keeperofdakeys 13y agoBut java bytecode itself is interpreted. For things like the web, you really want a language that can start executing immediately, so you really need to interpret, or have an agnostic bytecode.
- Jweb_Guru 13y agoI think it's a bit of a stretch to call the JVM an interpreter. Having said that, if you want to deliver Rust as bytecode, emscripten would seem to satisfy that usecase (though obviously that's not what the original author was talking about, and it doesn't work properly at the moment).
- nardi 13y agoThis is one of my pet peeves. Any language can be either compiled or interpreted. I think what you mean is, "No one has written an interpreter for Rust." But that is also nonsense, as all compilers contain an interpreter. The difference is just that instead of streaming instructions straight to the CPU, compilers wrap the instructions in an executable format and save them to a file.
- keeperofdakeys 12y agoI was commenting specifically on "JIT Compiler". It should really be "JIT Interpreter". Naturally, it's possible to write an interpreter for any language that is compiled (though sometimes the semantics don't make sense). For a language like Rust, you'd probably want to compile to a bytecode to interpret, to allow all the compiler checks to be preserved. Out of interest, I did a search, and there does seem to be a (depreciated) Rust REPL.