Page 2 of 4
Re: When does "scripting" become "programming"?
Posted: Sun Jan 29, 2012 3:25 pm
by Taehl
Classically, the distinction is thus: "Programming" is using a "programming language" (where your code that gets compiled to a binary executable), and "scripting" is using a "scripting language" (where your code which gets run by an interpreter (this includes bytecode and JIT approaches)). So you'd "program" in C, but you'd "script" in Lua.
I don't know if people use the words like that any more, though.
Re: When does "scripting" become "programming"?
Posted: Sun Jan 29, 2012 3:36 pm
by slime
I think that's a valid definition for scripting languages vs programming languages, but not so much for plain scripting vs programming in the context of how most people use those terms.
Re: When does "scripting" become "programming"?
Posted: Sun Jan 29, 2012 10:23 pm
by Robin
I'd say it is useless to maintain this arbitrary distinction. Programming is programming, whether it is C, BrainFuck, BASIC or even JavaScript
(wat). We still have concepts like abstraction, sequence, iteration/recursion, ...
kikito wrote:1. The reason for adding scripting to videogames is not making it easier to "non-programmers". It's making it easier for programmers. C and C++ are languages very close to the machine. That gives them lots of power and speed ... but that comes with a cost: extra complexity. You have to manage your memory yourself. The type system (specially in C++) is ... peculiar. Pointers can point to invalid addresses relatively easily, etc. This kind of complexity, while being ok in certain parts of the game (like the graphical engine) are simply overkill in others. On those scenarios, a scripting language is simply a better tool for the job; programmers will produce the desired result faster, since they don't have to deal with the extra complexity. This doesn't mean that scripting languages are "worse" than compiled ones; it just means they are different tools.
Plus, languages like Lua make it easier to extend games. If you want to write a mod in Lua, you write a new Lua file, put a require somewhere or something, and the next time you run the game, it has your new mod.
If you want to do the same in C++, you'll probably have to re-compile the whole game and change some things in the original source code to include the mod. And if you want to use dynamic linking, you'll still have to do a lot of awkward work just to connect the mod to the game.*
Even if Lua had pointers, no garbage collection and (*shudder*) braces, that one thing would still make it a better way to write mods than C++.
*There is probably some nuance I forgot, making writing mods in a language like C++ easier, but my point still stands.
Re: When does "scripting" become "programming"?
Posted: Mon Jan 30, 2012 11:32 am
by vrld
As far as I'm concerned, the only difference is in the complexity of what you are trying to achieve. For example:
- Something that changes the working directory, executes a command and then goes back to the starting directory would be a script
- Something that runs another program with varying parameters would be a script.
- Something that interprets the output of another program and transforms it could be a script (if the transformation is simple, as in "delete the first word") or a program.
- Something that shows graphics, plays sound and reacts to input would be a program
Note that this definition is language independent. You can script in C (for example, the `
cat' command) and program in Lua. But in the end it doesn't really matter...
nevon wrote:Going by that distinction, wouldn't Java be scripting, since it's run in the JVM?
Well, C++ code too get's compiled to byte-code. Even assembler is sort-of-compiled. The only difference is that C++ and assembler run on a physical processor, while Java-Bytecode does not (at least not always, see below). Going depper, the machine instructions that are the result of compiling C++ or assembler code are themselves interpreted, so the only "real" programming would be to program using
microcode.
Taehl wrote:Classically, the distinction is thus: "Programming" is using a "programming language" (where your code that gets compiled to a binary executable), and "scripting" is using a "scripting language" (where your code which gets run by an interpreter (this includes bytecode and JIT approaches)).
As mentioned before, this fails for things like Java and Lisp. Lisp is normally interpreted, but can also be compiled (to native machine instructions). For both Java and Lisp there are special processors that run the code natively:
lisp machines and
PicoJava.
Re: When does "scripting" become "programming"?
Posted: Mon Jan 30, 2012 1:53 pm
by ston
Scripting certainly is programming. You can do much more interesting and flexible development by combining a scripting language with a compiled language.
For example, the platform we're currently developing has a TCL language definition front-end for the purpose of assay development. This allows the assay author to write (TCL) commands such as: "pipette 30ul of fluid from well_1 to well_2". Good luck building that with a c compiler, or even writing the c code to manage such an interface language ;-) That TCL can redefine itself like this gives great interface flexibility which you won't get with c or c++. Conversely, you probably don't want to write a stepper motor driver in TCL. The two paradigms complement each other.
Another point in having a scripting interface into your game engine/DNA testing machine is that scripts can be swapped in and out on the fly (or easily updated) in a live system; you can rapidly develop, test and easily upgrade the scripted aspects of the system. Scripting interfaces also help game modification communities produce interesting variants on existing games.
Re: When does "scripting" become "programming"?
Posted: Mon Jan 30, 2012 3:04 pm
by MarekkPie
ston wrote:Scripting certainly is programming. You can do much more interesting and flexible development by combining a scripting language with a compiled language.
For example, the platform we're currently developing has a TCL language definition front-end for the purpose of assay development. This allows the assay author to write (TCL) commands such as: "pipette 30ul of fluid from well_1 to well_2". Good luck building that with a c compiler, or even writing the c code to manage such an interface language ;-) That TCL can redefine itself like this gives great interface flexibility which you won't get with c or c++. Conversely, you probably don't want to write a stepper motor driver in TCL. The two paradigms complement each other.
Another point in having a scripting interface into your game engine/DNA testing machine is that scripts can be swapped in and out on the fly (or easily updated) in a live system; you can rapidly develop, test and easily upgrade the scripted aspects of the system. Scripting interfaces also help game modification communities produce interesting variants on existing games.
The first half of this answer: good, an exact definition of when you determine something to be scripting and something to be programming.
The second half: bad, the same dribble that you see on StackExchange that doesn't answer the question.
I'm usually not this confrontational (
on this website anyways) but this subject confuses/baffles me on the amount of "information"
there is out there.
Re: When does "scripting" become "programming"?
Posted: Mon Jan 30, 2012 5:07 pm
by ston
MarekkPie wrote:
The first half of this answer: good, an exact definition of when you determine something to be scripting and something to be programming.
The second half: bad, the same dribble that you see on StackExchange that doesn't answer the question.
I don't understand; the question is invalid so how can it be answered? There is no point at which "scripting becomes programming"; scripting
is a form of programming, which is the point I was making.
The "second half" (not sure which part that is as there are three paragraphs) is nothing to do with trying to answer an invalid question, but rather providing some illustrations on why it can be of benefit to combine both compiled and scripted languages in a system.
btw, never heard of StackExchange.
Re: When does "scripting" become "programming"?
Posted: Mon Jan 30, 2012 5:18 pm
by Robin
ston wrote:btw, never heard of StackExchange.
You should check it out. It's like
StackOverflow. SO was the original site, for programmers (which I think MarekkPie was actually talking about) and it was very popular, so they made StackExchange, which is a collection of sites like SO, about a variety of topics: English, Gaming, Ubuntu, LaTeX, Math, Cooking, Physics, History, ...
Re: When does "scripting" become "programming"?
Posted: Mon Jan 30, 2012 7:06 pm
by MarekkPie
ston wrote:MarekkPie wrote:
The first half of this answer: good, an exact definition of when you determine something to be scripting and something to be programming.
The second half: bad, the same dribble that you see on StackExchange that doesn't answer the question.
I don't understand; the question is invalid so how can it be answered? There is no point at which "scripting becomes programming"; scripting
is a form of programming, which is the point I was making.
The "second half" (not sure which part that is as there are three paragraphs) is nothing to do with trying to answer an invalid question, but rather providing some illustrations on why it can be of benefit to combine both compiled and scripted languages in a system.
btw, never heard of StackExchange.
If the question is invalid, then why did you answer it? Why bother even wasting time writing something down? As you can read from the other posts, some people believe there is a distinct difference, and some people don't. I want to find out why, so when this conversation comes up again (which no doubt it will in all corners of the Internet) I have some better understanding of what these real/imaginary distinctions are.
Re: When does "scripting" become "programming"?
Posted: Tue Jan 31, 2012 12:47 am
by legendman3
I always thought of it as:
Programming: Being Indiana Jones and swooping around finding hidden treasure to send to museums where millions of people will look at them and say, "Cool."
Scripting: Piggybacking on Indiana Jones while he finds all the cool loot and you take it and edit it a little, calling it your own, and getting all the credit.
I call love programming though. Just cause i like to think of it that way.