Re:Roto: A Compiled Scripting Language for Rust
by erlend_sh on Wednesday May 21, 2025 @10:44AM
(#44052030)
Are you saying Roto has no ambitions to be suitable as a gamedev scripting language?
Re:Roto: A Compiled Scripting Language for Rust
by terts on Wednesday May 21, 2025 @11:01AM
(#44052224)
It depends. I'd love to make a prototype using Bevy with Roto. What I'm trying to say is that if you only want something to make Rust compile faster, then Rust might the better option. If you want something that behaves more like a scripting language and you don't mind that is compiled at startup, then Roto might be good for that purpose (with the caveat that there are missing features of course).
Re:Roto: A Compiled Scripting Language for Rust
by airstrike on Wednesday May 21, 2025 @11:09AM
(#44052315)
Having not yet actually tried it, I assume I could compile at startup on a separate thread with no issues? This seems like a dream scripting language--or "application language" as someone else called it.
Re:Roto: A Compiled Scripting Language for Rust
by terts on Wednesday May 21, 2025 @11:24AM
(#44052483)
Yes, you definitely could! And thanks for the kind words! If you try it out for your own purposes, you'll probably run into some missing features (e.g. lists and loops), but we'd be happy to hear what you think!
Re:Roto: A Compiled Scripting Language for Rust
by airstrike on Wednesday May 21, 2025 @11:50AM
(#44052778)
Thank you for putting this out there! I'll make sure to let you know what I think when I try it out—but I have some wood to chop on other parts of my app before I get into scripting.
Re: lists and loops, is that not supported because it hasn't been a priority or because it requires some fundamental redesign? Which is to say, if I wanted to add those down the road, is this something I could try my hand at implementing on my own and possibly contributing back?
Re:Roto: A Compiled Scripting Language for Rust
by terts on Wednesday May 21, 2025 @12:11PM
(#44053014)
They're on the roadmap for sure. While loops are quite easy to add I think, but it would also need an assignment operator to make it useful. Lists are complicated because they're generic over the element type. That's why I've waited so long to add them.
First, this language is syntactically a lot like Rust but semantically quite different. It has no references for example. We're trying to keep it simpler than Rust for our users.
Second, using Rust would require compiling the script with a Rust compiler, which you'd then have to install alongside the application. Roto can be fully compiled by the host application.
I think your approach might be preferred when the application author is also the script author. For example, if you're a game developer who is using a script to quickly prototype a game.