5

I have been discussing a project with a client and they want to use a single language to deploy to as many platforms as possible.

(I am not sure that it's such a good idea, because each platform offers a different user experience and UI metaphor. In some cases, screen sizes vary as well. Also, iPhone is out of the running no matter what language we use. But, I digress...)

The project is going to display an arbitrary block of text each day and will track if the user has "read" it. Some other features on the table are "nags" and the ability to go to another days' text.

I know Flash from the CS3 days, and I think that translates into AIR, but I dont know if AIR can do what we want.

On the other hand, I have (a) little experience with Java or Python, but those seem like good contenders also.

Which language should I use here? Why?

Edit:

This is going to run on desktop platforms too.

12 Answers 12

3

ActionScript 3 is the language. It runs on wide variety of platforms. In browser (flash player), on desktop (AIR), on mobile devices in browsers (Android) and also as native applications (Android and iOS both). Forget about flashlite.

| improve this answer | |
  • Can Flash interact with databases? – Moshe Oct 6 '10 at 13:35
  • Of course. You just need to use the flex framework which makes life more easier. That's all. – user4626 Oct 7 '10 at 3:32
  • Jase21 - can you provide some references for using flex and flash in tandem to work on database stuff? Also, will the db stuff work on iOS? – Moshe Oct 10 '10 at 20:40
  • Adobe is planning to release a server-side version of actionscipt. With that you can program both the client-side and server-side using actionscript. You can cross compile programs written in actionscript to native iOS application. If you are too hesitant to use actionscript then you can use open-web technology like javascript on (on client side as well as on the server side using node.js). – user4626 Oct 14 '10 at 3:52
  • Using Adobe AIR you can use SQLite also. – user4626 Oct 14 '10 at 3:53
17

These are languages that have a very good deployment factors:

Javascript.

Why? It runs on browser, and most platforms you'd care about have a browser. Though, some lower end mobile phones may have severely stripped browser (or Opera Mini, which supports Javascript only on the proxy-side, and very limited client-side Javascript).

JVM

Java Virtual Machine is ubiquitous in nearly every mobile phone, desktop, or server computer. All other things being equal, perhaps it's the best platform if you want easy portability. Nearly every mobile phone, old and new, supports JVM, the only major exception is iPhone.

Python

Python is very ubiquitous in Linux and Unix world; and the language has a very consistent behavior across different platforms, you almost need no additional work to write a cross-platform program in python. However, most Windows doesn't ship with Python by default, and most mobile phone doesn't support Python. OTOH Jython, compiles Python code to JVM; this combines the consistency and ease of use of Python with the ubiquity of JVM platform.

If you don't need to care about iPhone, then JVM development is the way to go. If you hate Java's language syntax, then Jython is a nicer alternative. If you need the most portability though, Javascript is probably the way to go; however writing anything in Javascript is painful.

| improve this answer | |
7

C

You can find a version of gcc for any platform you can dream of, from the tiniest microcontroller to the hugest supercomputer, and if you don't find one you can just build a toolchain of your own.

| improve this answer | |
  • You suggest to write a Windows, Linux, Android & iPhone application in pure C? – Tim Büthe Oct 14 '10 at 14:58
  • At least it is possible. – mouviciel Oct 14 '10 at 15:07
  • I didn't know C can handle GUI in a cross-platform way. If it can, then it would indeed be a great choice. – Dan Rosenstark Oct 26 '10 at 20:04
  • 1
    it will be a Herculean effort, as all the libraries will be different... – user1249 Apr 28 '11 at 20:10
  • 1
    @gbjbaanb. I suggest you try and report back. – user1249 Feb 26 '12 at 18:09
6

Free Pascal

Free Pascal (aka FPK Pascal) is an Open Source 32 and 64 bit professional Pascal compiler. It is available for different processors:

  • Intel x86
  • Amd64/x86_64
  • PowerPC
  • PowerPC64
  • Sparc
  • ARM

The following operating systems are currently supported:

  • Linux
  • FreeBSD
  • Haiku
  • Mac OS X/Darwin
  • DOS
  • Win32
  • Win64
  • WinCE
  • OS/2
  • Netware (libc and classic)
  • MorphOS

The discontinued 1.0 version also supports the Motorola 680x0.

Lazarus is an open source cross-platform IDE which provides a Delphi-mimic development experience for Pascal and Object Pascal developers. It is developed for and supported by the Free Pascal compiler. Lazarus is available for Microsoft Windows, several Linux distributions, FreeBSD, as well as Mac OS X.

Lazarus

| improve this answer | |
  • Or even... Delphi XE2! – Peter Turner Sep 16 '11 at 2:48
  • @Peter: Delphi XE2 uses the Free Pascal compiler to target iOS. So the actual Delphi compiler only added Win-64 and Mac OS X x86. – Jim McKeeth Sep 30 '11 at 15:58
5

With .NET, Mono, GTK#, MonoTouch and Mono for Android you can reach the large majority of platforms with any .NET language and have a native looking UI on each.

  • .NET will get you
    • ASP.NET for the Web
    • Silverlight for the Web on Windows and Mac (Moonlight from Mono gets you on Linux too!)
    • Silverlight for Windows Phone 7
  • Mono with GTK# will get you
    • Mac OSX
    • Linux
    • Others perhaps, but less native looking. I hear some have gotten on the Wii with Mono . . .
  • MonoTouch for the iPhone, iPad, etc.
  • MonoDroid for the Android
  • BlackBerry .NET - first I heard of it, but they say .NET on the BlackBerry, I am assuming with QT.

Can't think of any other major platforms you are missing there. You? Of course this points out frameworks that you can use to target all these platforms. I'll let you choose the language. C#, Oxygene or VB.NET are the most popular on .NET. Oxygene (included in Delphi Prism) has the added benefit of being partially compatible with Delphi native for native Windows development, but if you want to use IronRuby or F# we won't stop you.

| improve this answer | |
  • 2
    Didn't know about MonoDroid or BlackBerry .NET. Red Five Labs used to make a .NET runtime for Symbian called Net60, but they went out of business. Also, don't forget the .NET Compact Framework for Windows Mobile devices, the .NET Micro Framework for embedded devices, and XNA for Windows Phone 7, Xbox 360 and Zune. EDIT: Silverlight appears to be supported on Symbian S60v5 too. – Allon Guralnek Oct 7 '10 at 13:01
  • Ordinarily I would question the use of Mono, due to the fact that its not complete, but this project seems simple enough to put onto any of those platforms. – Morgan Herlocker Apr 28 '11 at 15:55
  • @Prof Plum: Mono is surprisingly complete and in wide spread use. It may not be 100% compatible with the latest .NET, but if you test against the compiler then you will know it works - only use the features that are supported in Mono, which is enough to get were you want to go. – Jim McKeeth Apr 28 '11 at 19:06
  • Don't forget about .NET's embedded profile, which runs on the Atmel-based Netduino. – greyfade Apr 28 '11 at 19:58
  • +1 MonoTouch appears to be the only crossplatform solution including iPhone today. – user1249 Apr 28 '11 at 20:09
4

You might want to take a look at http://www.phonegap.com/

The application you're detailing sounds very simple, and personally i'm not a fan of layers that sit above the native platform, however this may be perfect for you.

Edit: it seems like the nature of the question has changed somewhat.

| improve this answer | |
  • Why not a fan of layers? – Jé Queue Oct 5 '10 at 17:35
  • 1
    @Xepoch Completely missed your question, sorry about that. There are a few reasons tbh, and i'm sure not everyone will agree: When a vendor like Apple or Google push out large updates and new frameworks you're in a position to take advantage instantly. It's fair to say that the native platform is the most common; it makes fixing bugs easier, asking questions and onboarding new devs to a project. In my experience layers typically compromise the look, feel and experience in some way. Also, no guarantees that the company producing said API/layer will do so in future - and so on. – dannywartnaby Oct 7 '10 at 12:31
2

It sounds like this is for mobile platforms correct? In that case you're pretty much out of luck as there's no language to rule them all. There are products that will cross-compile a solution to another (such as http://www.xmlvm.org/android/) but apart from that you'll have to use the native language/environment.

| improve this answer | |
2

uhm, how about haXe? You can target a lot of platforms by now and should you learn OCaml you're free to write a new backend for whatever you fancy.

| improve this answer | |
2

I recently read how Netflix deploys to over 400 platforms using HTML5. It is definitely worth a read.

In general, I wouldn't try to commit to one language. At the company I work at we utilize various languages and technologies. It is about using the right language for the right job just like you use the right tool for the job. I wouldn't use a screw driver to hammer a nail just as I wouldn't use a hammer to change my car's lug nuts.

| improve this answer | |
1

LiveCode / Runtime Revolution

deploys on Mac, Windows and Linux and makes standalone software for all sorts of other platforms as well.

| improve this answer | |
1

With C# .NET you can deploy to any major mobile platform natively (big difference from HTML 5 platforms like PhoneGap which are basically hybrid web apps) utilizing Mono (for Android), MonoTouch (for Apple), and BlackBerry.NET.

The language and platform is well supported by MicroSoft with many employers looking for that skill set. If your not completely sold, just go to your favorite tech job website and start plugging in different languages/platforms in the search box. You will get an idea of which direction you want to take.

| improve this answer | |
0

Adobe Flash/Flex

(not sure if that was being ruled out in your question)

Runs in nearly all browsers, most mobile platforms and with AIR, most desktop platforms.

Read: http://business2press.com/2010/09/11/adobe-reversi-allows-developers-to-make-single-app-for-different-platforms/

Watch: http://www.youtube.com/watch?v=22vicDlzmkI&feature=player_embedded

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.