DonationCoder.com Forum

Other Software => Developer's Corner => Topic started by: Ron88888 on December 05, 2010, 11:51 AM

Title: How to program for all 3 platforms at once
Post by: Ron88888 on December 05, 2010, 11:51 AM
I want to write desktop software that works on all three platforms (Windows, Mac, Linux). What is the best/easiest way to do that?
Title: Re: How to program for all 3 platforms at once
Post by: 40hz on December 05, 2010, 12:35 PM
Easiest? Java.  :)
Title: Re: How to program for all 3 platforms at once
Post by: app103 on December 05, 2010, 12:46 PM
Easiest for me would be Lasarus/freepascal. But that would require you to have access to all 3 platforms for compiling & testing. (write once and compile for anywhere)
Title: Re: How to program for all 3 platforms at once
Post by: Ron88888 on December 05, 2010, 02:59 PM
Besides Java, how is it done in the real world? Is code written in C++ or C# for Windows, Objective C for Mac, and... I don't know what for (Li|U)nix? Sounds like a lot of extra work. How do people finesse it?
Title: Re: How to program for all 3 platforms at once
Post by: timns on December 05, 2010, 03:00 PM
I want to write desktop software that works on all three platforms (Windows, Mac, Linux). What is the best/easiest way to do that?

Java. For a lot of reasons: stable, well supported, and some wonderful IDEs available. And for just about anything you need to do, there's already probably a class that can get you there.
Title: Re: How to program for all 3 platforms at once
Post by: Ron88888 on December 05, 2010, 03:02 PM
Is it feasible to do this in Python or Ruby or some other scripting language? And, I'm guessing a core of code is written that can be easily carried over to another platform. True?
Title: Re: How to program for all 3 platforms at once
Post by: 40hz on December 05, 2010, 03:37 PM
Do what exactly? Certain tools are better for some things than others. What sort of project do you have in mind?
Title: Re: How to program for all 3 platforms at once
Post by: timns on December 05, 2010, 03:47 PM
Is it feasible to do this in Python or Ruby or some other scripting language? And, I'm guessing a core of code is written that can be easily carried over to another platform. True?

It's a bit too much of a nebulous question. It totally depends on what you want to do - if you want to knock up some little web app that runs in any platform's browser, then sure. But if you want to create a bit more of a full-on true desktop application, you're going to have to move away from scripting. Especially if you have any type of performance requirements.
Title: Re: How to program for all 3 platforms at once
Post by: Ron88888 on December 05, 2010, 04:11 PM
The application I have in mind will deal with a lot of XML, as in:

    * Create documents where the user's experience is as much like using a word processor as possible, but the user selects an xml tag/element, then types something in, then selects another tag, then types in some content, over and over;
    * the list of tags would appear in a pane, for selecting, generated from an xml schema (or other way of displaying the ontology);
    * displaying the document according to css would be nice;
    * facilitate uploading the resulting xml documents to a server;
    * and a way of "designing" xml tags, as needed in the moment, or as a major project.

Java may be a logical choice for this, but... I don't know Java.

And I've wondered about this topic in general, having most of my experience in web programming.
Title: Re: How to program for all 3 platforms at once
Post by: Deozaan on December 05, 2010, 04:34 PM
Isn't this the purported goal of Mono?
Title: Re: How to program for all 3 platforms at once
Post by: JavaJones on December 05, 2010, 05:39 PM
It sounds like one of the languages commonly used in web development (PHP, Python, etc.) would be appropriate for your needs, but note that this then requires either A: a web server to run the app installed on the user's system (you could bundle your own server if you want, but this would certainly need to be optional and lightweight) or B: running the app off a remote server that you host.

If you want something compiled natively for each platform, not running in a web browser, I think going the route of straight C/C++ and using a cross-platform UI library like Qt (http://qt.nokia.com/) might be best. It depends also on which languages you do already know...

- Oshyan
Title: Re: How to program for all 3 platforms at once
Post by: timns on December 05, 2010, 06:04 PM
Or why not use this as an opportunity to learn Java?  :Thmbsup:
Title: Re: How to program for all 3 platforms at once
Post by: Carol Haynes on December 05, 2010, 06:56 PM
Try www.realsoftware.com

Real Studio allows you to write one program and compile without modification for all three platforms.

It isn't free and you do need the Pro version to cross-compile for all three platforms. This means you can test applications on all three platforms but only compile and debug on the platform you purchased a license for.

The Enterprise version allows you install the complier on any of the three platforms with the same license code - and provided you stick to one license per user you can install it on as many machines as you want. This means you can cross compile and debug on any platform you choose.

There is also a web version (though it isn't final yet - but due for release any time now) which allows you to produce self contained compiled web applications. There are/will be restrictions on the PHP setup on the web server (requires FastCGI or sufficient rights to run applications on the server). Note this will be a standalone product but will be included with the Enterprise edition (and it supports iPhone and iPad).

There is a fairly active community and comprehensive documentation and third party books available. The compiler is updated regularly (usually 4+ times a year) on a subscription basis.

You can link it to various database engines, including MySQL.

Try out the 30 day trial - if you want to play more there is a cheaper personal edition (doesn't include all the database features and a few other bits are more limited).

Realsoftware also have an odd upgrade policy - basically if you buy a license for personal you can upgrade to pro or enterprise at any time. Upgrades extend your current subscription by 6 months. The cheapest way to get a long subscription on Pro or Enterprise is to buy as many years as you can afford on Personal and then upgrade - you get all your existing years plus six months with the upgrade which is much cheaper than renewing every year for the Enterprise package!
Title: Re: How to program for all 3 platforms at once
Post by: 40hz on December 05, 2010, 07:54 PM
@ Carol: RealStudio looks quite impressive. Reminds me of some other RAD platforms I've seen or used over the years.

Do you know how they handle redistribution of your developed applications? Do you need to purchase licenses or runtimes? Or is that covered when you purchase the Pro editions?

Title: Re: How to program for all 3 platforms at once
Post by: Carol Haynes on December 06, 2010, 10:09 AM
No - you can distribute applications without paying for licenses or runtimes. There are third party libraries available - not sure what the licensing is on them but on Real Basic the distribution is included with the license. Details on the website somewhere - try FAQs.
Title: Re: How to program for all 3 platforms at once
Post by: 40hz on December 06, 2010, 10:34 AM
@Carol: Thx. Found it. (They also respond to their email! :Thmbsup: How common a thing is that for a software company? Looking better and better already  8))
Title: Re: How to program for all 3 platforms at once
Post by: Carol Haynes on December 06, 2010, 04:57 PM
I haven't done a huge amount with RealBasic yet but I have plans. They are pretty responsive to emails and there are active support forums.
Title: Re: How to program for all 3 platforms at once
Post by: Ron88888 on December 06, 2010, 06:17 PM
Thanks everyone for your replies. Good stuff. Will look into it.

Does anyone have much experience with RealStudio?
Title: Re: How to program for all 3 platforms at once
Post by: 40hz on December 06, 2010, 07:20 PM
^ Just DL'ed the 30-day trial.

I'd be interested in hearing from anybody who uses it too.  :)
Title: Re: How to program for all 3 platforms at once
Post by: def on December 07, 2010, 01:50 PM
The most interesting RealBasic/Real Studio feature is IMHO that one can compile standalone executables without having access to the other platforms (especially the Mac since I don't have one).

Are there other compilers or IDE's with such a feature?
Title: Re: How to program for all 3 platforms at once
Post by: Ron88888 on December 07, 2010, 02:41 PM
I have zero experience with QT. This is what it says at their web site, qt.nokia.com

Write code once to target multiple platforms
Qt allows you to write advanced applications and UIs once, and deploy them across desktop and embedded operating systems without rewriting the source code saving time and development cost.
Title: Re: How to program for all 3 platforms at once
Post by: kyrathaba on December 13, 2010, 07:38 PM
Hmm, I have some background with QuickBASIC, so I think I could pick up RealBASIC pretty easily.  Especially now that I have some OOP background with C#.  I'm just wondering if the cost would be worth it, to me personally.  It looks like you have to get at least the "Pro" version in order to be able to deploy to all three major platforms.  Not sure I want to layout the cash right now.  Carol, I'd be interested in hearing your impressions if you do pursue this avenue of development.
Title: Re: How to program for all 3 platforms at once
Post by: Carol Haynes on December 14, 2010, 03:00 AM
I have a copy of RB and have some plans. My biggest problem is finding the time. I've been really busy with work over the last few months and I have other things I have to do before I start spending time on RB. Bit of a catch 22 situation.
Title: Re: How to program for all 3 platforms at once
Post by: Deozaan on December 14, 2010, 04:40 AM
Another way to program for all 3 platforms at once is to use something like Adobe AIR, Flash, or javascript (web app that works offline).
Title: Re: How to program for all 3 platforms at once
Post by: kyrathaba on December 14, 2010, 09:35 AM
I've heard Adobe AIR mentioned a lot lately.  What code does it use?  Java?
Title: Re: How to program for all 3 platforms at once
Post by: Renegade on December 14, 2010, 07:18 PM
Isn't this the purported goal of Mono?

This is the route that I'm going. But Java and RealBasic are also viable.

Some people are using Python for desktop software. Seen some and it looks ok.

I think the component market is one of the most important though. I'd rather buy functionality that performs better than I could do from experts in the field than fart around trying to half-ass it. C# and Java have good component markets, but I really don't know how the Java desktop component market is. Anyone know?
Title: Re: How to program for all 3 platforms at once
Post by: def on December 16, 2010, 02:14 PM
I've heard Adobe AIR mentioned a lot lately.  What code does it use?  Java?

As far as I can tell, AIR supports different technologies, so the developer can use the one that he is most familar with:

Title: Re: How to program for all 3 platforms at once
Post by: CodeTRUCKER on January 03, 2011, 05:48 PM
^ Just DL'ed the 30-day trial.

I'd be interested in hearing from anybody who uses it too.  :)

I downloaded too.  Looks pretty interesting, since I have a soft spot in my head, er, heart for Beginner's All-purpose Symbolic Instruction Code.  :-*

I am glad they have a 90-day money back policy.  :deal:  

It is also fairly expensive, (https://www.donationcoder.com/forum/esmileys/gen3/1Small/char042.gif), but one of the customers by the name of Jeff Ayling said, ""Love you guys - what a product! Your hard work now feeds my family!"

@Carol, please keep me in your loop.  I would be specifically interested in how it compares to VB, if you can comment. - Thanks.
Title: Re: How to program for all 3 platforms at once
Post by: kyrathaba on January 03, 2011, 06:11 PM
CodeTRUCKER, I'm interested in your experience.  Please report after you've fooled with it awhile :)  Also, I still think with your background in BASIC, the ideal next language for you would be Visual Basic .NET (freely available here (http://www.microsoft.com/express/Downloads/#2010-Visual-Basic)).  You can do 99.9% of anything you can envision, programming-task-wise, perhaps with the exception of very intensive graphics programming (although .NET languages are supporting OpenGL and DirectX) and writing very low-level routines.

Title: Re: How to program for all 3 platforms at once
Post by: steeladept on January 03, 2011, 06:13 PM
I think the component market is one of the most important though. I'd rather buy functionality that performs better than I could do from experts in the field than fart around trying to half-ass it. C# and Java have good component markets, but I really don't know how the Java desktop component market is. Anyone know?
I know that it exists, and that is kind of saying something since I am not a programmer - well not really anyway  ;).  I can't talk to the quality of it, however.  I have a few vendors that send me info on it at work because they know my company is a Java shop and they send their advertising to anyone who has an email in that domain.  It is annoying because I don't know how they got my email - my guess is I downloaded a white-paper or something - but they do stop when I send the request to stop, so I can't complain too much.  I just wish companies would stop advertising these white-papers that are just advertisements themselves, then force you to register just to find out that it is an advertisement.  I have stopped getting any white-papers I need to register for because of that. >:(
Title: Re: How to program for all 3 platforms at once
Post by: Renegade on January 03, 2011, 07:19 PM
CodeTRUCKER, I'm interested in your experience.  Please report after you've fooled with it awhile :)  Also, I still think with your background in BASIC, the ideal next language for you would be Visual Basic .NET (freely available here (http://www.microsoft.com/express/Downloads/#2010-Visual-Basic)).  You can do 99.9% of anything you can envision, programming-task-wise, perhaps with the exception of very intensive graphics programming (although .NET languages are supporting OpenGL and DirectX) and writing very low-level routines.

+1 for VB.NET. It's quite nice to use.

Quite right about the low-level stuff. You simply can't do it in VB.NET. No pointers. C# is a better choice because it is possible, but depending on the application, plain C or ASM or something would be better.

VB.NET is a very forgiving language as well. If you're coming from Pascal-based languages, it will look somewhat familiar. (In the way that C# is 'familiar' for Java developers.)


Title: Re: How to program for all 3 platforms at once
Post by: kyrathaba on January 03, 2011, 07:52 PM
And... there is plenty of helpful material out there for learning, both in books and in free online material.
Title: Re: How to program for all 3 platforms at once
Post by: Ron88888 on January 03, 2011, 09:05 PM
Interesting page at lifehacker.com:
http://lifehacker.com/5719091/hackety-hack-teaches-ruby-programming-to-aspiring-beginners-for-free

Windows and Mac OS X: Hackety Hack is an application designed to teach complete beginners how to program in Ruby, eventually giving you the ability to create actual applications for the desktop and the web.
The Hackety Hack project also makes use of a GUI toolkit called Shoes, which lets you create desktop applications.
Hackety Hack will walk you through Ruby basics and have you creating simple apps quickly. The Shoes toolkit isn't just for making simple apps. Once you learn the basics that Hackety Hack will teach you, then you can start creating more complex apps (like Hackety Hack itself). If you're looking to get into programming and want to deploy cross-platform apps, Hackety Hack looks like a great way to get started. It's also free, open source software, so you can mess around with the source code should you feel so inclined.

In the comments, someone says:
Note: it does have experimental Linux support.
Title: Re: How to program for all 3 platforms at once
Post by: mahesh2k on January 06, 2011, 01:07 AM
Some better options than java-

BASIC  - Mono.net (Visualbasic.net), Gambas, Borlands basic(don't know where they are now)

Python - Ironpython(which works on all platforms with .NET framework)

C# - using mono

Wxwidgets is also used by some people to code cross-platform but learning curve is steep. QT has some license issues for commercial apps so no point in investing time with them.

Edit - ron, tested ruby shoes it's small GUI tookit and there isn't much in it. But for web based desktop apps can still be coded with it.
Title: Re: How to program for all 3 platforms at once
Post by: Renegade on January 06, 2011, 01:12 AM
Some better options than java-

BASIC  - Mono.net (Visualbasic.net), Gambas, Borlands basic(don't know where they are now)

Python - Ironpython(which works on all platforms with .NET framework)

C# - using mono

Wxwidgets is also used by some people to code cross-platform but learning curve is steep. QT has some license issues for commercial apps so no point in investing time with them.

Edit - ron, tested ruby shoes it's small GUI tookit and there isn't much in it. But for web based desktop apps can still be coded with it.

QT allows licensing as LGPL, which is fine for commercial development.
Title: Re: How to program for all 3 platforms at once
Post by: mahesh2k on January 06, 2011, 01:21 AM
QT allows licensing as LGPL, which is fine for commercial development.

Does LGPL allows developers to restrict source-code distribution ? Sorry, i'm not much aware of it's legal sides.
Title: Re: How to program for all 3 platforms at once
Post by: mwb1100 on January 06, 2011, 01:57 AM
QT allows licensing as LGPL, which is fine for commercial development.

Does LGPL allows developers to restrict source-code distribution ? Sorry, i'm not much aware of it's legal sides.

LGPL allows you to release your program without having to distribute *your* source code.  However, you have to provide the source code for the LGPL bits (ie., the Qt library).  You also have to enable/allow people to modify, rebuild and relink the LGPL bits into the program.  Practically speaking, this means that you have to link to the LGPL stuff dynamically (using a DLL on Windows, or a shared library on Linux).  That way, end users could rebuild Qt and replace the DLL if they're so inclined.
Title: Re: How to program for all 3 platforms at once
Post by: Jibz on January 06, 2011, 03:04 AM
Just to add to the discussion:

http://blog.kowalczyk.info/article/Which-technology-for-writing-desktop-software.html
Title: Re: How to program for all 3 platforms at once
Post by: CodeTRUCKER on January 06, 2011, 04:41 PM
And here's another...

http://www.runrev.com (http://www.runrev.com)

... and a little information (https://www.donationcoder.com/forum/index.php?topic=25128.msg230210#msg230210) in another post.