Live data from Hacker News

Roto: A Compiled Scripting Language for Rust

blog.nlnetlabs.nl

91–100 of 116 posts

Re: Roto: A Compiled Scripting Language for Rust

#91
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.

Re: Roto: A Compiled Scripting Language for Rust

#92
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.

Hi! Author here. You could try but there are some fundamental limitations.

The biggest limitation is that we don't have access to the full type system of Rust. I don't think we can ever support registering generic types (e.g. you can register `Vec` but not `Vec`) and you don't have access to traits. So it would work if you can reduce your API to concrete types.

Otherwise - apart from some missing features - you could probably write big chunks in Roto if you wanted to. You could also prototype things in Roto and then translate to Rust with some simplified types.

Also you'd have to accept that it gets compiled at runtime.

Re: Roto: A Compiled Scripting Language for Rust

#93
post #20

Earlier quoted context omitted.

A LLM response so don't trust it, but Biological and Genetic Programming: In biology, BGP can refer to methods or algorithms used in genetic programming or bioinformatics. BGP (Bureau of Governmental Personnel): In some governmental contexts, BGP may refer to a specific bureau or office related to personnel management. BGP (Bureau of Geographical Planning): In urban planning or geography, it might refer to a bureau t…

This is what people mean when they say "prompting an LLM is like the old google-fu; some people have it, some don't". Try this prompt instead: "Please explain the meaning of BGP in the following snippet: 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. The complexity of these filters often exceed the capabili…

When I searched for what does BGP mean, and DDG's LLM said "border gateway protocol". Even though I gave zero context and there are other possible meanings. The correct answer is probably something like "BGP can have multiple meanings depending on the context. The most common use of BGP is in networking where it means Border Gateway Protocol. If you provide more information on the context a better answer can be given." Or possibly it could link to the Wikipedia page.

Re: Roto: A Compiled Scripting Language for Rust

#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.

Re: Roto: A Compiled Scripting Language for Rust

#95
post #56

Earlier quoted context omitted.

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.

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.

Re: Roto: A Compiled Scripting Language for Rust

#96
post #43

Earlier quoted context omitted.

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 implemen…

So no clear examples?

Re: Roto: A Compiled Scripting Language for Rust

#97
post #10

Earlier quoted context omitted.

There is a convention in academic papers where you write the explanation for the 1st occurrence of the abbreviation, then leave it out for the rest of the paper. I suggest others to follow the same, except maybe for the most obvious ones (like HTML mentioned in the other reply)

> HTML Did you mean Hypertext Markup Language (HTML)? It's a trite comment to make (the original complaint). Don't know an abbreviation? Takes two seconds to look it up. Not all content on the web is written for the lowest common denominator, and thank god for that.

Content should be written for the lowest common denominator of your target audience. If you are writing for someone who writes web documents all day then you can expect them to know what html is in great detail. If you write for plumbers they might not know what html is, and so you may need a couple paragraphs to define what it is. (I'm not sure why plumbers would need to know what a html tag is, but if you expect them to read a document where html tags are referred to you better define html in enough detail that they understand it)

Re: Roto: A Compiled Scripting Language for Rust

#98
post #96

Earlier quoted context omitted.

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 implemen…

So no clear examples?

In the Java/Groovy space, Jenkins and Gradle are the obvious ones.

I'm less familiar with the Lua world (not a gamedev), but this is an example of the kind of thing I'm imagining— a build system / task runner that's half lua and half C/C++: https://github.com/xmake-io

Having a modern on-prem replacement for Jenkins/Rundeck built in rust and exposing a roto interface rather than yaml definitions sounds like it would be great.

Re: Roto: A Compiled Scripting Language for Rust

#99
post #97
post #10

Earlier quoted context omitted.

> HTML Did you mean Hypertext Markup Language (HTML)? It's a trite comment to make (the original complaint). Don't know an abbreviation? Takes two seconds to look it up. Not all content on the web is written for the lowest common denominator, and thank god for that.

Content should be written for the lowest common denominator of your target audience. If you are writing for someone who writes web documents all day then you can expect them to know what html is in great detail. If you write for plumbers they might not know what html is, and so you may need a couple paragraphs to define what it is. (I'm not sure why plumbers would need to know what a html tag is, but if you expect th…

Agree, hence a non-profit specialising in networking and internet infrastructure shouldn't have to explain BGP, as the audience for their blog most likely is familiar with it already.

Re: Roto: A Compiled Scripting Language for Rust

#100
I like yaegi [1] for go because it is an interpreter for the go language (almost fully supported, generics need some love). The most important part for me is being able to keep all my language tooling when switching between interpreted/compiled code. Also, there is little needed distinction between what is going to be interpreted and compiled. Once you start including libraries it gets dicey and the need for including the libraries in the compiled part is necessary. There is also a blog post that comes along with it describing how it was built! [2]

[1] https://github.com/traefik/yaegi [2] https://marc.vertes.org/yaegi-internals/

Post reply on HN