Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Terts Diepraam
Terts Diepraam
@terts@mastodon.online  ·  activity timestamp 4 weeks ago

The next version of @nlnetlabs 's scripting language Roto (to be released sometime in December) will include a much-requested feature: lists! Below is a small example of lists in action, showcasing how easy it is to pass them to and from a Roto script. It will print `Result: [0, 1, 2, 3, 4, 5]`.

I'd like to take a moment to explain why lists were so hard to include in Roto in a thread!

1/6

#rust #rustlang #roto

Sorry, no caption provided by author
Sorry, no caption provided by author
Sorry, no caption provided by author
  • Copy link
  • Flag this post
  • Block
Terts Diepraam
Terts Diepraam
@terts@mastodon.online replied  ·  activity timestamp 4 weeks ago

Most scripting languages are dynamically typed. That means that they usually have some `Value` enum with variants such as `Number`, `String` and `Bool`. Adding a list is then as easy as adding a new variant `List` that contains a `Vec<Value>`. Then you add some syntax and you're done!
(oversimplifying massively of course!)

2/6

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-alpha.40 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct