I didn't really know where to post this but I think this is probably the best place.
So my question is:
What programming languages are 'platform independent' (don't rely on a certain OS)?
I know Java is one.
Thanks,
JD.
Platform Independent Programming Languages
Page 1 of 110 Replies - 5764 Views - Last Post: 27 October 2010 - 09:26 AM
Replies To: Platform Independent Programming Languages
#2
Re: Platform Independent Programming Languages
Posted 26 October 2010 - 09:20 AM
Actually, almost any language can be platform independent. It's the distributable code that usually isn't. Java code runs in a JVM. The JVM is platform specific, but theoretically Java programs will run on a JVM regardless of what OS it's installed on.
Basically, any interpreted language should run on a system the successfully implements the interpretor. No one is 100% successful at this, however; no even Java.
An executable is compiled for a specific OS. However, the source code can be completely portable. There are thousands of C and C++ programs that are said to be "cross platform" meaning they can be successfully compiled on different platforms without much pain.
e.g Firefox runs one Windows, Mac, and Linux. The code base is mostly the same, but certain modules are tweaked to allow for different architectures.
Basically, any interpreted language should run on a system the successfully implements the interpretor. No one is 100% successful at this, however; no even Java.
An executable is compiled for a specific OS. However, the source code can be completely portable. There are thousands of C and C++ programs that are said to be "cross platform" meaning they can be successfully compiled on different platforms without much pain.
e.g Firefox runs one Windows, Mac, and Linux. The code base is mostly the same, but certain modules are tweaked to allow for different architectures.
#3
Re: Platform Independent Programming Languages
Posted 26 October 2010 - 10:58 AM
I like this.
So the interpreter is the key to this really?
Cool.
So potentially, any language could work on any platform??
EDIT: I suppose that's a stupid question. Any language can work on any platform that successfully implements the interpreter.
So I guess my real question is, which languages work cross-platform without you having to do anything extra?
So the interpreter is the key to this really?
Cool.
So potentially, any language could work on any platform??
EDIT: I suppose that's a stupid question. Any language can work on any platform that successfully implements the interpreter.
So I guess my real question is, which languages work cross-platform without you having to do anything extra?
This post has been edited by JoshD: 26 October 2010 - 11:01 AM
#4
Re: Platform Independent Programming Languages
Posted 26 October 2010 - 11:07 AM
Quote
So the intrepetor is the key to this really?
Quote
So potentially, any language could work on any platform??
Quote
So I guess my real question is, which languages work cross-platform without you having to do anything extra?
To which the answer would be: C, C++, C#, Java, Python, Ruby, etc.
#5
Re: Platform Independent Programming Languages
Posted 26 October 2010 - 11:44 AM
JoshD, on 26 October 2010 - 11:58 AM, said:
So the interpreter is the key to this really?
To clarify, not all languages use an interpreter.
A computer program, any program, executes within the context of some machine. The machine itself; CPU, memory, graphics card, etc, has a set of instructions it will run. These instructions are called machine code.
Some, formerly most, programming languages are compiled into machine code. This results in a executable binary that runs directly against the machine itself. The result may be called compiled code and getting from source to binary is called compiling. Though sometimes as distinction is made between compiling and linking.
Java calls the process of going from source files (.java) to .class files compiling. However, the result can't run on it's own. The result is a preprocessed set of instructions ( p-code ) that the JVM ( interpretor ) runs. JVM stands for Java "Virtual Machine,", the idea being that .class files are machine code inside the the VM. It's a cute, if confusing, way for Java to obfuscate it's interpreted nature.
Because of the need for a middleman, the interpretor, interpreted languages are generally views as slower than their directly executable counter parts. However, the line can be blurry, depending how where the interpreting is happening. In some environments, the Operating System itself acts an interpretor for nearly everything executed.
A "scripting" language is usually interpreted, with an executable program reading the script and executing the instructions.
#6
Re: Platform Independent Programming Languages
Posted 26 October 2010 - 12:38 PM
Oler1s, on 26 October 2010 - 10:07 AM, said:
Quote
So I guess my real question is, which languages work cross-platform without you having to do anything extra?
To which the answer would be: C, C++, C#, Java, Python, Ruby, etc.
That is the question I was trying to ask, thank you!!
@baavgai - I had a basic understanding of that from my Computing A Level, however you have really explained it a lot better than my teacher did, and gone into greater depth! Thank you. =)
#7
Re: Platform Independent Programming Languages
Posted 26 October 2010 - 09:21 PM
#8
Re: Platform Independent Programming Languages
Posted 27 October 2010 - 04:45 AM
Which part?
Java "write once run anywhere" dream falters in the real world, particularly on the desktop. There's a reason Java enjoys its greatest popularity in the middle tier, where UI doesn't come into play.
The interpreter any computer user is most familiar with, you're using it right now, is the web browser. At a bare minimum, a browser must read HTML markup and render it. CSS is another layer. To even be considered viable, though, it must also contain a Javascript interpreter as well.
Even the same version of a given browser rarely renders identically on different OS platforms, even with everything else ( resolutions, hardware, etc ) being equal. The OS ultimately controls the UI and everyone does it a little different.
Java "write once run anywhere" dream falters in the real world, particularly on the desktop. There's a reason Java enjoys its greatest popularity in the middle tier, where UI doesn't come into play.
The interpreter any computer user is most familiar with, you're using it right now, is the web browser. At a bare minimum, a browser must read HTML markup and render it. CSS is another layer. To even be considered viable, though, it must also contain a Javascript interpreter as well.
Even the same version of a given browser rarely renders identically on different OS platforms, even with everything else ( resolutions, hardware, etc ) being equal. The OS ultimately controls the UI and everyone does it a little different.
#9
Re: Platform Independent Programming Languages
Posted 27 October 2010 - 08:10 AM
baavgai, on 27 October 2010 - 01:45 PM, said:
Which part?
Java "write once run anywhere" dream falters in the real world, particularly on the desktop. There's a reason Java enjoys its greatest popularity in the middle tier, where UI doesn't come into play.
The interpreter any computer user is most familiar with, you're using it right now, is the web browser. At a bare minimum, a browser must read HTML markup and render it. CSS is another layer. To even be considered viable, though, it must also contain a Javascript interpreter as well.
Even the same version of a given browser rarely renders identically on different OS platforms, even with everything else ( resolutions, hardware, etc ) being equal. The OS ultimately controls the UI and everyone does it a little different.
Java "write once run anywhere" dream falters in the real world, particularly on the desktop. There's a reason Java enjoys its greatest popularity in the middle tier, where UI doesn't come into play.
The interpreter any computer user is most familiar with, you're using it right now, is the web browser. At a bare minimum, a browser must read HTML markup and render it. CSS is another layer. To even be considered viable, though, it must also contain a Javascript interpreter as well.
Even the same version of a given browser rarely renders identically on different OS platforms, even with everything else ( resolutions, hardware, etc ) being equal. The OS ultimately controls the UI and everyone does it a little different.
Ah I see, so what you meant to say is that there are subtle differences when a language is run on different platforms. I misunderstood what you said earlier.
#10
Re: Platform Independent Programming Languages
Posted 27 October 2010 - 08:55 AM
Sometimes not subtle, but trivial. I once deployed a Java GUI application to several different terminals. On some versions of Windows, the tab key didn't work. The basic functionality was there, but users can get cranky.
#11
Re: Platform Independent Programming Languages
Posted 27 October 2010 - 09:26 AM
yea yea, I got your point and I agree, I just misunderstood what you said earlier. I thought that you meant that some platform independent languages don't work on some platforms that implement the interpreter, which doesnt make sense
.
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote






|