Slashdot Log In
Introduction to Linden Scripting Language
Posted by
CmdrTaco
on Sun Feb 25, 2007 12:08 PM
from the fad-or-fantastic dept.
from the fad-or-fantastic dept.
prostoalex writes "Dr. Dobb's Journal runs a lengthy introduction to Linden Scripting Language, the language behind avatars and their interaction in Second Life: "LSL is a scripting language that runs server-side, on a piece of software called the simulator. The simulator does just what it's name implies — it simulates the virtual world of Second Life. Each simulator runs everything for 16 acres of virtual land — buildings, physics, and of course, scripts. While you manipulate the script text in a form that is somewhat easy to read, the actual code that runs on the simulator is compiled. A compiler is a piece of software that takes the text version of the script and converts it into something that can actually run. In the case of LSL, the compiler exists within the Second Life viewer itself. In the future, it is likely that the compiler will move from the viewer into the Second Life simulators, but where the code is compiled isn't very important. What matters is that the text is converted into a form that can run on the simulators.""
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.
A Way For Closed Source Scripts? (Score:5, Interesting)
What if someone only made available a compiled copy of something? It'd be scary if you can't tell what's really going on with all the stuff.
Re: (Score:2, Informative)
Re: (Score:3, Interesting)
In fact, he can't even see the object code. (Actually, SL doesn't let you obtain the object code for scripts even if you do have the right to modify them. Combine this with the fact that compilation is currently client-side, and just inspecting the source of a script someone gave you isn't sufficient to ensure it's not malicious - you need to reco
Re: (Score:2, Interesting)
Re: (Score:3, Insightful)
JIT do? (Score:2)
Credit where credit is due (Score:5, Funny)
Re:Credit where credit is due (Score:5, Interesting)
it's funny, i just checked out 2nd life last night -- first time since a year or two ago -- and i was pretty amazed -- the place is one big car lot or sex club. really. i guess there are two kinds of people in 2nd life now -- the people selling "sex", and the people trying to sell their objects to buy the "sex".
it really was a cool online social experiment -- it only ultimately confirmed what we knew all along -- the internet is good only for porn and consumerism.
now, think about this for a second. first, it's not real sex that is drawing people. it's not even imagery of real people having sex. it's interaction of poorly-rendered avatars in a virtual world. this is a testament to the power of the sexual drive in humans, and what we decide to do with our best technology..... just a friendly reminder that yes, we are doomed.
mr c
Parent
Re: (Score:2)
Even Linden Labs now admits (after the taxman commeth ... and the online gambling investigators ...) that Linden$$$ are just play tokens, with no relation to real-world currency.
Re: (Score:2)
https://secure-web7.secondlife.com/currency/sell.
Re:Credit where credit is due (Score:4, Insightful)
It is in the best interest of any online world to convince the government that their money is fake, since that means they won't have to subject their servers and source code to government oversight, which would ultimately make the game much harder to implement. Most games are content to let it rest at that, since they see their money as play tokens themselves.
Linden Labs is one of the first companies to realize that there is a value in allowing the public, if not regulators, to think otherwise. All L$ cashouts are probably, technically, at LL's discretion; to give players a true, real-world legal right to convert money would mean the government would ultimately start taking a hard look at them, since from a real-world standpoint they would start looking like a bank at best, and a potential tax dodge at worst.
It is important to note, though, that Linden Labs' business requires that the illusion be maintained. If they actually did refuse to cash out L$, it would shake user faith in the system. Trading between real-and-virtual money may be ultimately by permission only, but to exercise that authority would be dangerous to their business, and they seem like they're in this some degree of foresight instead of hoping to make a quick buck, so L$ are still, practically, safe to buy and sell. Mostly.
Parent
Re: (Score:2)
I agree with your above post except that I would insert 'not' before 'doomed' in the last line.
If we were incapable of finding channels for commerce and amusement in new environments, then yeah, we'd be doomed.
Having said that, if people really buy sex on 2nd life, that's kind of sad. Not because buying sex is sad but because it suggests it's a less positive environment than, say, FurryMUCK was in the last decade.
Re: (Score:2)
Re: (Score:2, Interesting)
I don't have or do anything porn-related in there, and don't spend any significant amounts of money either. So far I'm getting more out of it than I spend.
Re: (Score:2)
Paul
Re:Credit where credit is due (Score:5, Informative)
All that is easy to find is sex.
There is a lot more out there, it is just hard to find. I've spent a lot of time sailboat racing in SL. I no longer have access to a boat and I really missed it. It it the same? Certainly not. Is it better, than nothing. You bet! When I raced sailboats I was on a big boat with others, now I'm at the helm. I couldn't afford to do that in the real world.
I hate to sound like spam but if you think sex is all that there is to SecondLife, just check out my web site, you might find something to do there that interests you. (Note, the site is supported by AdSense ads, if that offends you, please don't visit, or at least don't click on the ads!)
Paul aka Seeker Gray
Parent
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Makes me wonder where do the mature bits go when you have a tail, as there can be only one object attached to every point, but that's not something I intend to figure out.
What happened to Mono? (Score:4, Interesting)
Re: (Score:2, Informative)
Re:What happened to Mono? (Score:4, Informative)
Parent
As clear as mud (Score:4, Funny)
Glad that's all cleared up!
what a strange summary (Score:2)
Re:what a strange summary (Score:5, Informative)
Parent
Re: (Score:2, Insightful)
Re: (Score:2)
I was hoping to see a langauge that really captured the concepts of virtual worlds and actors. LSL ain't it.
Re: (Score:2)
LUA is a pascal like imperative (procedural) language, while LSL is basically a state machine, aka special purpose programming language.
In an interactive object world, object states and their interaction events are far easier to map to a special purpose programming language, than it is, e.g. to register a LUA function for each event you are interested in.
And bottom line, except old fashioned
Re: (Score:2)
Re: (Score:2)
First thing I did was make a listening bug to spy on people. Hope they've handled that problem since I left...
Re: (Score:2)
And furthermore I doubt that many
In short: LSL is a state machine and event based program language.
Events are what are methods in an OO language. In game objects have various standard states and standard events like "touch" and you can script the behavior for events and state changes.
Actually its a quite nice lang
Re: (Score:2)
Be careful what you wish for in wishing to add features to languages. Java, for example, already has an event model. It's not as succinct as in a language designed explicitly for it, but when you add to much to a language it makes it hard to read and hard to get started in. That didn't stop Perl, bu
Re: (Score:2)
Re:what a strange summary (Score:4, Informative)
The compiler sucks. For example, when you define a vector, it generates three "float literal" instructions rather than one "vector literal" instruction. This means that 2 instructions and 2 bytes more code than necessary are generated for each vector literal in the code (similarly with quaternons/rotations). (Remember, there's a 16Kb per script limit for code+data.) As a second example, there are two types of instruction for transferring data from the stack to local/global variables - store and pop (which is equivalent to a store, followed by a drop). For one, the compiler only ever seems to use the "pop" variant, whilst for the other it always uses a "store; pop" pair (despite this being inefficient) - I've never seen a lone "store".
Also, the goto is broken - due to a compiler bug/design error, only the last jump to a particualr label actually does anything. (The code for matching gotos to labels can only track one goto for each label.) This is a long-standing and well-known bug which I doubt would be difficult to fix, yet no-one's bothered.
There are also other useful instructions which are never used (such as various dups, an instruction for setting the instruction pointer directly - making jump tables/efficient switch statements possible - and an instruction for freeing arbitrary amounts of stack quickly). The compiler never optimises anything, either. It's why I don't hold out much hope for speed improvements from Mono (and indeed, the predicted improvements mostly vanished when they started running actual LSL scripts with it.)
Parent
Re: (Score:2)
The determiner of whether it is a scripting language is not its basis, but what it does, whether it orchestrates the behavior of other objects, things like files and programs, according to what looks like a "script."
I'm not so sure. (Score:2, Insightful)
Well, if it is running on the simulators, the simulated humans might be given access to it, and thus being able to script their own lifes!
Well, maybe I should try if those scripts already work on our world!
the summary: intro to computers (Score:4, Funny)
hello class, this is a COM-PU-TER. computers run a set of instructions called a PROOOGRAAAM. programs are nothing but 1's and 0's. heheheh, but we don't program in 1's and 0's, we program in a language, such as linden script. another computer program, called a com-pi-ler, compiles the script into a format the computer can understand. ok, class, this is a DISK DRIVE . . .
sheesh, i thought this was
(actually, it must be -- even *I* am complaining about the summaries...)
mr c
Not a very good article... (Score:5, Funny)
I do a pretty good bit of LSL... (Score:3, Informative)
Re: (Score:2)
Re: (Score:3, Informative)
Actually, LSL's lists do have efficient random access. The main catches are that they're immutable, which means that every time you want to change anything you have to copy the list (which is, of course, limited by LSL's 16Kb memory limit), and that you can't have lists of lists. (Also, their implementation of lists isn't par
Interregional physics (Score:2)
I've never done 2nd life. What happens if you stand at the border and throw a rock into the next region?
OK, I guess there's probably some handoff mechanism. But I have to say that I find the "physics" of 2nd life disappointing. In the real world, there's an enormous cost in time and energy in moving stuff from place to place. That's an important part of our economy. In 2nd life, they've gone to a lot
Re: (Score:2)
Re: (Score:2, Insightful)
SL has a service based economy. There isn't a shipping industry in SL because it isn't needed. But there are plenty services being offered. If you pay me enough L$ I could script something for you. There are people who will build custom objects, draw graphics, make custom avatars, etc.
RL physical constraints aren't needed in SL to have an economy. Time still is money. Skill still takes effort to develop.
The RL constraints gave us the RL economy, the SL constraints result in a slightly different one. Ther
Re: (Score:2)
Gee, thanks for clearing that up. BTW, do you know who's buried in Grant's Tomb? That's always confused me.
Games have rules, and the choice of rules is what makes the game interesting or boring. By leaving an important economic factor out of an economic game, Second Life has made itself rather less interesting.
Holy crap what happened to DDJ? (Score:2)
Re: (Score:2)
Using print publishing delays for web articles... (Score:2)
In its defense, it did say it was a "primer", targeted at beginners. Chances are, it was lifted from the SL book itself.
LSL has a lot of limitations, some of which can be gotten around. However, the biggest issue is that LL is constantly breaking crap in their futile effort to scale their unscalable grid design to support the
BTW, it is Linden Lab, not Linden Labs (Score:2)
It is Linden Lab not Linden Labs.
Pau aka Seeker Gray
Re: (Score:2)