Difference between revisions of "LSL3"

From Second Life Wiki
Jump to navigation Jump to search
(→‎PRIM_ROTATION: new flag negates this issue)
 
(13 intermediate revisions by 6 users not shown)
Line 10: Line 10:


== Goal ==
== Goal ==
Address the shortcomings of LSL2 and add new functionality while limiting the increase of language complexity.
* Address the shortcomings of LSL2 and add new functionality while limiting the increase of language complexity.
* Design LSL3 with Hierarchical Linking in mind {{Jira|MISC-2237}}


== Proposed Changes for LSL2 ==
== Proposed Changes for LSL2 ==
Here are some proposed changes to LSL2. Please add new changes, if they cannot be summed up in a single sentence please create a subpage to this article and put a link in the appropriate section.  
Here are some proposed changes to LSL2. Please add new changes, if they cannot be summed up in a single sentence please create a subpage to this article and put a link in the appropriate section.  
=== Major changes ===
* Object model
* Get rid of get and set functions, use getters and setters instead where possible (syntax sugar).
* Persistent storage/memory


=== Syntax ===
=== Syntax ===
* Fix quaternion ordering
* Fix quaternion ordering
* Provide quaternion-scalar multiplication
* Provide quaternion exponentiation q^a where a is a float. (Useful for interpolating rotations to achieve smoothness)
* Object model for base types
* Object model for base types
* Array indexer
* Array indexer
* continue and break keywords.
* switch statement.


=== Types ===
=== Types ===
* User defined class & structures
* User defined class & structures
** Duck Typing (LinFu?)
** Duck Typing (LinFu?)
* bool type?
** Anonymous classes?
* bool type
* pointers
* Remove restriction on lists containing lists
* const


=== Functions ===
=== Functions ===
Line 32: Line 46:
* State variables.
* State variables.
* User defined events that can be triggered by external scripts.
* User defined events that can be triggered by external scripts.
* Functions that are only available to specific states.


=== Libraries ===
=== Libraries ===
* Script libraries that can be sold and passed around.
* Script libraries that can be sold and passed around.
* Natural syntax which can be used instead of link_message
* Natural syntax which can be used instead of link_message
=== Loops ===
* continue and break keywords.


== Flaws with LSL2 ==
== Flaws with LSL2 ==
Here is a list of flaws with LSL2 that should be fixed.
Here is a list of flaws with LSL2 that should be fixed.
=== Evaluation order===
=== Combining Quaternions ===
* See {{JIRA|SVC-1047}} for an example of this. Its only obvious with Quaternions, but it actually causes some other issues.
* See {{JIRA|SVC-1047}} for a full description of this.
 
=== Evaluation order ===
* Given the code <code>f(a) + g(a)</code>, currently <code>g(a)</code> gets executed before <code>f(a)</code>.
** Changing this so <code>f(a)</code> gets executed first should improve performance on Mono.


===Comparisons of lists===  
===Comparisons of lists===  
*Only length is compared.
*Only length is compared.
*The result of a list equality is the difference of the lengths.


==='if else' syntax===
==='if else' syntax===
* if ([1]) evaluates to false.
* <code>if([1])</code> evaluates to false.
* remove the if {} else if limits
* <code>if !(STRING)</code> gives syntax error, forcing <code>if (STRING == "")</code> Applies to all types in which ! cannot be put directly in front.
 
=== [[llInsertString]] ===
* Does not support negative indexes.
 
=== {{LSLGC|Detected|llDetected*}} Functions ===
* Do not support negative indexes.
 
== Resources ==
*{{Jira|SVC-1657}}

Latest revision as of 22:02, 2 December 2012

Purpose

The purpose of the LSL3 project is to design a new programing language that would replace LSL2 in Second Life.

Design Ideals

  • It should be designed to enable expression and not hinder expression with complex or over burdensome syntax requirements.
  • C style syntax and order of operations
  • Type safety
  • Strongly Typed

Goal

  • Address the shortcomings of LSL2 and add new functionality while limiting the increase of language complexity.
  • Design LSL3 with Hierarchical Linking in mind MISC-2237

Proposed Changes for LSL2

Here are some proposed changes to LSL2. Please add new changes, if they cannot be summed up in a single sentence please create a subpage to this article and put a link in the appropriate section.

Major changes

  • Object model
  • Get rid of get and set functions, use getters and setters instead where possible (syntax sugar).
  • Persistent storage/memory

Syntax

  • Fix quaternion ordering
  • Provide quaternion-scalar multiplication
  • Provide quaternion exponentiation q^a where a is a float. (Useful for interpolating rotations to achieve smoothness)
  • Object model for base types
  • Array indexer
  • continue and break keywords.
  • switch statement.

Types

  • User defined class & structures
    • Duck Typing (LinFu?)
    • Anonymous classes?
  • bool type
  • pointers
  • Remove restriction on lists containing lists
  • const

Functions

  • Organized into static classes?
  • Or keep the namespace flat to keep the syntax simple.

States & Events

  • State variables.
  • User defined events that can be triggered by external scripts.
  • Functions that are only available to specific states.

Libraries

  • Script libraries that can be sold and passed around.
  • Natural syntax which can be used instead of link_message

Flaws with LSL2

Here is a list of flaws with LSL2 that should be fixed.

Combining Quaternions

  • See SVC-1047 for a full description of this.

Evaluation order

  • Given the code f(a) + g(a), currently g(a) gets executed before f(a).
    • Changing this so f(a) gets executed first should improve performance on Mono.

Comparisons of lists

  • Only length is compared.
  • The result of a list equality is the difference of the lengths.

'if else' syntax

  • if([1]) evaluates to false.
  • if !(STRING) gives syntax error, forcing if (STRING == "") Applies to all types in which ! cannot be put directly in front.

llInsertString

  • Does not support negative indexes.

llDetected* Functions

  • Do not support negative indexes.

Resources