Tuesday, February 5, 2008

Mono highlight: Size limit for scripts up'ed to 64K

Bjorlyn Loon just attended a Mentors-Only Linden Lab preview of Mono, the scripting alternative that is currently in beta, presented by Mia Linden and Periapse Linden. The most significant information that she picked up is this little nugget:

Periapse Linden: With Mono, we up'ed the size limit for scripts to be 64K, so... many LSL scripts that were in pieces in separate objects can now be vastly simplified and put in one object.

Other points made by Periapse include (these are direct quotes):

"Mono is an enhancement to the simulator, specifically that part of the simulator which runs scripts. Currently all your LSL scripts are run by a virtual machine, embedded in the simulator, known as LSL2.

Mono is an alternative virtual machine. It is open sourced, very fast, and very stable. About three years ago Babbage Linden had the idea of using Mono to run scripts in SL. Lots of obstacles had to be overcome. Plus, he had to write a compiler which would take the LSL language we all know and turn it into Mono bytecode.

Basically we're testing scripts side by side in Mono and LSL2. Since it's the same source code, they should behave exactly the same -- at least that's what we're trying to achieve. With Mono, though, comes some extra speed. On some LSL scripts it's only a percentage difference. But on math intensive scripts Mono is hundreds of times faster than LSL2.

I need to point out that we are talking only about a different virtual machine. This is the same LSL language you've been using all along. No new calls. So you can compare the script compiled to LSL2, with a version compiled to Mono side by side in the same place.

We know that there are many other bugs out there, we just couldn't find them, so we figured the best way was to hold an open beta program, and let residents test their own scripts to see if there are differences between LSL2 and Mono.

Mono beta started last week, and so far it's been a great success. In fact a resident found a crasher within minutes of the beta being open. I hadn't even had time to download the viewer! For a full write up on Mono please see the Mono wiki article. If you're curious about the bugs that have been discovered you can look at the JIRA meta issue for Mono: SVC-1276."

**Mono wiki can be read here.
**If you want to submit bugs, please link your issue to the SVC-1276 so that we can see it.
**Beta is running with one host, four regions.

Periapse continued, "We do have some fun long range plans that leverage Mono's ability as a general purpose VM. For example, we could create an interface that allows scripting SL using C#, or some other language, in addition to LSL. But that's for another day...

We are not changing LSL in any way. Our intention at this point is for parity. You can go to one of the beta regions on aditi and take one of your scripts and create a copy. Then you can compile the copy to Mono. By rezzing both the mono and LSL2 version you can actually see them run and compare performance and behavior. It's a simple UI -- basically just a checkbox on the script editor which says "Compile to Mono"

Some scripts need to do various forms of script to script messaging that shouldn't be necessary. They do so because the program is too big for the 16K limit so it gets broken up into pieces that then have to communicate. With Mono we up'ed the size limit for scripts to be 64K, so many LSL scripts that were in pieces in separate objects can now be vastly simplified and put in one object."

It is expected that a full transcript of the meeting will be posted on the Second Life blog. Thanks Bjorlyn!