Scripting language to pair with Rust?

I am looking for a light weight scripting language to use together with Rust.

  1. Security is not a concern. This is a single user application. If the user wants to execute rm -rf / from the scripting language, Rust does not need to stop them.

  2. By "light weight" I need something that can compile under wasm32.

  3. Accessikng rust types / calling rust functions should hopefully be easy / not too messy.

That's about it. The current front runner is Lua. Any other suggestions? (I'm a big fan of Clojure, but the JVM is not 'lightweight' by any definition.)

I don't know if these match your criteria, but here's a list:
http://arewegameyet.com/categories/scripting.html

4 Likes

I think I might go with Rust + neon + lumo . (lumo = cljs compiled as a node module)

You could also try compiling your rust code to WASM by using wasm-pack rather than neon, which can be done on stable now.

Is it possible at the moment, to compile crates with a C dependency to wasm?

The Lua developers make an effort to be as portable as possible, so you could probably run it through a C-to-wasm compiler and find it works with minimal tweaking.

That said, I doubt most normal libraries with native dependencies will work for wasm. Or if they do, it'll need non-trivial build scripts and require C/C++ to have a solid WASM story.

1 Like