LSL... what's it like, program language wise?
|
|
Lordfly Digeridoo
Prim Orchestrator
Join date: 21 Jul 2003
Posts: 3,628
|
11-28-2004 19:34
After dabbling here and there with LSL, I think I finally overcame my issues with logical thinking.
I've always wanted to learn computer programming as a hobby, and I was just wondering what the scripting ninjas out there would recommend to someone like me who is enjoying the structure and flow of LSL.
What languages are similar to the LSL scripts? And, branching from that, are there any good free online resources that would help me learn the language?
Thanks,
LF
_____________________
---- http://www.lordfly.com/ http://www.twitter.com/lordfly http://www.plurk.com/lordfly
|
|
Icon Serpentine
punk in drublic
Join date: 13 Nov 2003
Posts: 858
|
11-28-2004 19:40
Java and C/C++ There should be plenty of tutorials if you google well enough for them. 
_____________________
If you are awesome!
|
|
Water Rogers
Registered User
Join date: 1 May 2003
Posts: 286
|
11-28-2004 19:52
c, java, perl, php... actually everything has it's own uniqueness about it and what you're wanting to use it for. If you're wanting to dabble into Windows-driven applications... visual basic is a good stepping stone. C# is a new cross-breed from C and C++ when you want to get into dot syntaxing (windows.system.forms.io.object etc). If you're wanting to go for more web-based programming, php is a great place to start. Actionscripting (Macromedia Flash) can be pretty fun to play with (good visual introductions to object oriented programming). ASP is also another useful way to go for web-based server-side applications, as is Perl. Python is also pretty widely used and well documented. Everyone will have their own ideas and opinions as where to go, you'll find your niche though and develop your own opinions/ideas. http://www.hotscripts.com/ Good luck! --Water
_____________________
From: Philip Linden For the more technically minded - the problem is actually NOT the asset server (or 'asshat' as you prefer to affectionately call it herein).
|
|
Huns Valen
Don't PM me here.
Join date: 3 May 2003
Posts: 2,749
|
11-28-2004 20:18
CPL was invented and then begat BCPL in the 1960s. BCPL begat B in the 1960s. B begat C in the 1970s. C has many descendants, including: - C++, which begat Java
- Perl
- PHP
- ECMAScript, which became known as JavaScript, although it is not based on Java at all; ActionScript is an implementation of JavaScript
- LSL is similar to JavaScript, except that it adds state machines and does not feature direct indexing (i.e. you have to use llCharAt(), llList2___(), etc.) Neither language natively supports multidimensional arrays.
A good next language would probably be either JavaScript/ActionScript (they are the same thing, they just have different API calls) or Java. Any of those languages will teach you fairly good coding habits. Then there is BASIC, which came before C and is not related to the C family in any way. It is a looser language, and it can teach you many bad habits - it requires more discipline to be a good BASIC programmer, and many professional coders don't like its style, which is somewhat sloppy compared to C-based languages. (I learned BASIC before C so I feel qualified to say that.) PHP, Perl, and similar languages are very powerful, but they can also teach you bad habits, depending on how you use them. Personally I would never use anything but PHP to write a web application, but different people have different tastes.
|
|
Cristiano Midnight
Evil Snapshot Baron
Join date: 17 May 2003
Posts: 8,616
|
11-28-2004 20:32
I would suggest that you experiment with several languages and find what best suits what you would like to do, and the platform you are using. If you are planning on doing Windows application development, Microsoft tools and languages are a popular choice. I will state that my bias is towards Microsoft technologies, they are what I use on a daily basis for my work in development of a mission critical web application for an airline client, and they have suited me very well.
My background is in Microsoft technologies - I started by learning to program ASP pages in VBScript in college as a side project for a friend's business magazine (I hated Javascript at the time and ASP allowed you a choice of languages). Learning VBscript for me led to learning full Visual Basic for some desktop application development for clients. When the .net Framework was released, instead of moving to VB.net, I went with C# instead. I love that you can program for the .net framework using a variety of languages - VB, C#, C++ are part of it natively ,and there are other compilers available including more exotic languages like Eiffel and even a Perl.net implementation. The same techniques that are used for desktop application development are used for web applications, so there is not a separate language you need to learn to do web apps vs. desktop applications (unlike PHP, for example). I tried Java at several different stages along the way, but never took a liking to it. To each his own, I never found the development tools mature enough or integrated enough with the other technologies I was using.
There is of course the anything but Microsoft/Linux/PHP/Open Source/etc... arguments as well that have already been presented. Ultimately it comes down to what you are most comfortable programming in, and what best suits the task at hand. With the rich selection of options available, from Java to the Microsoft .net Framework and beyond, you really can't go wrong by trying to find whatever fits you best.
_____________________
Cristiano ANOmations - huge selection of high quality, low priced animations all $100L or less. ~SLUniverse.com~ SL's oldest and largest community site, featuring Snapzilla image sharing, forums, and much more. 
|
|
Lisse Livingston
Mentor/Instructor/Greeter
Join date: 16 May 2004
Posts: 1,130
|
11-28-2004 20:41
I came from the opposite direction - 25 years of programming before coming across LSL. However, I had only encountered procedural languages, rather than state-based or object oriented. My current favorite is PHP. Going from that to LSL is like my brain being torn out  I still struggle to get even the basics of a script to work right first, second or even third time  It's a totally different way of thinking for me. Based on that, PHP may not be a logical step for you! But it sure is the best general-purpose language to learn if you're going to be using it for server-side scripting on web sites. It has links to interact with almost any type of database out there, XML, JPEGs, PDFs, PNGs, PGP, many of the popular internet payment gateways - the list goes on. It's the built-in functions that save me from reinventing the wheel that makes me love it so!
_____________________
Land Developer, Builder and Real Estate Agent Come to my events! Sundays at 10:00 am: Texturing ContestTuesdays at 5:00 pm: Land 101 and at 7:00 pm: TriviaThursdays at 7:00 pm: Land 101Fridays at 7:00 pm: Primtionary(Other events occasionally scheduled) Read my LiveJournal! Visit my Livingston Properties web site for your Real Estate and Building needs!
|
|
Ace Cassidy
Resident Bohemian
Join date: 5 Apr 2004
Posts: 1,228
|
11-28-2004 20:49
In terms of the syntax of the language (what the logical constructs are, how data is defined, the format of expressions, etc.), LSL is very much like C/C++ and Java. But for that matter, most languages follow similar constructs (although you can find weird beasts like LISP, which are nothing like LSL).
However, what is somewhat unique about LSL is its state/event driven nature. That is, the way that the code is invoked.
Most languages are procedural in nature, with a program having a beginning (e.g. the function main() in a "C" or C++ application), and then following a natural flow from there.
With LSL, your scripts are generally sitting there and doing nothing but waiting for some "event" to happen. There are all sorts of events in LSL. Someone can "touch" the object containing the script, or the object might collide with another, or the script may have set up a listen and an event gets triggered when certain text comes across a specified channel.
So what happens with LSL is that the event happens, and then depending on the current state of your script, a chunk of code will be executed. All processing in LSL happens in response to these events.
If you understand computer architectures at all, you might think of LSL processing as nothing but non-preemptible interrupt handlers. With most modern CPU's, an interrupt happens when some external device has something for the CPU to handle. A packet may have arrived on your ethernet card, or the keyboard may have been struck, or some data has arrived from a disk drive. It is the interrupt handlers of a CPU that respond to these interrupts (or events, if you want to use LSL nomenclature).
It is the state/event mechanism of LSL that is the most difficult for new scripters to get a handle on. This is mainly because there are no other high level languages that I am aware of that are architected in this manner.
If you want to try and get an understanding on states and event processing, do some googling on "finite state machine". A finite state machine is an abstract notion of computability, and is used a lot in the Theory of Computer Science. But the concepts of states and the processing of inputs is very similar to what LSL tries to accomplish.
A long-winded reply, I suppose, but I hope it is helpful...
- Ace
_____________________
"Free your mind, and your ass will follow" - George Clinton
|
|
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
|
11-28-2004 21:02
I was working in a large Investment Bank as a sysadmin, and our language of choice was VBScript, because it is easy to learn. PHP has a very strong following for doing webpage cgi work. Perl has a very strong following for sysadmin and cgi work. Me personally, I favour Python because it is not just easy to learn, but easy to use, *very* fast, and *very* powerful. Azelda Edit: for another take on things, check out this article on Gamedev.net: http://www.gamedev.net/reference/articles/article1932.asp"A close friend of mine went on a job interview recently, for a local game development company. I'm not going to name names here, but let's just say that they're a sorta-large Game Development boutique in Vancouver. "Needless to say, he didn't get the job, but that's a tale for another day. However, I personally believe that one of the reasons he didn't get the job was because of his lack of familiarity with a scripting language that they are using in-house called Lua."
|
|
Huns Valen
Don't PM me here.
Join date: 3 May 2003
Posts: 2,749
|
11-28-2004 21:10
From: Cristiano Midnight so there is not a separate language you need to learn to do web apps vs. desktop applications (unlike PHP, for example). Actually you can write console and GUI apps with PHP. It supports console natively (I have done this professionally) and it has GTK integration so you can write apps that will run on X11 (UNIX/Linux/BSD), Windows, and Mac OS. PHP and Perl are probably my two favorite languages because they have native support for hash tables right in the syntax. This is an extremely powerful feature. For Java or C++ to do the same thing is very clunky and much harder to work with. For example, say I have a hashtable set up, indexing website customers by their customer ID: [site records] -> [stuffcom] -> [sitename] -> "stuff.com" [services] -> [email] -> TRUE [hitcounter] -> TRUE [VPN] -> TRUE [anonFTP] -> TRUE [hits] -> 809 [unique visits] -> 533
[johnsv] -> [sitename] -> "johnsvehicles.com" [services] -> [email] -> TRUE [hitcounter] -> TRUE [VPN] -> TRUE [hits] -> 3329 [unique visits] -> 2109 To see whether or not customer johnsv has the email service turned on, I would check $records[johnsv][services][email]. So it allows you to set up your data in a very intuitive heirarchical way. One of the apps I did tricked a web analyzer called Urchin into disgorging the statistics it had gathered on certain websites. I would set up all the data in a big hashtable, iterate through it, and generate email reports. It also works very well if you are using a relational database - for example, if you have a customer table and a services table, they will map into (and back out of) a hashtable very easily. I am guessing that is one of the things Lisse misses from doing PHP work... I know it is a huge bummer for me to have to go from hashtables supported in the syntax to one-dimensional lists that I have to access with library calls. From: Ace Cassidy If you understand computer architectures at all, you might think of LSL processing as nothing but non-preemptible interrupt handlers. That is exactly what it is, but instead of rewriting some entries in the vector table, you change states.
|
|
Cristiano Midnight
Evil Snapshot Baron
Join date: 17 May 2003
Posts: 8,616
|
11-28-2004 21:19
One thing I will add to what Ace said about the event/state driven nature of LSL is it is similar in concept to events in the .net framework and Java. For example, when you are developing a web application, the actual processing of the page occurs as a series of events that you can respond to, making it very intuitive to work with. The page loading is an event that has code that you run during that process. Clicking on a button on the page produces an event you can respond to. Filling a table with data produces a series of events you can respond to in order to modify the data. Event driven program is a very powerful paradigm to work with, especially for web applications. Visual Basic, VB.net and C# are all very heavily event driven, you can even create custom events and encapsulate functionality into discreet pieces of code called controls. Many languages are also object oriented, which adds a lot of power to the language as well and is a deal breaker for me in terms of choosing a language when choice is available. If you don't know what object oriented programming is, you should learn - I could never go back to programming without it. One of the biggest frustrations for me has been LSL's lack of any kind of object oriented features. You will find object oriented programming in a variety of languages. Just some additional food for thought.
_____________________
Cristiano ANOmations - huge selection of high quality, low priced animations all $100L or less. ~SLUniverse.com~ SL's oldest and largest community site, featuring Snapzilla image sharing, forums, and much more. 
|
|
Antagonistic Protagonist
Zeta
Join date: 29 Jun 2003
Posts: 467
|
11-28-2004 22:46
THE LESSER-KNOWN PROGRAMMING LANGUAGES #18: C-
This language was named for the grade received by its creator when he submitted it as a class project in a graduate programming class. C- is best described as a low-level programming language. In fact, the language generally requires more C- statements than machine-code statements to execute a given task. In this respect, it is very similar to COBOL.
|
|
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
|
11-28-2004 23:35
The syntax of LSL is very similar to C, but that's actually largely irrelevant to your question. The languages most similar to it are event-driven GUI programming languages such as Visual Basic and Delphi. I haven't programmed in Objective-C, but I expect it's also similar.
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
|
|
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
|
11-28-2004 23:52
I would take a c++ class. If it's too confusing, you can always drop back to visual basic, or real basic. Personally I found vb and rb more confusing then c++. I like c++ because it's been widely used, and almost every one knows how to program in it. Making it a good lounge for a portfolios. Plus c++ and c mix well. And most school teach both. Allowing for an easy transition into the more advance concepts. And if you switch schools you wouldn't have to worry about transference of credits.
That said there are allot of people who know c and c++. The one thing I would like to do, that I haven't had a chance to, is to learn php and mySQL. There are allot of jobs out there for data base specialists. If you look out over the web all the major web sites are bd driven. Version tracker, this forum, price watch, pb, amazon, web comics, all of them have a good db. And there is allot of possibilities out there for any one who builds a db. It's still the wild west online. It's not like windows where adobe own the graphics market.
|
|
Cosmo Drago
Pixel Dust Addict
Join date: 28 Aug 2004
Posts: 377
|
11-29-2004 01:20
From: Lordfly Digeridoo ... I've always wanted to learn computer programming...enjoying the structure and flow of LSL. ... Same here! Thanx for all the great posts and info.
_____________________
 a work in progress... 
|
|
Xtopherxaos Ixtab
D- in English
Join date: 7 Oct 2004
Posts: 884
|
11-29-2004 06:04
Read entire thread....
*head explodes, leaving just a bloody stump at the top of the neck*
|
|
Schwanson Schlegel
SL's Tokin' Villain
Join date: 15 Nov 2003
Posts: 2,721
|
11-29-2004 06:32
I speak english. I would not reccomend this, as it looks nothing like LSL. 
|
|
Cadroe Murphy
Assistant to Mr. Shatner
Join date: 31 Jul 2003
Posts: 689
|
11-29-2004 06:43
As you can see, many of the most common languages are superficially similar to LSL. My suggestion would be to try to figure out what you want to do, and then pick a language based on that. And that includes the cost, the available tools, the learning resources, existing projects you're interested in, etc. Christiano's post is a good example of that approach. Also, I find it pretty common to have to use more than one language to accomplish anything anyway, whether it's Java, HTML, and SQL, or C#, XML, and MaxScript.
_____________________
ShapeGen 1.12 and Cadroe Lathe 1.32 now available through SLExchange.
|
|
Lordfly Digeridoo
Prim Orchestrator
Join date: 21 Jul 2003
Posts: 3,628
|
11-29-2004 07:12
Thanks all for the replies. My initial reason for learning programming is to make little apps in Windows, using the windows API and all that... I imagine C++ or Visual BAsic is the way to go. I've tried learning VB once, but I found it clunky and too limiting... I failed a c++ class in high school, mostly because I couldn't get past the logic problems for some reason. After dinking around in LSL and getting it, I think I'll go for C++ first. Thanks all for the help  LF
_____________________
---- http://www.lordfly.com/ http://www.twitter.com/lordfly http://www.plurk.com/lordfly
|
|
Pendari Lorentz
Senior Member
Join date: 5 Sep 2003
Posts: 4,372
|
11-29-2004 08:00
I was avoiding this thread for fear that my head would explode, but actually this .... *head explodes* err, NM! 
_____________________
*hugs everyone*
|
|
Khamon Fate
fategardens.net
Join date: 21 Nov 2003
Posts: 4,177
|
11-29-2004 08:10
From: Lordfly Digeridoo Thanks all for the replies. My initial reason for learning programming is to make little apps in Windows, using the windows API and all that... I imagine C++ or Visual BAsic is the way to go. I've tried learning VB once, but I found it clunky and too limiting... I failed a c++ class in high school, mostly because I couldn't get past the logic problems for some reason. After dinking around in LSL and getting it, I think I'll go for C++ first. Thanks all for the help  LF From: Icon Serpentine Java and C/C++ There should be plenty of tutorials if you google well enough for them.  directx and c# also make a good combo for windows-based stuff. oddly enough, the dummy books for programming languages are generally pretty good. they start at the beginning and go beyond mere introduction with useful examples and all. there are also a few tutorial websites for each. you can find a few links to link pages at profnano.org/hackers. you'll likely want to install the .net framework stuff as well. it's free.
_____________________
Visit the Fate Gardens Website @ fategardens.net
|