The Roo Language Mega Thread

As per a suggestion by @Kem Tekinay, I’ve decided to create a single thread that I will use to make announcements about Roo.

What is Roo?
Roo is a free, open source, object-orientated interpreted scripting language written in Xojo. Whilst it can be used from the command line to run scripts or as a REPL it is primarily designed to be a replacement for Xojoscript. It’s super easy to integrate it into your apps and is far more powerful than Xojoscript. It has native support for dictionaries (Hash objects in Roo) and networking and provides a plethora of convenience methods for working with text, dates, etc.

Supported platforms
Roo works on all desktop platforms (macOS, Windows, Linux x86 and ARM) and in console apps. It will not work on iOS for many reasons, mostly because Roo relies on a number of the Monkeybread plugins (which don’t work on iOS) but also internally it uses a lot of the classic framework which is also not supported on iOS.

Latest version
The latest version is 2.4.1. Download it from GitHub.

Latest version release notes

  • Request objects now have a default HTTP method of GET
  • Added the Roo.NetworkingEnabled property which (if False) will disable Roo’s ability to access the network and raise a Roo.RuntimeError exception. It defaults to True
  • Added the DateTime.long_month getter
  • Added the DateTime.day_name getter
  • Added the DateTime.meridiem getter
  • Added the DateTime.short_month getter
  • Added the DateTime.time getter
  • Added the DateTime.to_http_header getter
  • Added the DateTime.two_digit_hour getter
  • Added the DateTime.two_digit_minute getter
  • Added the DateTime.two_digit_second getter
  • Added the Text.to_date getter
  • It’s now possible to store arbitrary data on an interpreter instance with the Roo.Interpreter.Custom dictionary property

Learning Roo
Extensive documentation is provided at https://roolang.org.
There is even a Dash docset for Roo.
I’ve also written a GUI app for prototyping Roo scripts which features syntax colouring. It’s open source and can be found on GitHub. It’s worth checking out the commit messages in this repo because I actually develop new Roo code in this repo and then copy the Roo module into the main repo when a new version is done. The IDE works great on a Mac. Your mileage may vary on other platforms.

I’ve just released version 2.5.0.

This is a big release that makes Roo much more pleasant to work with. Semicolons are now optional as are parentheses around if and while conditions. Hurrah! Below is a list of the main changes/fixes:

  • Semicolons are no longer required! You are free to continue to use them to separate multiple statements on the same line but your code will look prettier without them.
  • Parentheses are now optional around the conditions of if constructs and while loops. You can obviously use them to make your code easier to read if you wish.
  • Added a new exit keyword to allow breaking out of if constructs early
  • The scanner has been partially rewritten to be faster and more efficient
  • The parser now handles more edge cases and panics less when things go wrong
  • It’s now possible to define the text representation used by the standard library print() function for your own classes. Just created a class method called to_text and return the text representation for your object
  • Added the Hash.value(key) method which returns the value of the specified key

Productive day today!

Just pushed another smaller release: 2.5.1 to GitHub.

This release greatly improves the resilience of the parser so it no longer gets stuck in infinite loops of doom if your syntax is invalid. It also improves the functionality added in 2.5.0 whereby it’s possible to define a text representation of your custom classes.

Lot’s have happened since I last updated this thread including a complete rewrite, upgrading to version 3 and showcasing the language at XDC in Miami. This just a small update to say that I have changed the home page for Roo. You can now find it on my personal website: garrypettet.com/roo. As always, the source code is available from its GitHub repo.

I do wish Xojo would let us edit older posts as I don’t have a way to change the links in the first post. Oh well.

Garry, this is so incredibly cool of you to do! I saw your youtube last night
Thank you!!
kr,
-sean

Thanks @Sean Arney. I’m glad you like it. If you are interested in the code and need help deciphering it then just PM me.