← Back to context

Comment by airstrike

3 months 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.

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.

  • > 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?

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

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

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

      4 replies →

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

      5 replies →

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

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