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.
Take Google Chrome. It is a new web browser, and an excellent example of native multiplatform application and it's written in C++.
Of course, they have to "work out code issues for each target platform" as you said, but it certainly works!
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.
Rust should be in this list.
cargo new "my_first_rust_progam" --bin
cd my_first_rust_progam
cargo run
No really that's it. No pre-installation requisites for runtimes or frameworks for end users. It's really that simple. You just wrote and compiled a tiny "hello world" source to a native binary and executed it too.
There's nice Documentation at https://doc.rust-lang.org/ to get you started. Learn Rust today!
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With