You are not logged in.
Hello all!
I want to ask you ,a question.
Is there any platform independent programming laguage execpt Interpredet Luanguages , Java , D, JVM Based too (using JVM to run), and ASM ?
You know, I write code for example on Linux and move the code to Windows and it will work without integrating in the source code.
I don't mean languages like JS , or ECMA-Script.
Last edited by SpeedVin (2010-05-10 15:16:54)
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline
Sure, most high-level languages. C, C++, Python, Perl, Scheme, FORTRAN. Assembler (which is what I presume you mean by ASM) is not platform independent. Unless you're using a different definition of "platform" than I am.
Offline
Well, every langages are portable. Only the libs are not, so if you want to be portable, you should use
a portable library. For exemple using system call, like open, read, write on Linux is not advised, since
Windows use different system call
Offline
Which all translates to "Hello world!"
Happy hacking.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Assembly is the polar opposite of platform independent. In fact, on second look not a single one of the languages you mentioned are what I would describe as interpreted (the closest being Java).
As for the question, as far as I know you're not going to find compiled languages that are platform independent in the way you describe unless you count bytecode languages such Java.
Last edited by cmtptr (2010-05-07 23:03:48)
Offline
There are a number of languages that are cross platform. C, C++, and Fortran have been mentioned. Haskell and OCaml are too. If you write against cross platform GUI toolkits like wxwidgets, QT and GTK2, it will take you a long way.
Offline
Assembly is the polar opposite of platform independent. In fact, on second look not a single one of the languages you mentioned are what I would describe as interpreted (the closest being Java).
As for the question, as far as I know you're not going to find compiled languages that are platform independent in the way you describe unless you count bytecode languages such Java.
You are right
Can you say more about it?
(I mean ASM and platform independent).
Trent:
You mean that some other types of ASM have diffrent syntax?
Rip-Rip:
You are right and I want a language that will give me the same lib's on the same system's.
About the C/C++ I writted program that will won't work on Linux and will only work on Windows becouse in Windows you have some lib's that thanks to them the program can be compiled ,and if I want to run it on Linux I have to rewritte most of the code
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline
I don't know what you mean by "ASM". If by that you mean assembly language, then yes, there are many different assembly languages. I am distantly familiar with the assembly language of some obsolete 8-bit Atmel processor. Someone with more experience writing assembly for PCs can inform you more accurately than I can.
If you compiled a program on Windows that won't compile on Linux, that's probably because you used the Microsoft Visual C++ toolchain, which is not standards-conforming and provides extensions for which there is no Linux equivalent -- conio.h comes to mind, for which the curses library is a more portable replacement.
Offline
cmtptr wrote:Assembly is the polar opposite of platform independent. In fact, on second look not a single one of the languages you mentioned are what I would describe as interpreted (the closest being Java).
As for the question, as far as I know you're not going to find compiled languages that are platform independent in the way you describe unless you count bytecode languages such Java.You are right
Can you say more about it?
(I mean ASM and platform independent).
I'm not sure what more there is to say. The concept of platform independence is built on abstraction, and assembly (by definition!) is not abstracted at all. It's the most low-level, what-you-see-is-what-you-get language there is (I guess next to pen and paper assembling or punch cards?). As Trent has mentioned, the instruction set is different for every architecture. I personally have experience with 8051 and MIPS assembly, and I'm reasonably familiar with x86(_64) assembly; each one is noticeably different. Furthermore, aside from hardware architecture, the low-level system calls you'd make to the OS are not going to be the same between Windows and Linux.
If you want platform independence without compiling, you've really immediately narrowed your selection down to either scripted languages or interpreted languages.
And ignore what I said earlier about Java not being an interpreted language. That was me being dumb and mixing up words.
Last edited by cmtptr (2010-05-08 20:19:48)
Offline
If one stays within the standard, then all of the languages that I mentioned above are cross platform. The problem comes when people start using propriety off-shoots like Visual C++, which has deviated far from the standards. Yes, there are different underlining structures within each OS, but it's the compiler and cross platform library writer's job to abstract that away.
Offline
Isn't Haskell totally cross platform?
EDIT: Well, the question should be: Isn't the whole library cross platform?
About a GUI toolkit, I'm afraid Haskell isn't exceptional here. You'll have to use a cross-platform toolkit as mentioned before.
Last edited by SoleSoul (2010-05-08 17:40:58)
Offline
Isn't Haskell totally cross platform?
Yes. In fact, I read somewhere that Windows version of GHC runs perfectly under Wine. How fun is that?
Offline
Maybe I misunderstood the question. I thought he wanted platform independence without recompiling?
Offline
Maybe I misunderstood the question. I thought he wanted platform independence without recompiling?
Nah, SpeedVin is looking for code portability. English is not SpeedVin's first language, so there's a little bit of that going on.
Offline
Wow skottish thanks for this answer.
I'm sorry for my English ,and I am still learning.
BTW.Like skottish said I'm looking for code portabilty.
I will try Haskell.
But what do you think about Clojure?
Last edited by SpeedVin (2010-05-09 08:33:54)
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline
Clojure runs on the java virtual machine, according to your first post, it's not what you want
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Clojure runs on the java virtual machine, according to your first post, it's not what you want
But the code protability is great on it when I will have JRE installed...
I'm right?
Last edited by SpeedVin (2010-05-09 08:44:48)
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline
Yep, its also a kind of fun language (IMO)
Offline
Qt is one of your best options for cross-platform compatibility.
Offline
Okay thank you guys I think contest for the best code protable compiled language wins:
-Languages using JVM
-Haskell
-D
(Random order).
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline