views:

313

answers:

8

Hi,

A project is looming whereby some code that I will be writing may be deployed on any hardware that potential clients happen to have. Its a business application that will be running 24/7 so I envisage that most of the host machines will be server type boxes but smaller clients might, for example, just have a simple PC.

A few more details about the code I will be writing:

  1. There will be no GUI.

  2. It will need to communicate with another bespoke 'black box' device over an Ethernet network.

  3. It will need to communicate with a MySQL database somewhere on the network.

  4. I don't have any performance concerns as a) the number of communications with the black box will be small, around 1 per second, and the amount of data exchanged will be tiny (around 1K each time), b) the number of read/writes with the database will be small, around 5 per minute, and again the amount of data exchanged will be tiny and c) the processing that needs to be performed is fairly simplistic.

  5. Nothing I'm doing is very 'close to the metal' so I don't want to use languages that are too low level. Ease of development and ease of deployment are my main priorities.

  6. I'm not expecting there to be a perfect solution so I can live with things like, for example, having to have slightly different configuration files for Windows machines than for Linux boxes etc. I would like to avoid having to compile the software for each host machine if possible though.

I would value your thoughts as to which development language you think is most suitable.

Cheers,

Jim

+1  A: 

I would say use C or C++. They are platform independant, though you will have to compile for each platform.

Or use Java. That runs in a Virtual Machine so is truely cross platform and not a slow level as C.

dean nolan
+1 Java. I have never used it, but this is what is was built for, right?
Assembler
Yeah. Java is a really powerful language and can run as fast as C in most cases. Still has a lot of problems but I don't think they would effect the OP. I also havn't wrote any Java for 2-3 years. I love .NET now :)
dean nolan
-1 for C/C++ (based on the OP's requirements) but +1 for Java so I guess that evens out to 0.
cletus
Yes, doing cross-platfor sockets programming in C or C++ is not a load of laughs.
anon
+10  A: 

I'd go with a decent scripting language such as Python, Perl or Ruby personally. All of those have decent library support, can communicate easily with both local and remote MySQL databases and are pretty platform independent.

workmad3
A: 

If all platforms are standard PCs (or at least run Linux), then Python should be considered. You can compile it yourself if no package exists for your version. Also, you can strip the standard library easily from things that aren't available and which you don't need (sound support, for example).

Python doesn't need lots of resources, it's easy to learn and read.

If you know Perl, you can try that. If you don't use Perl on a daily basis, then don't. The Perl syntax is hard to remember and after a week, you'll wonder what the code did, even if you wrote it yourself.

Aaron Digulla
Plus some great modules installed everywhere, batteries included.
MrHus
+4  A: 

The first thing we need to know is what language skills you already have? This is likely to be a fairly big determiner of what choice you would ideally make.

If I was doing this I'd suggest Java for a couple of reasons:

  1. It will run almost anywhere and meet the requirements you've outlined.
  2. Its not an esoteric language so there will be plenty of developers.
  3. I already know how to program in it!
  4. Probably the most extensive library ecosystem of any of the development platforms.

Also note that you could write it in another language on the JVM if your more comfortable with Ruby or Python.

BenM
+1  A: 

Perl may be of help to you as it is available for many platforms and you can get almost any functionality by simply installing modules from CPAN.

Alan Haggai Alavi
+2  A: 

Sounds like Perl or Python would fit the bill perfectly. Which one you choose would depend on the expertise of the people building and supporting the system.

anon
+2  A: 

On the subject of scripting languages versus Java, I have been disappointed with developing command line tools using Java. You can't directly execute them, you have to (1) compile them and (2) write a shell script to execute the jar file, this script may differ between platforms. I recommend Python because it runs anywhere and it's got a great SQL library, mysql-python. The library is ready to use on Windows and Linux. Python also has a lot less boilerplate, you'll write fewer lines of code to do the same thing.

EDIT: when I talked about JARs being executable or not, I was talking about whether they are directly executable be the OS. You can, of course, double click on them to run them if your file manager is set up to do so. But when you're in a terminal window and you want to run a java program, you have to "java -jar myapp.jar" instead of the usual "./myapp.jar". In Python one just runs "./myapp.py" and doesn't have to worry about compiling or class paths.

Dietrich Epp
Um, no you don't (need a batch file/script to run Java programs). You can package executable jars.
cletus
I would secind the Java suggestion.Other posters have suggested Python or Ruby etc. but support on non x86 platforms can be patchy -- you can get a version for most platforms but not neccesarily all the libraries you need.Also I would seriously consider sqlite rather than MySql if you want to really support any platform (sqlite platform suport can be summed up as "everything but nintendo DS"
James Anderson
But maybee he needs multi-user database access, in which case SQLite is not really a runner.
anon
Just a note you can make the Jar executable by including the Main-Class attribute with the class name in the jars manifest file. See http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Main%20Attributes for more info.
BenM
The MySQL db is going to be on a separate networked machine, so most likely multi-user and can be installed on an appropriate machine at the site.
workmad3
A: 

Python or Java. They both are easy to deploy on both the server environments and the desktop environments you mention - i.e., Linux/Solaris and Windows.

Perl is also a nice choice, but it depends on how well you know Perl, how well other people that will maintain your code know Perl, and number of desktop users that are savvy enough to handle an install of the Windows Perl version(s).

As Java supports Python via Jython, I'd go with a JVM requirement myself, but I'd personally go with a Java application all the way for such a system you describe.

JeeBee