Skip to content

Commit

Permalink
Merge pull request #110 from NLnetLabs/release-0.4.0
Browse files Browse the repository at this point in the history
Release 2025-01-29.

### Breaking changes

- Filter maps no longer have a `define` and an `apply` block. `let` bindings
  should be used instead. For example:

```roto
# Roto 0.3
filter-map foo() {
    define {
        x = 4;
    }
    apply {
        accept x;
    }
}

# Roto 0.4
filter-map foo() {
    let x = 4;
    accept x;
}
```

### New

- Variables can now be created in more places with `let` bindings. `let`
  bindings replace the `define`/`apply` mechanism and are much more general
  because they can be used in any block. For example, inside functions or
  `if`-`else` blocks. The binding is scoped until the end of the block it is
  defined in. It is not allowed to declare multiple variables with the same
  name within a single block.
- The `String` type was added to represent pieces of text. String literals
  are enclosed in double quotes (`"`).
- It is now possible to declare constants in the runtime for a Roto script.
- Similarly, it is now possible to add "context" to Roto scripts. The variables
  in the context behave like constants, but they can differ between different
  calls to a script. In other words, constants are defined when the script is
  _compiled_, context is defined when the script is _run_.

### Bug fixes

- 64-bit numbers (i.e. `i64` and `u64`) were not type checked and compiled
  properly. They are now fixed.
  • Loading branch information
density215 authored Jan 29, 2025
2 parents 2e49666 + 7271b86 commit 50d1982
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ debug = "full"
members = ["macros"]

[workspace.package]
version = "0.3.1-dev"
version = "0.4.0"
edition = "2021"
authors = ["NLnet Labs <[email protected]>"]
license = "BSD-3-Clause"
Expand All @@ -64,7 +64,7 @@ categories = ["network-programming"]
readme = "README.md"

[workspace.dependencies]
roto-macros = { path = "macros", version = "0.3.1-dev" }
roto-macros = { path = "macros", version = "0.4.0" }
proc-macro2 = "1.0.86"
quote = "1.0.37"
syn = { version = "2.0.77", features = ["full"] }

0 comments on commit 50d1982

Please sign in to comment.