Live data from Hacker News

Roto: A Compiled Scripting Language for Rust

blog.nlnetlabs.nl

61–70 of 116 posts

Re: Roto: A Compiled Scripting Language for Rust

#61
post #42

This language looks a lot like Rust. Why not dlopen() a Rust shared library instead? The implementation would be about as complicated, but it would be a well known language that's fully integrated with a large library ecosystem, well defined build and package set, rather than some custom one-off thing with no ecosystem. Going your own way means your users have to re-invent the wheel for themselves every time. With Ru…

Hi! Author here. There's a couple of reasons.

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.

Re: Roto: A Compiled Scripting Language for Rust

#63
post #42

This language looks a lot like Rust. Why not dlopen() a Rust shared library instead? The implementation would be about as complicated, but it would be a well known language that's fully integrated with a large library ecosystem, well defined build and package set, rather than some custom one-off thing with no ecosystem. Going your own way means your users have to re-invent the wheel for themselves every time. With Ru…

Don't rust shared libraries have the problem of no stable rust ABI? So you either use the C ABI or you use some crate to create a stable rust ABI, because otherwise a shared lib compiled with rust compiler 1.x.y on system a isn't guaranteed to work with the binary compiled on the same system with another compiler... or on another system with the same compiler version. Right?

You'd have a plugin layer that hooks in the right places with a stable ABI on one end, and a native feeling interface on the other.

Re: Roto: A Compiled Scripting Language for Rust

#64
post #43
post #23

Earlier quoted context omitted.

I have dreamed of this for Rust. It is literally _the_ killer app to have a fast scripting language that pairs with Rust well. With fast development cycles and a safe scripting language, Rust will find itself in every single programming niche. Server development, game development, desktop application development. If the WASM DOM bridge gets better, maybe even web development. Everything will open up. You can prototyp…

What does Rust have that other languages with these properties don't?

On the game engine side, probably not a lot until there's more ecosystem built up, but across the board you could look at the niches filled by the Java/Groovy and C/Lua pairings to get a pretty good sense of what's possible— it would be the tools stuff that would most excite me: build/CI/automation frameworks, that kind of thing.

Alternatively, look at a project like ruff— hundreds of linter rules statically implemented in native Rust [1], maybe that would make more sense if the rules could be more tersely expressed as runtime-loadable roto scripts that have access to the Python AST and a toolkit of Rust-supplied functions for manipulating and inspecting it?

[1]: https://github.com/astral-sh/ruff/tree/main/crates/ruff_lint...

Re: Roto: A Compiled Scripting Language for Rust

#65
post #2

> Finally, we want a language that is easy to pick up; it should feel like a statically typed version of scripting languages you're used to. It looks like Rust. All Rust scripting languages do. Is this true for all other languages? Is this just a property of embeddable scripting languages, they will always resemble the language they're implemented in and meant to be embedded in?

> It looks like Rust. All Rust scripting languages do.

Not koto (https://koto.dev/) which is one of the reasons I appreciate it. I want an embeddable language targeted at my users, rather than myself which I feel Rust-like ones do. I also want an embeddable language not tied to my implementation language so if I change one, I don't have to change both. Koto only supports Rust atm but I don't see why it couldn't be supported elsewhere.

Re: Roto: A Compiled Scripting Language for Rust

#66
post #56

Earlier quoted context omitted.

That was a pretty bad response, so I tried Grok 3, using the prompt "What's the likely meaning of BGP in a Hacker News article?" Its entire response: "In a Hacker News article, BGP most likely refers to Border Gateway Protocol, a key internet protocol used for routing data between different networks (autonomous systems) on the internet. It’s often discussed in contexts like network security, internet infrastructure,…

I specifically ask the LLM about non-networking contexts because I was interested in what else BGP could mean. I believe that every possible combination of 3 letters has at least 5 different meanings - most of them only used in some tiny niche (often just one department of a company)

I see. The problem is you left out that only non-networking contexts were considered, so that list missed the most relevant answer with no explanation.

Re: Roto: A Compiled Scripting Language for Rust

#68
post #25
post #3

Roto means "broken" in Spanish.

Just add a "Huevos" prefix and a "S" at the end of the name, and suddenly you're thinking of delicious food instead.

For those who don't speak Spanish, "huevos rotos" are broken eggs (or scrambled eggs).

Edit: I had to double check, because it seems that both translations are valid.

Re: Roto: A Compiled Scripting Language for Rust

#70
post #61
post #42

This language looks a lot like Rust. Why not dlopen() a Rust shared library instead? The implementation would be about as complicated, but it would be a well known language that's fully integrated with a large library ecosystem, well defined build and package set, rather than some custom one-off thing with no ecosystem. Going your own way means your users have to re-invent the wheel for themselves every time. With Ru…

Hi! Author here. There's a couple of reasons. 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…

Are you saying Roto has no ambitions to be suitable as a gamedev scripting language?
Post reply on HN