views:

296

answers:

11

Hello,

I was searching a bit for another platform independent language like Java.
Are there other P.I. languages?

Thanks

+1  A: 

Ruby, Lisp, Scheme, Scala, Clojure, Python, Perl, PHP, C# (via Mono)...

Honestly, the list could keep growing. It's much easier to narrow down your definition of platform independent or ask which languages ARE platform dependent.

Justin Niessner
+1  A: 

It might be easier to list platform-dependent languages.

Marcelo Cantos
+4  A: 

Depends on what you mean with platform independent:

  • compileable on any platform with the same sourcecode: Almost any language
  • Copy on a different platform and run immedatly: Any Scripting Language and Java and .NET for platforms which have the framework (JRE and .NET/mono).
dbemerlin
+2  A: 

Perl, php, scheme, lisp, LOLCODE. Most interpreted languages really.

klausbyskov
+1  A: 

Java is platform independent because it runs on the Java Virtual Machine (jvm). There are other languages that run on jvm, all of them are of course also PI. Scala is an example.

brydgesk
A: 

Nearly every language is somehow platform independent, thanks to the vendors or the community.

C/C++ (Boost, QT, etc.), C#/Java, Vala, Python/Ruby/Perl, PHP etc. etc., all these languages are platform independent, the only difference is that some are recompiled to the according platform, some are running on top of a framework and the others are interpreted languages.

Bobby
+1  A: 

There are a lot of p.i. languages. What do you want to achieve? Just want to learn another language? Or do you have a specific project in mind?

Some examples:
C/C++, C#, Java, Ruby, Python, Perl, PHP, Scheme, Lisp

Some useful links:
http://en.wikipedia.org/wiki/Lists_of_programming_languages
http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(basic_instructions)
http://en.wikipedia.org/wiki/Comparison_of_programming_languages

fgysin
A: 

Pretty much any language can be P.I. if someone writes a layer for it to run on which abstracts the underlying hardware.

By contrast, every platform requires someone to write such a layer before the 'PI' language can run on it.

John
+5  A: 

Platform independent isn't a perfectly well defined term. It can mean different things to different people. For example, some people have said that C is PI, others would say it isn't. Sometimes, people go to a lot of trouble to make C code work with configure(1) so that it can compile on lots of different platforms. Does that mean that one can write platform-independent-C, but not all C is platform independent?

Perhaps Java (+other software that runs on JVM) is considered PI because they define a platform, and it's up to different machines to implement that platform. But they don't always do it properly - for example, some JVMs (particularly early ones) have bugs that others (on other platforms) don't. And of course you can write non-pure java that links to native code - certainly not platform independent.

Several answers have suggested that scripting languages are platform independent. Tell that to people who write javascript and want it to work on IE6, IE7, FF, Chrome, Safari, etc!

So it's really up to you to say more about what you mean by "Platform Independent", or why you're asking.

John
+1  A: 

If you mean compilers to platform-independant code (like Java VM for Java language) you can look for CIL/MSIL (for C# and other .Net-based) and LLVM (low-level virtual machine, I guess its possible to find compilers for C and Haskell).

ony
+1  A: 

My suggestion is Scala. You can use all Java APIs on the JVM and you have a more concise, more powerful and cleaner language.

deamon