• 0

Cross Platform Programming


Question

I'm needing to write a program that reads an XML file as input and outputs another modified XML file.

I'm needing it to run in Linux (XFree) and Windows. What programming language should I write this in? I don't really like Java, but I like how cross platform it is. I would be willing to maintain some different sets of code for the Linux portion and the Windows portion, but would like to keep that to a minimal. I would really like my program to use the standard Window API for either system, (probably KDE or GNOME for X as they are the most supported throughout any windows manager).

Any recommendations?

-nic

Link to comment
Share on other sites

Recommended Posts

  • 0

I'd say go the GTK route. It's available on both windows and linux (and I'm sure it'll work on other unicies). The KDE route won't work with windows unless you're willing to dish out some cash for QT from windows. This is of course if you're going with C/C++. Another language you could use is Tcl/Tk. But this is scripted.

Link to comment
Share on other sites

  • 0

I"m not much of a programmer, but I am interested in making programs work on both Windows and Linux. I read somewhere that you could use Delphi and compile it for both OS's. I have never done this yet, but I think you need to get something like Borland Kylix to do it.

Link to comment
Share on other sites

  • 0

I thought abut GTK and I will most likely go that route. One thing about GTK is I don't think it uses the operating systems API, but uses its own set for any OS. This isn't too big of a deal given the scope of the project I'm working on, and it is certainly an advantage to not have to maintain 2 sets of code. I'm comfortable w/ using C/C++.

Thanks for the input!

-nic

Link to comment
Share on other sites

  • 0
I"m not much of a programmer, but I am interested in making programs work on both Windows and Linux. I read somewhere that you could use Delphi and compile it for both OS's. I have never done this yet, but I think you need to get something like Borland Kylix to do it.

You are right,

you will need Borlan Kylix for Linux and Borland Delphi for Windows

the code from Delphi will be compatible with Kylix - as long as you use the Kylix VCL

I think you can download working trial version from borland

Link to comment
Share on other sites

  • 0

What wrong with Java.

I hate to tell you this, but java is your ideal solution. In fact java has api's out that can edit, create and modify xml files. This will allow you to work on what your program has to do and not work out how to read and write an xml file.

Why do you want to re-invent the wheel??????????

Java is of course cross platform and thus you will only need to code once for both platform.

Link to comment
Share on other sites

  • 0

Java is painfully slow IMO. Also, you can't always count on what Java Interpretter a person has installed. And Java apps look like poop.

Like Andareed said, there is an XML toolkit for C/C++, as there is now an XML toolkit for just about every other programming language.

Still, thanks for the input.

Link to comment
Share on other sites

  • 0

Regarding Java: Java can be fairly quick if you're using a runtime with a just-in-time compiler (this should be 'binary translator'). I believe the normal sun java has JIT enabled by default. Granted, it's not gonna be as fast as C/C++, but it's good enough for most applications.

Link to comment
Share on other sites

  • 0

Hate to break it to you, but java really is the perfect solution. It's easy to use, cross platform, and has XML parsing classes already. The fact that java is slightly slower than a natively compiled C application is irrelevant 99% of the time.

I've been programming for 12 years now, and I prefer to use C or C++ in any application I use. If I were in your shoes though, I would definitely use java for the project you are describing.

Link to comment
Share on other sites

  • 0
Also, you can't always count on what Java Interpretter a person has installed. And Java apps look like poop.

Like Andareed said, there is an XML toolkit for C/C++, as there is now an XML toolkit for just about every other programming language.

Still, thanks for the input.

Java is painfully slow IMO.

I disagree, Java is slower than compiled languages, but it is not "painfully slow"

and has been highly optimised for speed in the last few years.

you can't always count on what Java Interpretter a person has installed

true, but you can check the version running. just like you can check if win98 or xp is running. -since this a simple XML exercise, I dont seen any major problems a different JVM version would cause.

And Java apps look like poop.

all in the eye of the beholder. - BTW havent you heard of SWT - a set of API's that create java apps that look like windows applications

Link to comment
Share on other sites

  • 0
You are doing stuff with XML? Sorry to break it to you, the best one in this case is going to be PERL. It is completely cross platform, and will be by far the easiest to code in.

But you need a webserver. and perl is a scripting language, not a programming language

You are right though, a non programming language solution that is cross platform would be to run a service on a webserver - assuming the user has access to the service over internet/lan.

Link to comment
Share on other sites

  • 0
You don't need a web server to run perl.

Ok. Don't know anything about perl except it is used used for web based script programming.

How do you run Perl applications? are they exe files or scripts that run under a VM?

Link to comment
Share on other sites

  • 0
Ok. Don't know anything about perl except it is used used for web based script programming.

How do you run Perl applications? are they exe files or scripts that run under a VM?

You use the perl interpreter to run them (i.e. perl yourscript.pl or perl.exe yourscript.pl).

Link to comment
Share on other sites

  • 0

Thanks for all the discussion. It is all really helpful. Maybe I will just go w/ Java, considering I already know how to work in it (although I'll have to crack open some of my old books to refresh myself). You guys seem pretty sure that this is what I'm needing to go w/. PERL would make things easy for me, but I'm not sure you can get any sort of GUI out of it.

So I guess I basically need to make some sort of decision based on these three that you all have proposed:

1. wxWindows (or wx.net w/ C#) - can be compiled for multiple platforms and is good at using the OS's API.

2. Java - Really strong XML support (apparently), a long time proven cross-platform solution.

3. GTK - Lots of good free development tools available. Uses its own API in whatever OS you are in.

I'm wanting to keep things free. What is a good free Java IDE? I always need help when building the GUI.

Thanks again!

-nic

[edit] Ohhh...something else I thought I might add to get more input. The application will need to get information from a database server to perform (it is a MySQL server). I know how to use the MyODBC driver, but I'm not sure about the JDBC driver for Java. I'm considering just writting the database connectivity in the form of a SOAP service, that would make more sense given the nature of the project. Gee, there are so many ways of doing the same thing.

[/edit]

Link to comment
Share on other sites

  • 0
Why reinvent the whell - hell why even use a wheel! Just use an XSL Transformation with a program that will apply a given XSL to a given XML file, for example use MSXSL.

The nature of the program is not to convert the given XML file in a given schema to another format.

A little background...

This is going to be used for testing information regarding material flammability in oxygen enriched systems. There are a handful of standard (ISO) tests that are run on a given material and we are setting up a database to collect this information (http://office.wendellhull.com/matdb). So I'm in the processes of making tools to report the data via XML. I'm choosing XML as our data packaging format because so many programs are XML friendly these days and it is an increasing number. The idea being, someone can write a report in Word (it would have to be 2003) or OpenOffice writer and within their report link to our XML Schema when they are listing a table w/ testing information.

The pitfall is that there can be some variation in the spellings of a material, and some variations of how the material is reported. They could be reporting on a specific trade name, a generic name, they may just be identifying a classification (elastomer, polymer, ect.), and basically we need a way of "spell checking" all their material entries against our listings in our MySQL database.

So I'm going to make this application that will refine their XML by suggesting spelling corrections, and linking a Material they report on with the Material_ID we have in our database.

Here is an image of the program I wrote within Excel 2003 as an Excel 5 dialog box. I wrote this up because we needed this functionality immediatly. But now I'm wanting to abstract the idea to be more universal and cross-platform. I would also like to apply the soundex algorithm to my program. Currently I'm just doing character matching.

trade_name_dialog.png

We are offering all of this as free. I'm hoping to also open source all the code I write for the project.

Thanks for your input guys! I'll let you know where I end up on this.

-nic

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.