Solved

Scripting vs. Programming languages

Posted on 2016-10-28
25
108 Views
Last Modified: 2016-11-22
Hello,

This is a terminology question which hopefully can be answered with brief comments.

Is there a difference between Scripting Language and Programming Language and if so, what distinguishes the two?

I'm not a programmer but I do use AutoHotkey (AHK) for some simple macros. I've always seen AHK described as a Scripting Language. Would it therefore be incorrect to refer to it as a Programming Language?

I also have a limited understanding of how to use Excel formulas (not VBA) but would that (Excel formulas) be considered either of the above languages or something different altogether?

And regarding the word "code", I assume all of the above would have that designation, right?

Thanks
0
Comment
Question by:WeThotUWasAToad
  • 10
  • 4
  • 4
  • +3
25 Comments
 
LVL 32

Assisted Solution

by:it_saige
it_saige earned 62 total points
Comment Utility
Without beating around the bush, the end result is the determining factor between a program and a script.  So its not a comparison of languages but the end product.

At it's simplest, a script is generally a set of *interpreted* instructions, whereas a program is a set of *compiled* instructions.

-saige-
1
 
LVL 51

Accepted Solution

by:
Joe Winograd, EE MVE earned 252 total points
Comment Utility
Hi Steve,

> Is there a difference between Scripting Language and Programming Language and if so, what distinguishes the two?

I tend to use the terms interchangeably. I'm an AutoHotkey "programmer", and will say that I'm writing "an AutoHotkey program" or "an AutoHotkey script" with no real distinction.

> I've always seen AHK described as a Scripting Language. Would it therefore be incorrect to refer to it as a Programming Language?

No. It is perfectly fine to call it a "programming language" and perfectly fine to call the code that you write in it "programs".

> would that (Excel formulas) be considered either of the above languages or something different altogether?

Those are generally considered "macros", although a complex macro (in VBA) certainly bears a striking resemblance to a script/program (in VBS). :)

> And regarding the word "code", I assume all of the above would have that designation, right?

Yes. When you're writing a script/program/macro, you're writing "code" (also called "source code")...or, you're "coding".

I hadn't looked there before re this subject, but your question prompted me to check Wikipedia, and both articles are worthy of a read:
https://en.wikipedia.org/wiki/Programming_language
https://en.wikipedia.org/wiki/Scripting_language

Re it_saige's distinction between a program and a script, I would point out that compiled code can still be called be a script — and can still be an interpreted language. AutoHotkey is a great example. You can "compile" the code/program/script into a Windows binary/executable (an EXE file), but the result is still a script and is still interpreted, because the AHK "compiler" simply packages the AHK interpreter along with your source code. Regards, Joe
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
I agree with -saige-.  However... there tends to be a lot of overlap because scripting languages like PHP and JavaScript are 'pre-compiled' when they are run.  Older languages like some early versions of Basic were only interpreted and never compiled.  'Scripts' like batch files are not compiled either.
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 62 total points
Comment Utility
I generally consider 'programming languages' as those that are (and must be) compiled before you try to run the programs and not just when.  Those would include C, C++, and some others but not PHP, Perl, and Python.
1
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
> I generally consider 'programming languages' as those that are (and must be) compiled before you try to run the programs and not just when.

I do not. When I'm writing code in AutoHotkey, I consider myself to be coding in a "programming language". In fact, many "programming languages" have been implemented via both compilers and interpreters — examples that I can think of off the top of my head are Basic, Fortran, Lisp, and Pascal. I don't think they stop being a "programming language" on a system with an interpreter, yet remain a "programming language" on a system with a compiler. Either way, they are programming languages, imo. In other words, Fortran is a programming language, whether you're coding on a computer with a Fortran compiler or one with a Fortran interpreter — and I've done both. Regards, Joe
0
 
LVL 78

Assisted Solution

by:David Johnson, CD, MVP
David Johnson, CD, MVP earned 62 total points
Comment Utility
Scripting and Program languages are the same they follow a set of instructions to accomplish a task so they are both programs.
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 62 total points
Comment Utility
@Obrotherwherearthou
My short version

Script: code "executes" in plain text within a host
Program: code is compiled and runs as a self standing binary.

People who code in either are called programmers.
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
> Script: code "executes" in plain text within a host

Sounds like an interpreter. :)

So this says that if I've written code in Fortran and it executes in plain text on a host with a Fortran interpreter (i.e., it was not compiled into "a self standing binary"), then my Fortran code is a script. But if the same exact code runs on a computer with a Fortran compiler after being compiled into an executable, then my Fortran code is a program. Hmmm...

I have a stand-alone binary file called HelloWorld.exe on my PC (discussed in this EE article). Double-clicking on the EXE displays a dialog box that says, "Hello World". Is it a program or a script?
0
 
LVL 32

Expert Comment

by:it_saige
Comment Utility
@Joe,

Complexity does not determine if the code is a script or a program.  Compilation of a script into a standalone executable makes that script a program.  

It doesn't really help to try to overemphasize the actions that the code takes.  The simple question is is it a compiled set of instructions or an uncompiled set of instructions.

If your instructions are compiled (even if it is loosely compiled; e.g. IL) then you have a program plain and simple.  If on the other hand, you have an uncompiled set of instructions then you have a script.

-saige-
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
Hi saige,

I think at this point we'll just have to agree to disagree.

> Complexity does not determine if the code is a script or a program.

I never mentioned complexity. My comments have nothing to do with the simplicity/complexity of the code. I have AutoHotkey source code files that are one line of code and some that are thousands of lines of code. I'm fine with calling them scripts or programs.

> Compilation of a script into a standalone executable makes that script a program.

I do not think that compiling a one-line AHK file or a thousand-line AHK file "into a standalone executable makes that script a program."

> It doesn't really help to try to overemphasize the actions that the code takes.

I haven't.

> The simple question is is it a compiled set of instructions or an uncompiled set of instructions.

That's not the question. The question is, "Is there a difference between Scripting Language and Programming Language and if so, what distinguishes the two?"

> If your instructions are compiled (even if it is loosely compiled; e.g. IL) then you have a program plain and simple.

Not plain and simple — and I disagree.

> If on the other hand, you have an uncompiled set of instructions then you have a script.

I disagree again. Are you telling me that a million-line C++ program that implements a word processor is a script when it is "an uncompiled set of instructions"?! Nonsense! It is a program.

Regards, Joe
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
As someone who has programmed in Assembler, C, and PHP, I can tell you that the 'text' versions of the source code only run as a program in PHP.  The text for the source code of the Assembler and C 'programs' don't run at all in their text format so they are never scripts that are interpreted.  

So your million lines of C++ is source code, not a program that will run until it is compiled.  It is definitely not a script that can run either.
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
> As someone who has programmed in Assembler, C, and PHP, I can tell you that the 'text' versions of the source code only run as a program in PHP.

Until recent years in Windows, all of my programming was for the kernel of mainframe operating systems in assembly language, so I'm with you on that. Never programmed in C or PHP, but I'll take your word on it.

> So your million lines of C++ is source code

Yes, of course. Btw, I never programmed in C++, either — was just using that for my argument.

> not a program that will run until it is compiled

Yes, of course. But when I describe to someone what has been written in that million lines of code, I'll say that it's a word processing "program".

> It is definitely not a script that can run either.

Sorry, don't understand that comment.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
I think the OP was about trying to get a handle on semantics in terms of how the words are used today. There are going to be exceptions - the rules are not hard and fast. One can get to splitting hairs and getting one to be the other. But I think we need to focus on the general case. In the general case languages like
JavaScript
PHP
Python
Perl
PowerShell

Run as scripts inside a Host

Java
C#
Run as compiled code inside an environment (JVM / CLR)

C/C++
Assembler

Run as compiled self standing executables

There are examples that straddle these boundaries but in the general case that is how the terms are used (in my experience)
0
 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
@WeThotUWasAToad
Do you still need assistance with this question? If so please post back here, if not can you close the question.

JulianH
0
 

Author Comment

by:WeThotUWasAToad
Comment Utility
Whoa, that is a lot of feedback — but it is all much appreciated.

However, I have to confess that I began to chuckle as I was scrolling…and scrolling…and scrolling…particularly since my OP included the following:
This is a terminology question which hopefully can be answered with brief comments.
(emphasis added).

Also fyi, the retort that popped into my mind — which will likely put a grin on the face of those of you old enough to remember the early 70s — was: "I didn't expect the Spanish Inquisition." hehe

(Dave, I figured that last bit was OK to include since you mentioned "Python". — hehe again but with a loud groan this time) :P

The main messages I got are:

1) There's a fair amount of overlap and varying opinions regarding the terminology.

2) One of the main determinants is whether or not the code that's written must be compiled. Unfortunately, I don't know what "compiled" means in this particular context but I presume it's some additional step or process before the code can be utilized. Is that correct?

I'm obviously not a programmer but I do use AutoHotkey a fair amount and it seems quite apparent that there is some underlying and unseen "code" running which was "written" by someone and makes the commands I use do what I expect them to do. Is it therefore accurate to say that the unseen code is programming while the part I use is a scripting language?

3) Finally, I don't have a clue how to assign points in this type of thread. I think I'll have to sleep on it and maybe the answer will come to me later. :P

Thanks to all who participated.
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
> One of the main determinants is whether or not the code that's written must be compiled.

I disagree. I'm working on a program now that is written in AutoHotkey. It is thousands of lines of code. It is complex. Doesn't matter whether it is executed from the source code (AHK) or from the binary (EXE). It is a program. But if you want to call it a script, that's fine, too.

> Unfortunately, I don't know what "compiled" means in this particular context but I presume it's some additional step or process before the code can be utilized. Is that correct?

In the context of a non-interpreted implementation of a language, you are correct — the additional step of compiling is needed before the code can be utilized. But in the context of an interpreted implementation of a language, compiling is not needed — the source code can be utilized by, of course, the interpreter. And, as I said, earlier, the same computer can have both implementations. For example, I worked on a UNIVAC mainframe that had both a FORTRAN compiler and a FORTRAN interpreter (the latter was called CFOR, an acronym for Conversational FORTRAN). You could write a "program" in the same language, i.e., FORTRAN, and either compile it into a binary with the FORTRAN compiler or run the code directly with CFOR.

> I'm obviously not a programmer but I do use AutoHotkey a fair amount and it seems quite apparent that there is some underlying and unseen "code" running which was "written" by someone and makes the commands I use do what I expect them to do.

AutoHotkey itself is a program that is written in C++ (you may download the source code for it from GitHub). It is compiled into three different binaries — a 32-bit ANSI version, 32-bit Unicode, and 64-bit Unicode. They are all EXE files that are, per se, the AutoHotkey interpreter. The input to the AutoHotkey interpreter is the source code of an AutoHotkey program/script. AutoHotkey also has a "compiler", but I put quotes around that because it is not a compiler in the traditional sense, even though a right-click on an AHK file shows "Compile Script". The name of the "compiler" executable more accurately reflects what it really is — it is called "Ahk2Exe" (look in the c:\Program Files\AutoHotkey\Compiler\ folder and you'll see a file called Ahk2Exe.exe). "Compiling" in AutoHotkey creates an EXE file that contains the AutoHotkey interpreter itself and your AutoHotkey code/program/script (a lot of this is discussed in my AutoHotkey - Getting Started article, https://www.experts-exchange.com/articles/18346/).

> Is it therefore accurate to say that the unseen code is programming while the part I use is a scripting language?

In my opinion — no! Sure, the "unseen code", i.e., the AutoHotkey interpreter, is written in C++ and the folks who write that are, indeed, programming. But when you write code in the AutoHotkey language, you are also programming. Is AutoHotkey a scripting language? Yes! Is AutoHotkey a programming language? Yes!

Regards, Joe
0
 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
Might be useful to distinguish between the noun and the verb. Programming (verb) is the act of writing code - and can be applied to the process of constructing logical statements according to specified rules (grammar) that achieve some purpose.

A program (noun) has a historical tie back to applications that were compiled - source code goes through a process (compiler) which produces a binary (machine code) version of the application which can then run natively on the target device.

Currently we have languages that are compiled, interpreted and some that are both. If we want to distinguish between how these different languages work we need the terminology to do so. Is this something that will run natively or is a host environment required to interpret the code.

The way I see it we can still distinguish between the two using script and program without taking away the label of "programmer" from the people who create either?
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
Let's go back to the original question:

"Is there a difference between Scripting Language and Programming Language and if so, what distinguishes the two?"

I think that the idea expressed in Wikipedia's Scripting language article that I mentioned in my first post presents a reasonable distinction, namely, "A scripting or script language is a programming language that..." In other words, there are many types of programming language — a scripting language is one type.

Numerous types of programming language are in the Wikipedia article, List of programming languages by type. "Scripting languages" is one entry of dozens of "Programming languages" in that article. I'm good with that as distinguishing the two. Regards, Joe
0
 
LVL 32

Expert Comment

by:it_saige
Comment Utility
And as I had stated in my original post, the end result is the determining factor.  Scripts are still programs, yes, but, regardless of what your script does and the complexity that it uses to accomplish said task(s), in its interpreted form a script is still a script.  When you compile the script into a binary, it is an executable program.  Scripting languages don't require compilation but most can be compiled.  

There are many reasons that you would compile a script into an executable binary, to name a few:
1.  Removes the dependency for the interpreter to be installed on the client system.
2.  Obfuscates the script so that it cannot be read in it's clear text form.
3.  Performance can be improved, but not always.

These comments are not meant to take anything away from what you have accomplished or to try and belittle you in anyway; These comments are made without bias or beating around the bush.

-saige-
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
> the end result is the determining factor

What do you mean by "end result"?

> Scripts are still programs

Agree — scripts are programs.

> in its interpreted form a script is still a script

Disagree. I'm fine with saying that code written in FORTRAN is a program, even if it is fed to a FORTRAN interpreter, not a FORTRAN compiler.

> When you compile the script into a binary, it is an executable program.

Yes, but that doesn't turn the source code from being a script into being a program, imo.

> Scripting languages don't require compilation but most can be compiled.

I don't know about "most", but definitely agree that many can be compiled.

> Removes the dependency for the interpreter to be installed on the client system.

Agree. A very important point!

> Obfuscates the script so that it cannot be read in it's clear text form.

Sometimes yes, sometimes no. For example, AutoHotkey packages the program/script's source code along with the AutoHotkey interpreter into the EXE file. Unless you use something like MPRESS, you can load the EXE into a text editor and read the source code in its clear text form (and even with MPRESS, there are crackers widely available for it). If you search the AHK user forums for "code obfuscation", you'll get plenty of hits, but nothing that is 100%. Btw, I wrote a program (hehe) in AutoHotkey that provides a degree of obfuscation by changing all variable names into a string of lower case "L" and upper case "O" letters (the "compiler" already removes comments). Here's what some of the obfuscated code looks like:

lOOOOOlOOOlll:=9
lOOOOOlOOlllO:=InStr(lOOOOOlllOlll,lOOOOOllOlOOl)
lOOOOOllllOll:=lOOOOOlOOlllO-lOOOOOlOOOlll
lOOOOlOOOllOl:=SubStr(lOOOOOlllOlll,lOOOOOlOOOlll,lOOOOOllllOll)
lOOOOOllOlOlO:=lOOOOOlOOlllO+lOOOOOlOOllOl
lOOOOlOllOlll:=SubStr(lOOOOOlllOlll,lOOOOOllOlOlO)
If ((lOOOOOlllOlll<>"none") and (lOOOOOOOOlOlO<>lOOOOOOOlOOlO) and (lOOOOOlOOOlOl=0))
{
  If (lOOOOllOOOOOO>0)
  {
    lOOOOlOOOOllO:="*lOOOOOlllOlll=" . lOOOOOlllOlll
    Gosub,lOOOOlOOOlOll
  }
  lOOOOOOOOlOlO:=lOOOOOOOOlOlO+1
}

Open in new window


Although still in clear text form, it will be very difficult for someone to steal that code for the purpose of modifying it (which is often the reason for obfuscation).

> Performance can be improved, but not always.

Agree with "not always" — in fact, probably "not usually". And certainly not with AutoHotkey, which runs the same interpreter via the EXE file.

> These comments are not meant to take anything away from what you have accomplished or to try and belittle you in anyway;

I don't know if that comment was directed at me, but I certainly didn't take any of your comments as belittling in any way.

Regards, Joe
0
 

Author Comment

by:WeThotUWasAToad
Comment Utility
Wonderful dialog — and fascinating! Isn't Experts Exchange awesome?

I don't know if I've got an answer to my OP question even though I have been given several answers. That's probably mostly my fault however because my brain likes to get things pigeonholed in nice neat categories with unambiguous demarcations between them even though, as the present thread illustrates, that is not always possible.

One thing I do like about Joe's comments — although "like" doesn't carry much weight — is that I guess it's not completely accurate when I say, "I'm not a programmer." (Said with 100% tongue-in-cheek intent) hehe

As for points, I hope it's OK with everyone if I just sort of divvy them up evenly between the main contributors with the promise that I will post many more questions in days to come.

Thanks again
0
 

Author Comment

by:WeThotUWasAToad
Comment Utility
Lots of great comments!
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
Correct — the next time you write code in AutoHotkey, you're a programmer. :)

The points don't concern me. Divvy them up however you want. More importantly, it was a fun thread! Regards, Joe
0
 

Author Closing Comment

by:WeThotUWasAToad
Comment Utility
This is the 2nd time I've closed this thread. I hope it works this time.

Thanks for all the great comments and dialog.
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
Comment Utility
> I hope it works this time.

It did!

> Thanks for all the great comments and dialog.

You're welcome. And thanks to you for initiating a very interesting thread!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now