• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
MAINTENANCE ANNOUNCEMENT - JIRA will undergo maintenance starting 1:00am PDT through 3:00am on Saturday 2010.03.20. Please do not enter issues during this time as the system maybe restarted.
Issue Details (XML | Word | Printable)

Key: SVC-1657
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: Saijanai Kuhn
Votes: 28
Watchers: 13
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

Mono release: Freeze [mostly or totally] LSL2 development where it is now and start adding new features and syntax in a mono-VM-only, LSL3 language, compatible with C# syntax

Created: 22/Feb/08 05:46 PM   Updated: 19/Jul/09 08:25 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment: ALL
Issue Links:
Relates


 Description  « Hide
Right now, backwards compatibility with LSL2 is of the highest priority, but wouldn't it be nice if we could get new features for LSL that didn't have to be available using the old LSL2 virtual machine?

In other words, even before mono is fully deployed on the main grid, we could start talking about what new features we would like to see, AND, we could assume that they would only be available on the mono virtual machine (CLR) and not worry about making them available on the LSL2 virtual machine. THis would mean that such scripts simply couldn't run in a non-mono sim, but oh well, since the goal is to make ALL sims mono-enabled asap.

To make it compatible with future Linden Plans, make it use a sub-set of C# syntax that is equivalent to the current LSL2 syntax as much as possible, and simply unlock new C# features and syntax as they are found to be safe. This allows new scripting features BEFORE a Mono script sandbox and Mono byte-code verifier are completely ready, and will get people used to doing things using C# instead of LSL2

Strife set up a discussion page here: https://wiki.secondlife.com/wiki/Talk:LSL3

New features might include, in no particular order of importance:

  • case/switch statements;
  • LSL3 versions of existing ll* functions without the kludgey bugs that require kludgey workarounds (llSetPrimitiveParams without the rotation bug for example):
  • better string functions, including regex;

*list handling functions where pass by reference is considered a GOOD thing, instead of a bug;

*genuine constants;

*new data types like multi-dimensional arrays/hashes/ dictionaries, and the functions and operators to go along with them;

*error handling;

*OOP features like those that are found/proposed for OpenSim Scripting Language (OSSL)

  • a "Creative Commons" library of user-defined functions taken from those found on the wiki, which can be called using cc* names, that don't eat into the 64KB per script memory limit, which aren't part of the "core" ll* functions, but are so commonly used that everyone wants them;
  • a 64 KB reserved for a link-set level script whose functions/methods/data is accessible to all scripts in all prims. This might replace the current link-message system which is quite slow in mono, currently.
  • a memory space reserved for user-state data that is accessible by all scripts in all prims in a link-set. Perhaps a user-defined struct/record would be used to access/store data in this common memory. This would replace proposals for a special descriptor field of some kind.

*etc



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Feynt Mistral added a comment - 22/Feb/08 09:22 PM
Question:
Why bother when Mono will eventually support proper languages which support all of these things and more? I'd rather use Python, which does all of these and is easier to read and write, than LSL which from the beginning was a flawed language (honestly, a day to plan and a day to implement? >.> )

Strife Onizuka added a comment - 23/Feb/08 03:44 AM
I have no problem with planning LSL3 but changes to LSL have to wait until after Mono ships. The Mono team is steadfast against making changes to LSL until it ships.

You are too generous Feynt, it was an afternoon to plan, an evening to drink, then back to work to implement. Maybe that was a bit too cruel. >.>


Saijanai Kuhn added a comment - 23/Feb/08 08:50 AM
Actually, I put up this jira in response to Periapse Linden's remarks at Friday's mono beta meeting. He indicated the mono team wanted to start a discussion of where to go next. Note that I added the part about the OSSL OOP. I talked to Tedd Maa last night about where OSSL was heading and the things they are planning sound very cool.

davie zinner added a comment - 23/Feb/08 09:21 AM
Every hour of work invested in the Mono VM brings us closer to being able to use a multitude of other source languages – very good languages.

Every hour of work spent on improving LSL brings us closer to a better LSL.

Unless there are resources to pursue both directions, I think we'd leverage our resources better and get a better return on the former.


Damian McLeod added a comment - 23/Feb/08 09:29 AM
Given what I have seen on both subjects? No reason to freeze LSL development... Everything I have read has stated that LL plans to continue maintaining and expanding on LSL, even while switching to Mono to open the door to adding new language posibilities... The last official word I read stated that even if other languages were brought in such as Python, Ruby, C#, or even Lua, that LSL would remain a useable language, the only change in that department would be a backend change, in how the LSL code was compiled, so that it would be able to be ran on the Mono VM... So why cut ourselves short by freezing further development? Especially when I haven't heard any info on how the change over is going to be handled to move from the existing VM to a Mono only system... Some have stated that they were going to do a re-compile on all scripts, but as mentioned else where, that would cause a very large number of scripts to loose stored data, others have said they were going to run the two VMs in tandem for a given period of time to help give people a chance to migrate data over, etc... So, personally, I would say calling for a freeze now would be kind of premature until more details are locked down and made public...

Saijanai Kuhn added a comment - 23/Feb/08 10:53 AM - edited
davie Zinner, there are always tradeoffs. Is it significantly faster to add new syntax and functions to LSL (LSL3) over adding support for new languages? LSL2 support exists NOW. C# support requires lots of consideration of what features might be dangerous. There is work on a mono sandbox that Babbage recently mentioned but how soon will that be ready for deployment in SL? WOuld it be faster to wait for that, or to add case/switch handling, etc., to the LSL syntax?

Damian McLeod, my understanding is that the current plan is to keep the LSL2 virtual machine around forever (more or less) because many scripts will simply not work right, for various reasons, if recompiled to mono. So... the question becomes: how soon do we want to move to a mono-only NEW programming environment?

I vote for sooner, rather than later. Freeze LSL2 (except for a few features that might make sense if implemented over the next few months) and start working on extending/repairing the language with LSL3, which only works with the mono-enabled sims. It MAY be that the eventual goal is to make LSL3 into C# but it might be easier on scripters to do it one step at a time...


Gordon Wendt added a comment - 23/Feb/08 05:11 PM
I don't know if it's already been changed on the mono beta but if it hasn't even before languages such as c# are implemented (that already have this capability in theory) the limit on recursive if, when, etc... statements should be removed since at least in theory mono should be able to handle them better than lsl2. There are a million different things to add too such as switch statements which have already been mentioned and hopefully we won't have to wait for C to use them.

Kamilion Schnook added a comment - 23/Feb/08 10:22 PM
One thing I'd definitely like to see is a mono performance counter separate from the LSL performance counter.
I intend to convert every script I possibly can to mono once my simulator switches. If I have any data-store scripts, I'll leave them as LSL if I deem the contents useful enough. Long ago I switched to database backed http calls for storing stuff like visitor lists and product update IM notifiers.

But, the NUMBER ONE REQUIREMENT for LSL3 should be a Type/Key/Value permanent data storage system.
We need to have a way to store a small amount of permanent data without resorting to a hack like a child-prim's description.

Primarily, we need Strings, Integers, and booleans.

Booleans are very important here, because they use up so little space.

1K should be enough for just about any name/value combination

I would propose list[value,value] llGet{Linked}Flash(list[key, key]), integer[used] llSet{Linked}Flash(stride-list[key, value,key, value] ), list[value,value] llGetPublicFlash(key object, list[key key]), and integer[free] llGetFreeFlash(key[special]). NULL_KEY gets local prim's free space, linkmate's key will return that prim's free space. Non-linkmates always return 0 for now ... Stored key names ending in _public are accessible via llGetPublicFlash. Passing a list containing only NULL_KEY will return a list of keys_public. I am aware of the internationalization issues, but considering the LSL function names are in english and I don't see that changing anytime soon, I doubt '_public' would be too much of a problem.
As llGetPublicFlash relys on the key, it should operate sim-wide just the same as llGetObjectDetails. A new constant should be added to changed, CHANGED_FLASH.

Simple, unobtrusive, and very very useful for everything from prefs storage to exchanging data between multiple prims in an object or even multiple objects. The perfect posterchild for LSL3? (http_server would be nice too!


Strife Onizuka added a comment - 24/Feb/08 06:16 AM - edited
I created a page for LSL3 a couple weeks ago on the wiki.
https://wiki.secondlife.com/wiki/LSL3

Saijanai Kuhn added a comment - 24/Feb/08 07:42 AM
Kamilion, I would prefer any use of a special cache space to use a better syntax than the llList* functions.

Stryfe, I'll put a reference to your page on my mono bugs table page, and spam its existence in the usual places I irritate. Also, added a couple of comments in the discussion page.


Strife Onizuka added a comment - 29/Mar/08 09:03 PM
When you start adding new keywords and changing existing functionality it can't be fully backwards compatible.

Saijanai Kuhn added a comment - 26/Apr/08 04:44 PM
Note change: Suggested LSL3 would be in C# syntax as per my suggestion on SLDEV

Argent Stonecutter added a comment - 27/Apr/08 12:39 PM
Going through the points in this proposal in turn:

1. case/switch statements could be implemented in LSL with the existing LSL bytecode, there's no reason that part has to be implemented in Mono. I could do that myself in the LSL compiler.

2. LSL2 and CIL use the same runtime routines, changes to things like llSetPrimitiveParams are not really a language issue and should be addressed in their own JIRA proposals.

3. Better string functions (llRegCmp, etc) are also runtime library rather than language issues.

4. The list handling functions in LSL are also in the runtime. Adding references to the language would be a significant change, almost as much work as designing a new language from scratch (I've designed a few over the past 30 years).

5. Genuine constants are a good idea, and should be implemented independently of the MONO effort: they could be added to indra.y withoutany impact on the code generator.

6. New data types: I've proposed a couple of these that would work in the framework of the LSL language. The best and most general one would be a hash... to avoid refernce problems this would need to be restricted to global scope. I am almost sure that this could be implemented in the existing LSL2 bytecode.

7. Objects are probably not a good idea for the scope of this problem, and it woudl probably be best to use an existing language to completely replace LSL: the syntax of "C" is not really well-adapted to object-oriented code. Something like Smalltalk or F-Script would be better, and allow a tighter implementation.

  • Extensions to allow CIL-level communication between objects in a linkset are opening up a can of worms that shoudl probably be best left closed. Better would be to create a prim-level or link-set-level hash that can be used for general storage for both LSL2 and CIL code. I've got an active proposal for that: SVC-1406

So while these are all useful ideas, I really don't think that these should be described as "MONO-related" extensions. Most of them are either things that are outside the scope of CIL-vs-LSL2, could be implemented in the existing indra.y, or are sufficiently complex that they're not really good candidates for an interim solution.


Strife Onizuka added a comment - 28/Apr/08 05:34 AM
Implementing constants could be tricky, while you could inline the values this is a bad solution for string, vector and rotation constants. They could be stored as global but then you would have extra overhead. A better solution would be to add a new section and LSO bytecodes to the VM. If you made the bytecode just a get a value at a constant address you could introduce some interesting possibilities for optimization. You wouldn't necessarily need a section for the constants, if you used pointers based on pure script offset you could put them anywhere, including in the bytecode section. By not having a section you wouldn't need to add a new pointer to script header and you could add the functionality without having to increment the script version.

CONST, integer pointer
CONSTS, integer pointer
CONSTL, integer pointer
CONSTV, integer pointer
CONSTQ, integer pointer


Saijanai Kuhn added a comment - 30/Apr/08 01:51 PM
What is your response to the idea of just redoing LSL' s functionality in C# and calling it LSL3, then carefully unlocking features of C# to "add" new features to LSL3? Seems to me that that this could probably be done before a sandbox/bye-code verifier could be completed, and give script-writers a feel for any changes that will be due to moving to something like C#.

As far as adding features in LSL2 goes, I don't see a reason to, except concerning specific functions like adding "glow" to llSetPrimitiveParams and the like.

I'm with Babbage (as I understand it) that I'd rather see everyone migrate to new languages. I just think the migration has to be slow. Adding a "Slang"-like solution to C# (gogle "Slang" and "Squeak Smalltalk") allows people to transition to a better language while allowing Babbage and company to add new features slowly and safely even before the safety checks are fully in place.


Argent Stonecutter added a comment - 30/Apr/08 07:07 PM
I don't think it's meaningful to talk about "redoing LSL's functionality in C#". LSL is not a subset of C or C#, it is a unique and distinct language from either. There's no savings from writing a compiler for some kind of subset of C# that happens to overlap LSL, because you WOULD have to write a new compiler for a C# subset, and then switching from that compiler to C#. It would be more work to do that than to simply write directly in C# can call the LSL2 runtime. Creating a new C#-subset-that's-like-LSL is more work for less benefit than extending LSL ... which as already noted generates both LSL2 and CIL code from the same parser.

Many of the proposals listed here are improvements to the common LSL2/CIL runtime. Regular expression functions are runtime features, not language features. Additional parameters are runtime features. Additional communication mechanisms between scripts are runtime features.


Saijanai Kuhn added a comment - 04/May/08 02:53 PM
Well, I've never created a compiler (or even a subset of one) in my life, so I was just making some bad assumptions about what would be easier, I guess.

Strife Onizuka added a comment - 18/Jul/09 06:26 PM
Regular expressions could be a language feature if a new type was created for them (it would allow for them to be compiled, making the scripts faster). Javascript has regex literals.

Argent Stonecutter added a comment - 19/Jul/09 08:25 AM
Javascript and Perl have regex literals, but you don't need regex literals to have compiled regular expressions... the compiler can just as easily notice that a string literal is used in a regular expression context.