When does "scripting" become "programming"?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: When does "scripting" become "programming"?

Post 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.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
slime
Solid Snayke
Posts: 3147
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: When does "scripting" become "programming"?

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: When does "scripting" become "programming"?

Post 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.
Help us help you: attach a .love.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: When does "scripting" become "programming"?

Post 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. :roll:
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.
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
User avatar
ston
Prole
Posts: 21
Joined: Fri Jan 27, 2012 9:53 am
Location: Holt, a small village in Wiltshire. We have cider!

Re: When does "scripting" become "programming"?

Post 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.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: When does "scripting" become "programming"?

Post 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.
User avatar
ston
Prole
Posts: 21
Joined: Fri Jan 27, 2012 9:53 am
Location: Holt, a small village in Wiltshire. We have cider!

Re: When does "scripting" become "programming"?

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: When does "scripting" become "programming"?

Post 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, ...
Help us help you: attach a .love.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: When does "scripting" become "programming"?

Post 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.
User avatar
legendman3
Citizen
Posts: 68
Joined: Sun Jan 22, 2012 8:29 pm

Re: When does "scripting" become "programming"?

Post 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. :3
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests