You might remember that a few months ago I posted a command line interpreter for a scripting language written in Xojo called Roo. It was Python-esque in it’s syntax. Well I’ve been beavering away for the last few months and am pleased to announce version 2 of the language. The second version is a huge improvement not only in robustness but also performance (about 5 times faster!). The syntax has changed and it is now more C-like (with braces and semi-colons) but it has a huge standard library of helper functions.
Roo is open source and is designed to be a replacement for XojoScript in your Xojo apps. It also works perfectly fine as a simple command line scripting language if you like. I got frustrated with the lack of functionality of XojoScript when trying to extend my own Xojo apps so I wrote a replacement for it. Including Roo in your apps is as easy as including the Roo module and a few lines of code.
Very comprehensive documentation is available at https://roolang.org.
Some of its features include:
- A full featured object system (everything is an object, even number and text literals)
- Native support for hashes (i.e. dictionaries), arrays and regular expressions
- Easy ability to add your own custom modules and functions to the language to serve your app
Please let me know what you think about it and feel free to peruse the code - it’s freely available on GitHub.
Actually, is this not in violation of your licensing agreement? Maybe because it’s a scripting thing it’s OK?
Previously Geoff has said this is fine. We had this discussion with version 1. Even more so with this version, its designed to be a replacement for XojoScript which requires Xojo to be of any use.
I have to say, Ive had nothing but negative feedback from multiple people privately on the forums about violating Xojos license terms. It really saddens me. I really dont see how this language has any negative detriment upon Xojo - quote the opposite actually. It showcases how powerful Xojo is that a language can be written in it. There is no conceivable way this language is going to eat into Xojos market.
Honestly, I just dont know why I bother any more.
I think roo is pretty awesome as I enjoy language design.
Garry, it looks like you’ve done a fantastic job with this release. I look forward to properly checking it out.
Thanks guys. Sorry for the mini rant. Just trying to do something positive for the Xojo community.
Garry, I just cloned the GitHub repo and Xojo is complaining about RegisterPlugins.xojo_code missing.
Did you forget to include the class/module in the source, or am I missing something ?
My bad. See here: https://github.com/gkjpettet/roo-desktop/blob/master/README.md
Ill update the official docs as soon as I get the chance.
Essentially you just need to make sure you register the MBS plugins before use. I spun out the registration method into its own module so I didnt have to commit my serial number to the public repo.
Sorry I didn’t RTFM
I was actually wondering if Roo could be ported to Xojo for iOS, but as it has 120+ references to MBS plugin functions, it seems impossible.
There are two issues with porting Roo to iOS. Obviously the first are the MBS dependencies. The language could be re-engineered to use native Xojo Dictionaries (slower than the MBS Hash Maps and not inherently case sensitive) and the slower native Xojo regex engine (no support for capture groups).
Secondly I could re-engineer the Roo Text objects to use Xojo Text types instead of Strings but they are slower. Also, I dont think you can even use regex on iOS without Xojo yet (quite frankly a joke at this point).
If you were willing to sacrifice regex and were careful about the 0-based and 1-based indexes for Strings vs Text you could definitely get Roo running on iOS.
There are declares to use Regex on iOS. But I can sacrifice it, not an issue.
How should I replace VariantToVariantHashMapMBS with xojo.core.dictionary ?
[quote=398263:@Jeremie Leroy]There are declares to use Regex on iOS. But I can sacrifice it, not an issue.
How should I replace VariantToVariantHashMapMBS with xojo.core.dictionary ?[/quote]
The VariantToVariantHashMap is almost a like for like substitute for the regular Xojo Dictionary except you cant iterate through it with For…Each. Just swap over instances of the VariantToVariantHashMap with Dictionary. Be aware that it will change Roo from being case sensitive to case INsensitive.