NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Roto: A Compiled Scripting Language for Rust (blog.nlnetlabs.nl)
airstrike 19 hours ago [-]
> 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.

speed_spread 19 hours ago [-]
Then also have a look at Mun:

https://github.com/mun-lang/mun

- Ahead of time compilation

- Statically typed

- First class hot-reloading

Not sure how both languages compare though

terts 18 hours ago [-]
Hi! Author here. Mun is super cool, but works slightly differently as far as I know. You compile Mun scripts outside of your application to a dynamic library, which can then be (re)loaded by your application. The advantage of that approach is that you can ship the compiled script with your application.

The downside is that it's not really possible to share types between the host application and the script as far as I know. They have something called called `StructRef` which does this a bit, but it's all runtime checks if I understand correctly.

If somebody here knows more about Mun, I'd be happy to be corrected. This is just my understanding from their documentation.

echelon 19 hours ago [-]
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 prototype in the scripting language, write mature application logic in the scripting language, and for the parts that matter, move them to Rust.

I hope Roto can be that. There are lots of other Rust scripting languages that fall short.

A good scripting language will have great Rust interop, similar syntax, and allow simple calling and passing of data structures. It shouldn't weaken Rust in any way.

falcor84 18 hours ago [-]
> game development

I've been out of the loop for a while, but last I checked, the running gag was that there are more game engines written in rust than games. Have things changed? Any high profile games that were made in rust?

lunyaskye 17 hours ago [-]
The biggest one I know of is Tiny Glade: https://store.steampowered.com/app/2198150/Tiny_Glade/

It's mostly a custom stack, but it's written in Rust and uses some parts of Bevy from what I understand.

kurayashi 17 hours ago [-]
Afaik there still no high profile games in rust. But many if the complaints I’ve read of devs switching back from rust were about how hard it was to prototype something in rust. Having a scripting language with solid rust interop could help.
dkarl 18 hours ago [-]
We keep saying "scripting language," but given that it's statically typed and JIT compiled, we could also call it an "application language." Relative to Rust, most backend applications can afford to trade off a little bit of performance for better development speed and readability.
airstrike 18 hours ago [-]
VBA but good
sn9 15 hours ago [-]
This might be revealing my ignorance, but if we're going for statically typed "scripting languages", why not implement an ML like SML?
cess11 18 hours ago [-]
What does Rust have that other languages with these properties don't?
mikepurvis 18 hours ago [-]
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...

cess11 16 hours ago [-]
So no clear examples?
mikepurvis 16 hours ago [-]
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.

cess11 3 hours ago [-]
So, how is Rust better than these? What does it have that these lack?
airstrike 1 hours ago [-]
Package management, expressiveness, community, open source code availability... a helpful compiler and goated type system.... overall sanity
18 hours ago [-]
echelon 15 hours ago [-]
- 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<T> and Result<T,E>. 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.

xlii 14 hours ago [-]
> 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.

cess11 2 hours ago [-]
Java 8 was released in 2014, since then Optional is in the standard library and a rather common pattern. Like Rust you can use LLVM to compile Java to WASM (JWebAssembly), and there's also TeaVM for turning a project into an optimised WASM application and CheerpJ for running a JVM in WASM.

It was rather messy to use cargo on handheld ARM, it didn't spark joy so I kind of stopped trying after a while. Mostly I use Rust as a dependency I don't need to touch, but when I've programmed in it I didn't feel like cargo was that big of a thing. Maybe I would feel another way if the frame of reference was only like webpack or Pip or something.

CooCooCaCha 14 hours ago [-]
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.
mdaniel 6 hours ago [-]
> It’s also a pleasant language to work in

I know, practically self-documenting code!

https://github.com/tokio-rs/tokio/blob/tokio-1.45.0/examples...

I'm not trying to pick on tokio, it was just a public link demonstrating that the syntax can get to be a bit much

ijustlovemath 19 hours ago [-]
In case the author comes in, I'm curious about how you designed the registration mechanism. We have a Python application that makes heavy use of decorators to give strong runtime introspection capabilities, and I've always wondered if the same could be done at or near compile time in an equivalent Rust context. I think learning about the drawbacks and boons of the designs you settled on would be really informative!
terts 18 hours ago [-]
Hi! So for Roto, our introspection needs are actually fairly limited. We only need the `TypeId`, the type name, the size and the alignment. which Rust can give us without any additional traits. It's not possible currently to - for example - access struct fields and enum variants. That is something that I plan to add, but that might require a crate like `bevy_reflect` or `facet`.

Rust is giving me just enough information to pull the current version of. More powerful introspection/reflection is not possible without derive macros. If you're ok with derive macros though, you could look into the 2 crates I mentioned.

Hope that answers your question!

ijustlovemath 18 hours ago [-]
Did you go through many iterations on the API of the registration? If so, which designs did you disqualify and why?
terts 18 hours ago [-]
Not many iterations, but a lot of head scratching was involved haha.

I decided against using a trait and a derive macro because I wanted to avoid running into Rust's orphan rule. We have a crate called routecore where most of our types are declared and then a separate crate called Rotonda which uses those types and uses Roto. I wanted Rotonda to be able to register routecore types.

That's also the downside of the current reflection crates; they require each type to have a derive macro.

dkarl 17 hours ago [-]
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.
terts 16 hours ago [-]
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<u32>` but not `Vec<T>`) 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.

0cf8612b2e1e 16 hours ago [-]
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.
dkarl 16 hours ago [-]
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.
ori_b 18 hours ago [-]
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 Rust's safety, it's not even that bad to re-open and re-load the binary when it changes; the big footgun with dlopen is use-after-free.

terts 18 hours ago [-]
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.

erlend_sh 18 hours ago [-]
Are you saying Roto has no ambitions to be suitable as a gamedev scripting language?
terts 18 hours ago [-]
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).
airstrike 18 hours ago [-]
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.
terts 17 hours ago [-]
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!
airstrike 17 hours ago [-]
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?

terts 16 hours ago [-]
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.
abendstolz 18 hours ago [-]
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?

ori_b 18 hours ago [-]
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.
abendstolz 19 hours ago [-]
Very cool!

But I prefer the wasmtime webassembly component model approach these days.

Built a plugin system with that, which has one major upside in my book:

No stringly function invocation.

Instead of run_function("my-function-with-typo") I have a instantiated_plugin.my_function call, where I can be sure that if the plugin has been instantiated, it does have that function.

bobajeff 18 hours ago [-]
This sounds like a good approach to overcoming rusts slow compile times and lack of dynamic linking. One thing I'm concerned about with this path is what about hot reloading and fast script running? Doesn't everything in the wasm component model need to be compiled first? I imagine that would remove some of the advantages to using a scripting language like JavaScript or Python.
abendstolz 18 hours ago [-]
You're right. Hot reloading isn't done by default.

I manually compile a plugin and in my system I can "refresh" a plugin and even say "activate version 1.1 of the plugin" or "activate version 1.2" of the plugin etc.

But that's something I had to build myself and is not built into wasmtime itself.

zamalek 18 hours ago [-]
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.
abendstolz 18 hours ago [-]
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?!

zamalek 16 hours ago [-]
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.

90s_dev 18 hours ago [-]
How is that not also stringly typed?
abendstolz 18 hours ago [-]

                match Plugin::instantiate_async(&mut store, &component, &linker).await {
                    Ok(plugin) => {
                        match plugin
                            .plugin_guest_oncallback()
                            .call_ontimedcallback(&mut store, &callback_name)
                            .await
                        {
                            Ok(()) => debug!("Successfully called oncallback for {plugin_path:?}"),
                            Err(e) => warn!("Failed to call oncallback for {plugin_path:?}: {e}"),
                        }
                    }
                    Err(e) => {
                        error!("Failed to call oncallback for {plugin_path:?}!: {e}");
                    }
                }
See the "call_ontimedcallback"? It's not a string. The compiler ensures it exists on the Plugin type generated from the .wit file.

If of course I put a wasm file in the plugin folder that doesn't adhere to that definition, that wasm file isn't considered a plugin.

phickey 17 hours ago [-]
Thanks for using wasmtime! I worked on the component bindings generator you’re using and it’s really nice to see it out in the wild.

To elaborate a bit further: wasmtime ships a [bindings generator proc macro](https://docs.wasmtime.dev/api/wasmtime/component/macro.bindg...) that takes a wit and emits all the code wasmtime requires to load a component and use it through those wit interfaces. It doesn’t just check the loaded component for the string names present: it also type checks that all of the types in the component match those given by the wit. So, when you call the export functions above, you can be quite sure all of the bindings for their arguments, and any functions and types they import, all match up to Rust types. And your component can be implemented in any language!

bschwindHN 7 hours ago [-]
Thanks so much for your work on this! So far it's been a good pattern for adding hot-reloadable logic to my Rust projects.

Next up I'm hoping to integrate this stuff into a game so you can have hot-reloadable game logic, with the potential for loading and sandboxing user-created mods.

90s_dev 17 hours ago [-]
Would wasmtime be a good general purpose scripting extension layer for a C program in the style of embedded Lua but faster and more generic? Is that a reasonable use-case?
phickey 17 hours ago [-]
Wasmtimes C bindings for components are still a work in progress. In general C programming is always going to require more work than Rust programming, due to the limitations of C abstractions, but at the moment it’s also held back by how much energy has gone into the C bindings, which is much less than the Rust bindings which many of the maintainers, myself included, created and are using in production at their day jobs.

More info: https://github.com/bytecodealliance/wasmtime/issues/8036 Several folks have volunteered work on the C bindings over the last year or two, with this contributor making progress most recently: https://github.com/bytecodealliance/wasmtime/pulls?q=is%3Apr...

90s_dev 18 hours ago [-]
Ah, fair enough. So it is still stringly typed, it's just verified at compile time. Which I guess is true about all compiled functions ever.
breadchris 16 hours ago [-]
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/

90s_dev 20 hours ago [-]
> 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?

Philpax 19 hours ago [-]
People who become proficient in Rust generally enjoy the syntax, so they want to carry it across. (As someone proficient in Rust who has pondered their ideal scripting language, I would have done the same.)

To your more general question: it depends. AngelScript [0] looks very much like C++, while others, like Lua, don't. It's really up to the designer's discretion.

[0]: https://www.angelcode.com/angelscript/, but https://angelscript.hazelight.se/ has better examples of what it actually looks like in use

axegon_ 19 hours ago [-]
> who has pondered their ideal scripting language

Et tu, brute? :D

epage 18 hours ago [-]
> 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.

nicoburns 19 hours ago [-]
I think it's just that a lot of people like Rust syntax, and there is a lot of demand for a Rust-like scripting language (Rust syntax is also very close to JavaScript/TypeScript syntax which many, many people are familiar with)
andsoitis 20 hours ago [-]
> 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?

No. Think about Lua or Tcl (both implemented in C) or others like Embeddable Common Lisp.

90s_dev 19 hours ago [-]
True, but those were designed in the 80s or 90s. I guess I'm thinking of embedded scripting languages designed since ~2015.
pansa2 20 hours ago [-]
IIRC Lua deliberately doesn’t resemble C - so if you’re going back-and-forth, editing both the host application code and a script, you can immediately tell which one you’re looking at.

Makes sense to me - which means scripting languages for curly-brace languages should probably use either Lua-style begin-end or Python-style significant indentation.

ordu 19 hours ago [-]
It is one of my issues with lua. I'm starting to forget semicolons in C/C++/Rust and write : instead of ::.

I think, that I'd better deal with a language recognition, I could configure emacs to use different highlighting for different languages. Or I could change background color for buffers based on a language.

90s_dev 19 hours ago [-]
I don't think that's the reason behind Lua's syntax. I think it was designed specifically to be extraordinarily unambiguous, clean, and simple, which it is.
lynndotpy 19 hours ago [-]
Woah, this looks awesome.

One of my favorite things about writing Rust is that it's expression-oriented (i.e. almost everything is an expression), something you almost never see in non-functional languages.

I was wondering if Roto is also expression-oriented?

terts 18 hours ago [-]
Hi! Author here. It is indeed expression-oriented, mostly following the same rules as Rust. If-else is an expression, for example.
12 hours ago [-]
90s_dev 20 hours ago [-]
> Note that nothing in the script is run automatically when the script is loaded, as happens in many other scripting language. The host application decides which functions and filtermaps it extracts from the script and when to run them.

So it's closer to something like C or C++, where it just defined stuff and you can choose what to use? I guess that's fine when there's no initialization for the script to do. Maybe in your domain that's never the case. But many languages end up adding static initialization as a first-class feature eventually.

stirfish 20 hours ago [-]
Roto means "broken" in Spanish.
diggan 19 hours ago [-]
Just add a "Huevos" prefix and a "S" at the end of the name, and suddenly you're thinking of delicious food instead.
darccio 18 hours ago [-]
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.

diggan 18 hours ago [-]
Ah, well, it's a dish, common name for it is "Huevos estrellados" in most places I think though. https://www.google.com/search?q=huevos+rotos&tbs=imgo:1&udm=...

Scrambled eggs would be "huevos revueltos"

Edit: in Spain at least. YMMV for other Spanish-speaking countries.

juanramos 18 hours ago [-]
Either that or an unfortunate accident
hannofcart 17 hours ago [-]
> 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...

terts 16 hours ago [-]
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.

dlahoda 10 hours ago [-]
bosque and fluence aqua also do not have loops (one can loop there, but not in normal sence)
lewisjoe 19 hours ago [-]
ELI5: Why not use typescript and an embedded v8 engine or deno to run them? What kind of advantages will I miss if I go for typescript as an embedded language for my application?

Also by using v8, I open up new possiblities via wasm (write in any lang and run it here?)

Will be helpful if somebody enlighten me.

duped 19 hours ago [-]
Be warned that V8 is a behemoth and adds 100+MB to your binary size, is quite slow to link, and is not practical to compile from source for most projects. If you want a lighter weight JS runtime there's quickjs, if you want WASM there's wasmtime.

Personally I don't think it's a good choice for what it seems Roto is used for (mission critical code that never crashes) since TS doesn't have a sound typesystem and it's still very easy to fuck up without additional tooling around it.

giancarlostoro 18 hours ago [-]
There's also Duktape for just JS minus the WASM (at least I don't think they've implemented WASM yet).

https://duktape.org/

ijustlovemath 18 hours ago [-]
I think QuickJS wins over Duktape for ES5 compliance, though it's been a few years since I was evaluating embedded JS. They're both extremely easy to integrate into an application, in contrast to V8
giancarlostoro 18 hours ago [-]
Fair, I'm not quite as familiar, but always like to bring up alternatives in case they're helpful. My favorite HN comments lead me to new alternatives for programming.
skybrian 18 hours ago [-]
Roto is a very limited scripting language with no loops. You might compare it with the eBPF language used to load filters into the Linux kernel.
giancarlostoro 18 hours ago [-]
You are comparing a general purpose scripting language (TypeScript) to a DSL (Domain Specific Language) essentially. They built theirs with a specific purpose.
airstrike 19 hours ago [-]
Why would I want to bundle an entire JS runtime? And why do you think you need that for WASM?

And personally I will go out of my way to not use TS/JS if I can

ijustlovemath 19 hours ago [-]
sounds like it's not fast enough for their use case. plus, have you ever tried to integrate v8 into a project? Deno is fine for building binaries, but to date doesn't really have good support out of the box for bundling a script into a library, which this application seems like it would need.
ost-ing 18 hours ago [-]
Any chance of no_std support for embedded systems?
terts 18 hours ago [-]
Hi! Author here. Would be super cool, but while the compiled scripts would work without allocations, the compiler itself does a lot of allocations. So unfortunately I don't think I could make that work.
samuell 20 hours ago [-]
Sidenote, but I wish it became the practice to explain abbreviations such as BGP, to make the post intelligible to people outside the field.
jpc0 20 hours ago [-]
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.

federiconafria 19 hours ago [-]
Adding to this, both for BGP or HTML if you don't already know what they mean, the "full form" does not really help.
bryanlarsen 19 hours ago [-]
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't be irritated at you anymore.

jpc0 19 hours ago [-]
Someone linked a document a few weeks ago that address the topic of abbreviations and when the abbreviation is the common form it is acceptable to just use the abbreviation.

I don’t think anyone in their right mind would open every article with HTML(Hypertext Markup Language) and CSS( Cascading Style Sheets).

For networking it would be the same with BGP/OSPF/RIP.

bryanlarsen 18 hours ago [-]
But it is it a networking post? It's a networking blog in general, but this post is clearly targeted at people interested in a rust scripting language and should expect wider distribution.
jakkos 16 hours ago [-]
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.

chrisweekly 17 hours ago [-]
This reminds me of a trivia night event last weekend; in a room of 12 6-person teams I was the only one who knew exactly what the acronym URL stands for. But I'm confident a majority would have been able to come up with a reasonable working definition.
k__ 19 hours ago [-]
Fair.

I'm currently writing an article about Flowspec and had to comb a few RFCs to understand what's going on.

I opened the Roto announcement and felt very smart, lol

bluGill 19 hours ago [-]
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 that focuses on geographical data and planning.
    BGP (Big Green Potato): In agriculture or gardening, it could refer to a specific type of potato or a gardening initiative.
    BGP (Bilateral Grant Program): In finance or international relations, it may refer to programs that provide grants between two countries.
Elsewhere someone posted a link to the wikipedia disambiguation page. It is very insightful to compare the two lists - you should do this.
NitpickLawyer 18 hours ago [-]
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 capabilities of configuration languages. With Rotonda, we want to allow our users to write more complex filters with ease. So we decided to give them the power of a full scripting language."

bluGill 16 hours ago [-]
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.
diggan 19 hours ago [-]
Is that the response from google/gemma-3-1b-it or something? Almost funny how off it is.
bluGill 18 hours ago [-]
Whatever DuckDuckGo uses. First answer was board gateway protocol then I asked what is outside the context of networking.
ElectronCharge 18 hours ago [-]
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, or outages caused by misconfigurations, as BGP is critical for directing traffic across the global internet. For example, a Hacker News article might cover BGP-related incidents like route leaks or hijacks, which can disrupt connectivity or enable cyberattacks.

If the context suggests something else (e.g., a specific acronym in a niche domain), could you provide more details about the article? I can also search for the specific post if you have a link or title."

Pretty good, eh?

bluGill 18 hours ago [-]
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)

ElectronCharge 18 hours ago [-]
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.
bluGill 16 hours ago [-]
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.
cestith 15 hours ago [-]
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.

gaugefield 20 hours ago [-]
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)
diggan 19 hours ago [-]
> 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.

bluGill 16 hours ago [-]
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)
diggan 16 hours ago [-]
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.
codydkdc 19 hours ago [-]
this is a general convention in technical documentation as well
ape4 19 hours ago [-]
terts 18 hours ago [-]
Hi! Author here. Yep, sorry about that. It is indeed Border Gateway Protocol.
belter 19 hours ago [-]
Its a short blog about routing rules in a networking domain by NLNet Labs. The explanation of the BGP abbreviation is uncalled for, just because Rust tourists were attracted to click on it, the moment they saw the word...
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 08:40:47 GMT+0000 (Coordinated Universal Time) with Vercel.