If we drop RAII, we get: OCaml, ... ?
If we drop REPL, we get: C++, Rust, ...
I'm in this situation where I want RAII for nice object cleanup / destructors, but am also really missing the interactivity of a REPL instead of waiting for cargo to finish compiling.
Is there any language that has all 3 of the above?
I have heard about evcxr and saw papyrus on news.yc. irust is news to me.
I have not tried them. From a superficial look, they seem more in-progress than "production ready" (but I may be wrong about this.)
There's this additional constraint (not mentioned in original question) that I need this to work in wasm32 -- so solutions involving calling cargo/rustc per line and loading a *.so dynamically are unlikely to work.
I'm really surprised I can't find a language with REPL + RAII + Static Types. Having such a language, even if it lacked traits / borrow checker, as a scripting language for Rust would be really useful for wasm32 applications. (Part of it being that the RAII in the "scripting language" can in turn trigger the RAII in Rust -- something that's not obvious how to do with rust-wasm32/JS bindings.)
I’ve never used it, nor do I know if it’s any good, but Swift appears to have a REPL. (Also I have no idea what the wasm story is for swift.)
I’m personally not that surprised you’re having trouble finding such things. With dynamic/interpreted languages involving heavy (or any at all) runtime/gc you almost get a REPL for free. It seems like one would have to go quite far out of your way to build a REPL for a compiled “systems” programming language.
I wonder if something like Miri would be a good base for a rust REPL that didn’t make use of dynamically loaded shared lib hacks?
This is insane. I meant it as a joke given the Laziness / WHNF / GC aspects of Haskell. I don't see how this can possibly work -- is there also a "mini haskell runtime" written in Rust?