Live data from Hacker News

Roto: A Compiled Scripting Language for Rust

blog.nlnetlabs.nl

101–110 of 116 posts

Re: Roto: A Compiled Scripting Language for Rust

#101
post #88

Could you write 80-100% of an application in this language? I'm wondering if it could be a good application language for Rust programmers who want to use the Rust ecosystem and have the option of writing parts of their application in Rust for extra performance, but who also want to experiment and iterate quickly, and who want a simpler, higher-level language for expressing business logic.

That’s my dream. Seamless FFI to Rust with all of the core in a dynamic scripting language. If/when you need to tighten up performance/types, can port more of the code to actual Rust.

That's my dream, but statically typed. Let programmers gloss over all the memory management stuff that makes writing Rust painstaking and complex (put everything on the heap by default if necessary.) Trade off runtime performance for faster iteration and simpler code. Still enjoy static typing, the Rust ecosystem, and the option to write parts of your code in Rust for maximum performance.

Re: Roto: A Compiled Scripting Language for Rust

#102
post #8

Earlier quoted context omitted.

Border Gateway Protocol But I don’t even think people in networking would say that, it is canonically BGP. This is kind of like complaining about the abbreviation HTML, sure yes it is Hypertext Markup Language but everyone knows it as HTML to the point that there are probably people that don’t know it’s an abbreviation.

Agreed. There are almost certainly more people who know what "BGP" is than know what "Border Gateway Protocol" is. But it still would have been a favor to the original commenter to write "BGP (Border Gateway Protocol)". If you write just "BGP" you annoy the reader who doesn't know what it is; they'll think it's your fault. But if you write "BGP (Border Gateway Protocol)", they still won't know what it is but they won…

Funnily enough, I had no idea what "BGP" meant until I saw "Border Gateway Protocol" and then remembered "oh yeah the router thing".

I did a networking course in school, and haven't touched it since.

Re: Roto: A Compiled Scripting Language for Rust

#103
post #48

Earlier quoted context omitted.

Alternatively, whenever designing a scripting/plugin host make sure to support plugin-hosting-plugins. That way you could have the Roto plugin host complied to wasm.

Sounds interesting but at the same time a bit complex. I assume you wouldn't ship the whole plugin runtime for each plugin that wants to host another plugin?!

It's not that complex. You basically want to have all plugins support describing themselves (as a list of plugins, which is nearly always 1 item), and "activating" themselves according to one of their descriptors. Bonus points for deactivation for updates (this is often extremely hard to pull off because of how instrusive plugins can be). You could then have a utility header file or whatnot that does the [very minor] plumbing to make the plugin API behave like a single plugin.

Shipping the runtime is another good option, because it means you don't have to worry about runtime versioning.

Re: Roto: A Compiled Scripting Language for Rust

#104
post #23

> Roto fills this niche for us. In short, it's a statically typed, JIT compiled, hot-reloadable, embedded scripting language. To get good performance, Roto scripts are compiled to machine code at runtime with the cranelift compiler backend. Statically typed, hot reloadable scripting? Sign me up.

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…

This might be revealing my ignorance, but if we're going for statically typed "scripting languages", why not implement an ML like SML?

Re: Roto: A Compiled Scripting Language for Rust

#105
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?

- The best package manager in the world, bar none. Compiling, linking, and platform difficulties disappear. The devops/devexp is next-level sublime.

- "low defect" software without much work. I'm not talking about memory management, but rather Option and Result. For the same amount of effort as writing Golang or Java or C#, you can get defect free code.

- Easy deployable to WASM without packaging a memory management runtime for the most intrusive types. Super portable, super fast.

- If you've used Unreal a lot, you've hit build issues, linker issues, segfault issues. A lot. That'll go away.

Re: Roto: A Compiled Scripting Language for Rust

#106
post #95

Earlier quoted context omitted.

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.

If you look back you will see that networking contexts was assumed. I was trying to make the point that BGP can have multiple meanings. Between all the other replies and me not being a great writer that context was lost. However if you just the parent of my reply and then my post in isolation I think it still makes sense why I wouldn't have mentioned that context.

It’s on a site called NL Net Labs and it’s mentioned in this way:

> The need for Roto comes from Rotonda, our BGP engine written in Rust. Mature BGP applications usually feature some way to filter incoming route announcements.

I think networking and routing specifically is fair to assume.

Re: Roto: A Compiled Scripting Language for Rust

#107
post #43

Earlier quoted context omitted.

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

- The best package manager in the world, bar none. Compiling, linking, and platform difficulties disappear. The devops/devexp is next-level sublime. - "low defect" software without much work. I'm not talking about memory management, but rather Option and Result . For the same amount of effort as writing Golang or Java or C#, you can get defect free code. - Easy deployable to WASM without packaging a memory management…

It’s also a pleasant language to work in. I love that everything is an expression, I love match statements, I love that structs and enums are full powered, etc.

Re: Roto: A Compiled Scripting Language for Rust

#108
post #43

Earlier quoted context omitted.

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

- The best package manager in the world, bar none. Compiling, linking, and platform difficulties disappear. The devops/devexp is next-level sublime. - "low defect" software without much work. I'm not talking about memory management, but rather Option and Result . For the same amount of effort as writing Golang or Java or C#, you can get defect free code. - Easy deployable to WASM without packaging a memory management…

> The best package manager in the world, bar none. Compiling, linking, and platform difficulties disappear. The devops/devexp is next-level sublime.

I don’t know how are universes split but I’m in the wrong one for sure!

300Gb compile caches, 5 minute compilation, nix flakes with layer and careful adjustments for different arch and deployments, cargo slowing builds by 5 minutes every time because it insist on downloading full repo every time (and occasionally failing). API libraries maintained by some completely anonymous guy or lad from eastern country.

On top of it the bugs don’t get away. If your problem IS memory safety, then sure - chomp away. But I’ve seen u64 truncated to u32 because someone decided to thread it through JSON serialization and macro soup.

Every bear looks like a puppy when it’s a cub.

Re: Roto: A Compiled Scripting Language for Rust

#110
post #94

> Roto has no facilities to create loops. The reason for this is that scripts need to run only for a short time and should not slow down the application. [1] Wait, what?! Isn't that choice a bit extreme? There have been plenty of times in scripting where I've needed loops! Am I missing something here? [1] https://rotonda.docs.nlnetlabs.nl/en/stable/roto/00_introduc...

Hi! That bit of the docs is a bit outdated. We're probably gonna make it optional. The reason for that choice was that the filters for Rotonda need to be very quick and don't really require loops as long as you can do `contains` checks on some lists for example. So it should probably say "Roto _in Rotonda_ does not have loops". Roto the language as a separate project can then have loops.

bosque and fluence aqua also do not have loops (one can loop there, but not in normal sence)
Post reply on HN