Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Why use LSL?

Exavor Diesel
Registered User
Join date: 24 Aug 2008
Posts: 12
11-08-2009 17:09
Hey guys,

Awhile back, I was keen to learn LSL. I soon realised the amount of commitment and motivation it would take in order to become proficient with the language. Soon after, I gave up with the idea altogether given that it would only be useful for SL purposes only. Instead, I recently started to learn Python, but moved on to Java shortly after.

My question is; Why does Second Life have to use its own scripting language? Why can't it use an established object oriented language? (Such as C# or Java) Surely it would be possible for LL to create custom functions for SL in other languages, and surely they could limit/restrict what programmers can and cannot do with their code.

If LL did use a common language, it would further generate more interest. Simply because:

- Many people will already know the respective language before they even join SL, and it will also attract many programmers to SL too
- It may encourage more people to learn the language, given that they will be able to use the language outside of SL too (thus making it a more useful commitment)

I am not by any means bashing LSL. I am sure it's fit for purpose. I'm just trying to understand why an alternative wasn't chosen. (when taking into account some of the benefits listed above)

Cheers

Exavor
Quacken Nightfire
Registered User
Join date: 6 Nov 2007
Posts: 33
11-09-2009 00:36
I suppose back then when SL was created, none of the alternatives you mention were viable, so a custom scripting language has been created instead.

Since then, the new Mono-based scripting engine has been implemented. One of the goals of the Mono-scripting project was to allow the use of other scripting languages. As far as I know, the plan is to support C# at some point.

However, this is probably going to be a rather big project and it can easily take years to finish, especially since the current LL management doesn't seem to care too much about improving the content creation tools.
_____________________
Wishlist for new forum migration: http://jira.secondlife.com/browse/WEB-1313
Seven Okelli
last days of pompeii
Join date: 4 Dec 2008
Posts: 2,300
11-09-2009 05:58
Even if they had used an existing language, they would have had to add a library for almost all the things we need LSL to do, to interact with the objects and environment of SL.

And LL would probably want to box the language in to some extent, so that user-written programs wouldn't overwhelm their server and so that we couldn't use the power of the language to hack into aspects of the world they didn't want us to change or invade the privacy of others.
Seven Okelli
last days of pompeii
Join date: 4 Dec 2008
Posts: 2,300
11-09-2009 06:01
From: Quacken Nightfire
I suppose back then when SL was created, none of the alternatives you mention were viable...


Lua was released in 1993. Java in 1995. JavaScript around the same time. Lisp and Scheme have been available as embeddable languages forever.

I don't think Java would have ever been a good choice, though. It has to come up with the whole virtual machine even if it just wants to add two integers.
.
Quacken Nightfire
Registered User
Join date: 6 Nov 2007
Posts: 33
11-09-2009 06:32
From: Seven Okelli
Lua was released in 1993. Java in 1995. JavaScript around the same time. Lisp and Scheme have been available as embeddable languages forever.

Embeddable != suitable for massive multithreading and (de)serialization (i.e. key requirements of SL). It took many, many years before Lua got microthreads, for example.


From: Seven Okelli

I don't think Java would have ever been a good choice, though. It has to come up with the whole virtual machine even if it just wants to add two integers.
.

So does Mono.
_____________________
Wishlist for new forum migration: http://jira.secondlife.com/browse/WEB-1313
Seven Okelli
last days of pompeii
Join date: 4 Dec 2008
Posts: 2,300
11-09-2009 07:13
Good points. I hadn't thought about that.
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
11-09-2009 10:54
The important things that LSL does are invisible, for example, a scripted object can move from sim to sim, and it can retain its state while it is in your inventory. Also, it is very small.

They could have "used" some other language, but they would have had to trim away so much that it would no longer have been that language any more. In many ways, it is easier to learn a different language than it is to learn a language that is too similiar to one you know well. (The diffs have a way of biting you on the ass.)

Lastly, there is the historical factor. The story is that they needed a scripting language, so one weekend they created one. no way they could have somehow hacked java or anything else into SL in a weekend. Starting from scratch seemed like the best way to go at the time. Recall that the guys who decided this are known to be reeeeeeallly smart.

Lastly, you can always design your won language, and then write a translator to convert it to LSL. That's how C++ and lots of other languages started out.
_____________________
So many monkeys, so little Shakespeare.
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
11-16-2009 19:41
LSL is nothing more than a C-like language with similar syntax. You'll find many programming languages are very similar, and if you learn the core ideas such as "if statements", "boolean logic", "for loops", "variables reading/setting" then you already know the majority of every programming language out there. [I know, I used to teach 3 levels of scripting classes in Second Life that covered all of these as well as SL-specific stuff]

What sets LSL apart is the numerous "LL" functions that are available, and are similar to libraries of functions you get with other languages. A lot of these functions are specific to the SL world and how scripts interact with it, and would need to be re-created anyways if you were to use another language.

Don't get "hung up" thinking that LSL is "another" language you have to learn from scratch. Once you learn one language, it's pretty easy to move from one to another. In fact, you could probably learn "LSL" and then very easily pickup C/C++ programming, Java, C#, and other programming languages easily!