Running on my M1 MacBook Pro Wren completes in 189 milliseconds whereas XojoScript takes 1600! Var elapsed As Double = (System.Microseconds - start) / 1000000 Var Start As Double = System.Microseconds Public Shared Function Compute(n As Integer) As integer System.print("elapsed: %(System.clock - start)") In some of my testing, Wren even outperforms XojoScript despite being a dynamic interpreted language.įor example, here is a heavy recursion Fibonacci test in both Wren and XojoScript: // Wren. The VM is written in C and Björn has done a great job at bridging it to Xojo. It’s worth pointing out that Wren’s performance is really good. I would even go as far to say as it’s easier to integrate than XojoScript Really easy to integrate into a Xojo app.Easy string manipulation with interpolation, etc.Large standard library (e.g: maths functions).It has native support for dictionaries ( map in Wren).It has a large number of libraries available to it (unlike XojoScript).Here are some reasons you might choose to use Wren as a scripting language for your Xojo app rather than XojoScript: I enquired about it only recently as I was looking for a fast class-based dynamic scripting language for an app I’m working on and Björn was super helpful in bringing this to fruition. More info at I have to give a round of applause to for his skills in bringing Wren to his plugin. Special thanks to Garry Pettet for inspiration, testing and other support. Wren runs in Fibers instead of using JIT like many such engines, which enables it to even run on iOS. Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a familiar, modern syntax. Wren is a small, fast, class-based concurrent scripting language. Wren error output feed can be re-directed to your own class which can write it out in any way you want.Wren console output can be re-directed to your own class which can write it out in any way you want.Its easy to make functions to allow Wren script to manipulate your Xojo objects.Xojo built application can read variables from Wren modules.Handles many kind of return types and parameters, return values and key-ed multiple return values.New classes can be registered from Xojo that Wren scripts will see.Wren scripts can call Xojo functions that you register to be visible to Wren scripts. ![]() Xojo built application can run the Wren module functions.A plugin to make your Xojo applications scriptable by Wren scripts.
0 Comments
Leave a Reply. |