views:

107

answers:

6

I'm frustrated to discover that Java lacks an acceptable solution for creating programs that will run via double-click. Other than .NET for Windows, what modern and high-level programming languages can I write code in that can be compiled for various platforms and run as a native/binary in each (Windows, Linux, OSX (optional))

Assuming I wanted to write code in python, for instance, is there a cohesive way that I could distribute my software which wouldn't require users to do anything special to get it to run? I want to write and distribute software for computer-illiterate and Java has turned out to be a real pain in this respect.

CLARIFICATION: When i say cross-platform I mean that there are ways I can compile my source code using different compilers for each target system. I don't need a compile-once solution... I just want a simple experience for users of the software even if I need to compile it and work out code issues for each target platform.

+3  A: 

C is the closest you're going to get.

The languages that provide for the best cross-platform execution are going to be those that do not run native code, like the Java platform and the .NET framework. You can also use an interpreted, rather than compiled, language.

I have been experimenting with Mono and C# with Winforms. It has proven to be a pretty good combination so far. In Windows, the executable can be run by double-clicking on the executable directly, or creating a shortcut for it that can be double-clicked. In Linux, the executable can be run from an icon that executes a small script, and the user experience is essentially the same.

I think you can expect a similar experience with Python.

Robert Harvey
A similar experience to mine with Java, or yours with C#?
JT
Mine with C#. The Mono folks created a library that is essentially compatible with Winforms, so anyone who has done that kind of programming before is quite at ease in Mono. But if you are comfortable with Java, there's no reason I can think of why you can't create programs that run directly from an icon on the desktop on either Linux or Windows.
Robert Harvey
A: 

I had a very good experience with Delphi from Borland compiled in windows, it was perfectly running using Wine, Delphi by default compiles all in one exe. Just avoid to use the Win32-voodoo library.

The other option to cross compile it's C\C++, eclipse and gcc, you can compile also architectures different by i386

Cesar
+2  A: 

If you're used to Delphi then Lazarus can provide a similar environment, yet allow cross-platform compilation. Unfortunately you can't just take your VCL components and drop them in, since those tend to be Windows-specific/-centric. Some providers of VCL components do also provide LCL versions though.

Ignacio Vazquez-Abrams
A: 

About your clarification what about:

C++

For instance, have you ever heard of Google Chrome? It is a new web browser, and an excellent example of native multiplatform application and it's written in C++.

They have to if "work out code issues for each target platform" but it certainly works!!!

OscarRyz
+1  A: 

It is possible and rather easy to 'compile' Java programs to different platforms. You could convert them to executable .jar files, or you could use a program such as JSmooth.

If you need to be able to compile it for different platforms, you could use an interpreted language like Perl and compile it to C code. Since C can be easily compiled on the target platform, the user does not need an interpreter.

Hawkcannon
A: 

As stated by others, your best bet for exacty what you are asking is C, it will compile on almost any platform, as its effectivly a "high-level assembler."

That said, to achieve the goal you want, a managed language is going to be your best bet. Something like Silverlight for Windows/OSX (and Moonlight for Mono on Linux) is going to be your best bet, additionally it will provide code-once deploy everywhere solution.

Adobe Flash/Flex/Air would be another option, which will give you compile once deploy anywhere, I know thats not what you asked for, but it is the closes to achieving the goal of a simple user expeirence.

Nate Bross