1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: What is an executable ?

Discussion in 'Software Development' started by chandhuonline, Sep 27, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. chandhuonline

    chandhuonline Thread Starter

    Joined:
    Sep 27, 2008
    Messages:
    5
    Hi all...
    What is an executable and how it works ?
    How i am able to run an executable compiled out of a C program with out installing C on my machine ? and why do i require .net framework to run a program compiled out of Visual Studio.
     
  2. Chicon

    Chicon

    Joined:
    Jul 29, 2004
    Messages:
    6,650
    Hi chandhuonline,

    Welcome to TSG ! :)

    An executable is simply a serie of commands for the processor. The coding language of processor instructions is called Assembly.
    When you run a program, the operating system (Windows, Linux, McOs, ...) will load the executable in the memory with the libraries needed by the program and then, it will launch the execution from there.
    Also, for security reasons, an operating system won't allow you to do anything. If you compile a C program with gcc on a Linux system, you won't be able to run its executable on a Windows machine. C like C++ is called a platform dependent language. To do so, you need to have Cygwin installed on the Windows system, Cygwin is simply a Linux environment designed for Windows.
    Programs written in C#, Java, VB need a specific runtime (respectively the .Net framework, the JRE, the VB runtime) which interprets the compiled coding and translates it into processor instructions.
     
  3. chandhuonline

    chandhuonline Thread Starter

    Joined:
    Sep 27, 2008
    Messages:
    5
    Thanks a lot..!

    Now more things to get clarified :)

    What is runtime and why is it actually needed ?

    On my windows machine i can directly execute .js or .vbs files (i.e without installing any external software), so does it mean that windows provides runtime for those scripts by default ?
     
  4. -Fabez-

    -Fabez-

    Joined:
    Jul 28, 2008
    Messages:
    1,899
    Runtime is either the time when a executable is running or something related to it running like a runtime library or runtime error. Windows provides runtime libraries for some interpreted languages as standard.
     
  5. mt2002

    mt2002

    Joined:
    Sep 14, 2005
    Messages:
    919
    All languages are compiled into a form of byte code (machine language) that can be executed by the processor. (Java is a little different here but the end result is still the same.) An "executable" is nothing more then the binary form of a program or part of a program that can be executed on a machine.

    A run time envirement is not needed in some languages. If the language itself is tied to an operating system it is. If the language is not tied to an operating system (ie, like C or C++), you can usually build with or without a runtime envirement. This is needed for embedded systems and systems without operating systems.

    Different programming language envirements handle things differently. Also, please dont confuse scripting languages with programming languages please! Scripting languages are quite different.

    Sort of. .vbs (Visual Basic Script) is handled by the Windows Script Host built into Windows. However, it can also be a compiled form. .js are usually javascript files if Im not mistaken...Perhaps someone can correct me here if I am wrong.
     
  6. chandhuonline

    chandhuonline Thread Starter

    Joined:
    Sep 27, 2008
    Messages:
    5
    yeah you are right .js are javascript/jscript files.

    So can you please help me in understanding the difference between scripting languages and languages like C,C++,C#..etc.
     
  7. DoubleHelix

    DoubleHelix Banned

    Joined:
    Dec 9, 2004
    Messages:
    24,388
    I think you need to study somewhere besides a tech support forum.:rolleyes:
     
  8. mt2002

    mt2002

    Joined:
    Sep 14, 2005
    Messages:
    919
    scripting languages are a form of data that are executed by programs. Because they are executed by the program and are independent of the program, they can be more higher level, easier to work with, and do not need to be compiled (Although some can be). An example scripting language that is very common (with applications and games) is lua.

    Programming languages are a specification (of sorts) that defines a form of data that are complied, interpreted, or assembled (in the case of assembly language) by a program and converted into a binary.This is the binary form of a program file. Normally these are C, C++, Java, C#, assembly, et al..

    Markup languages are similar to scripts but they are just data files that represent something. That is, they are not "executed" by anything but parsed. Examples include HTML, XML, etc. Alot of software tend to use xml for configuration information, for an example. All web sites use HTML, either natively are generated by scripts (JavaScript, PHP, ASP...) This is a perfect example of both scripting languages and markup languages.
     
  9. chandhuonline

    chandhuonline Thread Starter

    Joined:
    Sep 27, 2008
    Messages:
    5
    Thanks again.
    Can i have more clarity on "execution" and simply "parsing" ?
     
  10. peterh40

    peterh40

    Joined:
    Apr 15, 2007
    Messages:
    1,414
    First Name:
    Peter
    Program that is compiled is executed, it is already in 'machine code' so can be run straight away without any intermediate stages - no runtime required, no interpreter or anything.

    A parsed program has be read in, checked for syntax errors and each line converted to something that can be executed before it can be run. This has to be repeated every time the program is run. The advantage is that the program can be modified immediately and then tried out immediately, the disadvantage is that it takes longer to run the program.
     
  11. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/753721

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice