views:

614

answers:

8

The other day, I tweaked a script for a friend's World of Warcraft addon. He was surprised that you could edit the addons—that they were "open source." (Word of Warcraft addons are written in the Lua scripting language) I found myself wanting to say "Sure you can—all scripts are 'open source'."

Is that true? Sure, some scripts can be compiled to bytecode, but aren't almost all scripts interpreted? That is to say, doesn't the device interpreting the script need the "source," by definition?

A: 

You can compile Lua and other scripting languages and obscure them in various ways. It's only more common--not more necessary--for the source to be open by default than is the case with other languages.

John Zwinck
+12  A: 

Open source is about licensing. A script can have any license the author (or copyright holder, such as an employer) wants. So the answer is "no".

It is the case that scripts are typically distributed in the same form that they're written - no compiled format. So you can see the source. That doesn't mean they're open source.

John M
I like your answer but I would probably alter "author" to be "copyright holder"
Andrew Kennan
I thought of that as I typed it originally. I try to keep my pedantic impulses in check. It is a good point, so I did the edit.
John M
+2  A: 

"Open Source" doesn't just mean that you have the source, it's also used to describe your legal right to redistribute the code either with or without modifications.

Based on the copyright & licensing, many scripts are not open source.

Darron
+16  A: 

It depends on how you interpret "open source".

Sure, you have the source code, but typically that isn't exactly what Open Source means. Usually open source refers to the licensing. To have something "open source" means that you are free to modify the source for any purpose, including redistributing it in many cases.

Just having the source doesn't make it open source in the general software sense. If the script is copyrighted, then it is technically "closed". You could modify it, but if you redistribute it without the author's permission you are in violation of their implied (or explicitly registered) copyright.

Dan Herbert
An important point: Open Source scripts are also copyrighted. In fact, the copyright makes the open source license meaningfully enforceable. Only works that you put in the public domain are without copyright.
kaizer.se
A: 

To distribute a program for an interpreter, you have to send source (though not necessarily comprehensible source). This does not automatically mean that is is Open or Free in the way these terms are often used.

dmckee
+1  A: 

As noted by many, just because you have access to the source doesn't give you the right to do as you like with it.

You ask

Aren't almost all scripts interpreted? That is to say, doesn't the device interpreting the script need the "source," by definition?

No. Even in an interpreter, the source goes through several transformations before being interpreted. The form that is ultimately interpreted is often a sequence of instructions for a stack-based or register-based virtual machine; such instructions are usually called "bytecode". It is also possible to interpret internal trees relatively efficiently. Interpreters designed primarily for teaching purposes may use even less efficient schemes.

Some implementations permit you to take the internal form and write it to disk, from which it can be re-read and interpreted. The perceived advantages are usually

  • Programs load and run faster because the initial processing stages are performed once before the internal form is written, then reused over and over.

  • The internal form protects the source code from prying eyes.

The main disadvantage is that a typical internal form is usually less portable than source code, perhaps because of differences in byte order or word size.

In the particular case of Lua, the luac compiler will write bytecode to disk. It is seldom used because the bytecodes are not portable and because the compiler is already quite fast. In the particular case of World of Warcraft, they are actually encouraging people to use Lua to modify the interface and to customize the experience; they want everybody to share code and so keep it open source. WoW has over 10 million subscribers, and at least 5000 people have contributed code. so that's a half a percent of the user base that have contributed some code, which gives me happy thoughts about the future of programming as a profession.

Norman Ramsey
+4  A: 

No.

"Open source" is not the same thing as being able to view the source code; open source licencing is about the legal right to derive works from that source code.

If you take someone else's work, modify and redistribute it without their explicit consent, then you are infringing upon their copyright, and breaking the law.

Rob
Whoa, dude. Chill. :)
Epaga
A: 

I seem to remember reading something in the game terms and conditions that requires addons to be licensed as open source but I can't seem to find it now so I may have been imagining it. In all practical cases they are though.

John Burton