Release: Roto 0.12.0!

We’re happy to announce Roto version 012.0! This is a relatively small release mostly packed with bugfixes and improvements to the robustness of Roto under the hood. In terms of features, the highlights of this release are:

  • more powerful number literals, which can contains underscores and suffixes indicating their type (e.g. 1_000_000u32),
  • support for Unix shebangs,
  • a basic Result type.

As always you can find the release in the following places:

You can find the full list of changes below!

Meta

  • Roto adopted the NLnet Labs LLM policy. (#437)
  • There is now a (small) benchmark suite under the benches directory. More ideas for benchmarks are welcome! (#444, #451)

Language

Breaking changes

Added

  • A shebang at the start of a file is now ignored, allowing Roto files be used as executables. (#427)
#!/usr/bin/roto run

fn main() {
    print("It works!");
}
  • Number literals are now allowed to contain underscores. (#423)
fn main() {
    let x = 1_000_000;
    print(f"{x}"); // prints "1000000"
}
  • Number literals can now have a suffix indicating their type. (#423)
fn main() {
    let x = 1000i32;
    print(f"{x}");
}
  • Added a basic Result type to represent functions that might fail. More features around this type will be added in the future. (#431)

Bug fixes

  • Fixed a compiler error when a zero-sized type is passed to a function. (#426)

  • Fixed variables right-hand side of &&/|| being dropped even when that branch is skipped. (#441)

  • Fixed miscompilation if one of the if-else branches diverge. (#446)

  • Fixed that const variables could not be imported. (450)

  • Fixed a bug that prevented an enum being used in a record. (#455)

  • Fixed not being able to use a method of a constant. (#458)

  • Changed the data structures that are used to represent types at the MIR level. This doesn’t fix any particular known bug, but would have helped with some bugs in the past and therefore makes Roto more reliable in the long run. (#433)

Crate

Breaking changes

  • The cli function now returns an ExitCode. (#446)

Added

  • Result<T, E> now implements Value and can be passed to Roto. (#431)

Documentation

  • Methods are now rendered differently from functions. (#434)