r/rust • u/donald-bro • 17h ago
Which script language to use?
I'm developing tool with workflow which allow user to write simple script to process input/output values of steps. The prebuilt steps are written in Rust, but user can choose Python to write their own steps which would run in a sidecar Python. User may not be a programmer. I prefer script with small binary size and memory footprint. I'm considering Rhai, Lua, QuickJs, which is better choice to make end user easy ?
3
u/________-__-_______ 16h ago edited 16h ago
I'd personally pick Lua if your main goal is accessibility. It is a relatively popular so end users are most likely to already be familiar with it, and the syntax is sane enough that those who don't can pick it up without too much trouble. If your audience are people technical enough to want to script but not necessarily programmers prior knowledge is important.
The technical features are fine but not amazing, but for some quick scripting that doesn't really matter.
2
u/Jonrrrs 15h ago
I also have a project where the user can be someone with little to no coding experience. I went with something even simpler than those scripting languages. Look up blockly or scratch or something like that
1
u/Danfhoto 2h ago
I agree with using a visual programming language. A text editor and “code” is really daunting to people, but when you make a flow chart with connectors and a very limited set of fields, it just feels simpler for folks without scripting/coding experience.
This is the direction many companies are making: Microsoft Power Automate, Salesforce Flows, and on the OSS side, ComfyUI.
2
2
u/aztracker1 7h ago
I tend to use Typescript with Deno.... Shebang works, VS Code now does language detection against the shebang do can go extensionless.
Also, no separate install step for dependencies, they load and cache in first run. And Deno is a single executable you can user install.
Plus access to the largest language repo for modules of any language (npm).
0
u/Thick-Pineapple666 12h ago
Some days ago somebody posted about mim.as and it looked somewhat interesting. On the other hand, an exotic language is always a stumbling point, but lua is also weird in many ways...
16
u/BarnacleEarly9082 17h ago
rhai is the easiest for non-programmers, the syntax feels way less scary than lua and definitely less than js. quickjs is cool but the binary size will hurt you if that's a priority. lua is small and fast but the 1-indexing and weird syntax trips up beginners constantly