Are there any comparisons to other Rust scripting languages like Rhai and Rune?
One year of Roto, a compiled scripting language for Rust
21–30 of 33 posts
Re: One year of Roto, a compiled scripting language for Rust
#22The syntax is of course attractive (coming from Rust), and I'd love to replace more of my posix scripts with something saner. I struggle understanding whether the utility of having language literals for IP addresses, IP prefixes, and AS numbers is worth it though [0]. It seems like the confusion added by having custom built-ins like this for one particular domain, in addition to the unclear scoping (what could later…
Hi! Author here. We are actually planning on removing those literals and allowing applications to extend Roto with their own literals [0]. They should do so with care of course, because indeed adding more literals adds some edge cases. Most applications should be able to get by without any special literals though. [0]: https://codeberg.org/NLnetLabs/roto/pulls/358
Something like EDN readers seem saner to me where I wrap the value in something that denotes the function to use to parse the value. If I do “192.168.1.0/24” I get a string literal, if I do #cidr{192.168.1.0/24} then it hands the value off to the cidr custom literal.
That’s my 2 cents, I hate when things implicitly modify my literals.
Re: One year of Roto, a compiled scripting language for Rust
#23Places where we would benefit the most from this is in the Games and UI space. I know game devs have already started by integrating lua, like with mlua [1]. In the UI space i think Makepad is the best example of a team making a dedicated DSL that can be hot-reloaded [2].
I think we need more of this! Go make a DSL next time you feel crushed by the weight of compiling Rust crates!
---
[0] and by my research i mean Claude. this is a great blog with many posts about improving compile times https://nnethercote.github.io/
[1] https://crates.io/crates/mlua . I don't have a reference for a project using it though so please reply if you know of one!
Re: One year of Roto, a compiled scripting language for Rust
#24Earlier quoted context omitted.
Hi! Author here. We are actually planning on removing those literals and allowing applications to extend Roto with their own literals [0]. They should do so with care of course, because indeed adding more literals adds some edge cases. Most applications should be able to get by without any special literals though. [0]: https://codeberg.org/NLnetLabs/roto/pulls/358
Have you considered collecting all the literals into domains, but ship them by default? I could, for example, imagine using roto in some of my current work on svg and visuals generation. In which case I'd be greatly helped with literals like "colors", "vec2", "angle" etc. I'd imagine that as long as other literals which I don't need, like an IP address, aren't in the way, it's still greatly beneficial to have a large…
Re: One year of Roto, a compiled scripting language for Rust
#25The syntax is of course attractive (coming from Rust), and I'd love to replace more of my posix scripts with something saner. I struggle understanding whether the utility of having language literals for IP addresses, IP prefixes, and AS numbers is worth it though [0]. It seems like the confusion added by having custom built-ins like this for one particular domain, in addition to the unclear scoping (what could later…
https://github.com/py2many/static-python-skill/blob/main/ass...
Re: One year of Roto, a compiled scripting language for Rust
#26Re: One year of Roto, a compiled scripting language for Rust
#27Maybe the authors are here to answer this. The syntax is of course very Rusty, which is cool. However, a sort of obvious question comes to mind - what is the benefit of this over just writing rust, then? Just because the compile times are shorter? EDIT: should mention I understand why embedded scripting languages exist, having embedded Lua many times. And I love a lot of these features, but to me having an embedded s…
The fact that Roto gets compiled at the runtime of the Rust application is very important. That means we can ship a binary and still allow scripting.
We also believe that Rust is too complicated for our use case in some respects, we're trying to make something simpler. Our target audience for Rotonda is not people who necessarily know Rust. We can never be as simple as Lua because of the static typing, but we're trying our best.
And finally, we don't have to ship the entire Rust toolchain with our application. Roto is fully embedded into the binary with no external libraries needed and that's quite nice in practice.
Re: One year of Roto, a compiled scripting language for Rust
#28Earlier quoted context omitted.
Hi! Author here. We are actually planning on removing those literals and allowing applications to extend Roto with their own literals [0]. They should do so with care of course, because indeed adding more literals adds some edge cases. Most applications should be able to get by without any special literals though. [0]: https://codeberg.org/NLnetLabs/roto/pulls/358
That makes a lot of sense to me. The implementation feels odd to me, though. If I’m reading it right, I type in literals normally and then all these hooks decide whether they want to change what I’ve typed in? It feels like I have to remember the custom literals I have installed to make sure I don’t accidentally conform to some spec and end up with a custom literal instead of the string I wanted. Something like EDN r…
The `#cidr{...}` syntax would work but then it wouldn't be much more convenient than just constructing the value with normal functions, I think.
Re: One year of Roto, a compiled scripting language for Rust
#29Same with 'List' vs 'Vec'.
And why are List, String & co uppercase?
From what I gather these are built-in types the compiler knows?
'i32', not 'I32' but 'List' not 'list'? In Rust the case is clear cut: built-ins that the compiler 'knows' are lowercase, types expressed in Rust itself are PascalCase.
Roto seems to mix this?
Reads like Rust but then "differs subtley" where it (seemingly?) does not matter at all.
What is the rationale? I'm not complaining, Roto looks great. I'm considering swapping my Koto integration in my project out for this. :)
I'm just genuinely curious. From the outside the above smell like "just because" decisions.
Re: One year of Roto, a compiled scripting language for Rust
#30I just think that's a nice way to use the word "scripting" instead of calling these scripts "programs" or calling things that are programs "scripts".