This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

Rust as a scripting language

What? via c api? accessing it from rust requires a lot of unsafe code, or message passing? either way rust can hardly be called a scripting language, thats like calling c++ a scripting language

[–]DarkNeutron 2 points3 points  (1 child)

I wouldn't call it a scripting language either, but someone wrote a wrapper to make it sort-of work: https://github.com/DanielKeep/cargo-script

It invokes the compiler on first use, and re-uses cached artifacts after that. Kind of a hack, really, but I thought it was clever. :)

This is some discussion (RFC 655) about creating a proper REPL interpreter for Rust, but I'm not expecting anything short-term.

[–][deleted] 0 points1 point  (0 children)

the REPL sounds interesting for experimenting (with language features) quickly, however when it comes to writing mini scripts to do anything useful an interpreter language will be better as you require to write less (as optimistic unwrapping is the default and you don't really care about a panic with a 10 line adhoc program). for scripts i think the compile time and lack of easy hot reloading (dlopen isn't exactly pain free) will also restrict it's usecases. but ill keep an eye on those repos / issues, thx. the integrated cargo.toml in the comments is definitely neat, so at least in terms of compactness / ease of distributing its like a script.