What's the Difference Between a Programming Language and a Scripting Language?

This is a discussion on What's the Difference Between a Programming Language and a Scripting Language? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; From what I've gathered...a programming language is something that can be compiled? I'm really not so sure what the difference ...

  1. #1
    People Love Me
    Join Date
    Jan 2003
    Posts
    412

    What's the Difference Between a Programming Language and a Scripting Language?

    From what I've gathered...a programming language is something that can be compiled? I'm really not so sure what the difference is.

  2. #2
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    That's pretty much the main difference. Although some fit into both categories (Perl, for example).

    Scripting languages also don't usually require a "main" function of any sort.

  3. #3
    I am me, who else?
    Join Date
    Oct 2002
    Posts
    250
    Most (if not all) scripting languages are interpreted as well. This is why there can be generic variable types, such as $var being a string, a number etc. I don't know about every single language out there, but from my experience the biggest difference is being able to throw a variable in without casting. Probably my favorite feature out of these languages is that the type can represent many things at one time.

  4. #4
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Executable source code is compiled into the binary instructions that will be interpreted by the target CPU when it is run. Script code (at differing levels for different languages, e.g., it would be compiled byte code in Java) contains instructions that are read then performed by an external application.

  5. #5
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Quote Originally Posted by LuckY
    Executable source code is compiled into the binary instructions that will be interpreted by the target CPU when it is run. Script code (at differing levels for different languages, e.g., it would be compiled byte code in Java) contains instructions that are read then performed by an external application.
    are you saying Java is a scripting language? Id have to disagree here. when the scripted source can be interpreted, its a scripting language. If it requires some compilation (whether it be to native, or byte code) than its not a scripting language.

  6. #6
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    You need to split the language from what happens to the language after it is written. You are discussing implementation, not the language itself.

    It would be possible to write interpreters for languages normally compiled to source code, similaly it would be possible to compile some script languages to source code.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  7. #7
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Let me correct myself because I clearly confused myself along with you. Java is an interpreted language in which an application runs compiled byte code, but there exists no compiled executable code. Scripting languages operate in the same manner, but directly from the source code and not any intermediate compiled code of any kind.

  8. #8
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    The Java Virtual Machine does exactly what it says 'on the box'; provides a virtual machine. Java bytecode is effectively machine code, just not for your machine per sť.

    I guess this makes Java a compiled langauge, not interpreted.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  9. #9
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Quote Originally Posted by ahluka
    I guess this makes Java a compiled langauge, not interpreted.
    Java is classified as an "interpreted language." That is the term used to define the category of language to which Java belongs. It is not a "compiled language," but if it makes you feel better I guess you can call it whatever you want. In any case, it is an interpreted language. (The bytecode is interpreted by Java's bytecode interpreter.)

    [edit]
    Java bytecode is effectively machine code
    No, it actually is not. It is merely a set of Java instructions in binary form. Nothing is "effectively" machine code; either it is machine code or it is not, and Java's bytecode is not.
    Last edited by LuckY; 07-13-2005 at 02:01 PM.

  10. #10
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    And the machine code is interpreted by the CPU, so I guess C is an interpreted language as well. Or perhaps you're using an Amiga emulator to play old games - since it interprets the compiled code of those games, that would make the languages the games were written in interpreted as well.
    ahluka is entirely right. The JavaVM is actually a CPU emulator. It's also wrong to say that Java bytecode is Java instructions in a different form - Jython compiles to bytecode, NetRexx does, several other technologies do as well.


    Anyway, the distinction between programming languages and scripting languages is a bad one, because it doesn't divide languages in two groups. The difference between programming and scripting lies only in application. Take Visual Basic for example. There's Visual Basic, which is undoubtedly used for application programming; that would make it a programming language. But then there's Visual Basic for Applications (VBA) - the same language really, but considered a scripting language because it's used to write macros for various apps. Or Visual Basic Scripting Edition (VBScript) - another scripting language although it's the same as VB. As of VB6, you can choose to have your VB as interpreted bytecode or compiled machine code - which is it then?
    What about JavaScript? Is it a scripting language? But large parts of Mozilla - obviously an application - are written in JavaScript.
    PHP? Are you telling me that phpGroupWare or vBulletin are not applications as well?
    Application programming and script/macro programming are two use cases of languages, but it doesn't split languages into groups. Languages can be used for either - some languages are more suited for application programming, some more for scripting, but the distinction is extremely blurry, especially as you'll be hard pressed to find a proper boundary between scripts and applications, and because applications can be written in more than one language. (Mozilla uses four in the actual application and another three in the build system.)

    Similarly, the distinction between compiled languages and interpreted languages is blurred, because some languages are hybrids (VB5, Java if you will, ActionScript), and you can generally write interpreters for any language at all, and compilers for most, so the distinction is really one of available technology, not language.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  11. #11
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    http://en.wikipedia.org/wiki/Scripti...ge#Description

    However, the boundary between scripting languages and regular programming languages tends to be vague, and is blurring ever more with the emergence of new languages and integrations in this fast-changing area... in general, it is possible to write a script in any language (including C or assembly language). In most modern systems, the latter case is very seldom recommendable, since one or more suitable script languages is usually available.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  12. #12
    I am me, who else?
    Join Date
    Oct 2002
    Posts
    250
    I suppose I should retract my earlier less informed statement, wikipedia is much more knowledgable than I

  13. #13
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    It's accurate to consider "scripting" languages to be a category of programming language.

    Practically all programming languages (including Perl, Javascript, Java, et al) are compiled. They certainly don't reparse every line over and over again when traversing a while loop, do they? (No.) The only languages which could realistically be left uncompiled are esoteric ones like Brain........, which is essentially written by the programmer in compiled form.

    Quote Originally Posted by LuckY
    No, it actually is not. It is merely a set of Java instructions in binary form. Nothing is "effectively" machine code; either it is machine code or it is not, and Java's bytecode is not.
    There are microprocessors that directly understand Java bytecode.

  14. #14
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    when is Perl or JavaScript ever compiled?
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  15. #15
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    The Perl interpreter compiles Perl to bytecode it before it interprets. Then it takes that bytecode and builds the program's parse tree (because executing directly from bytecode would be slow), and then it executes.

    The meaning of the word 'compile' as generally defined doesn't imply machine code.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21