Slashdot Mirror


Competitive Cross-Platform Development?

Avalonia asks: "I work for a software company in the oil and gas exploration industry with a software development team of seven. Our software and development environment is cross-platform on Solaris, Irix, Linux and Windows. Most of our customers are on Solaris and Irix 64-bit systems, but Linux and Windows are increasingly important. Our environment is based around an elaborate command-line system of Makefiles controlling four different compilers (gcc 3.1, Sun Forte, Irix MIPSpro and Visual C++ 7). Needless to say, maintaining this system and producing modern multi-threaded C++ that will go through the four build systems is time-consuming in the extreme. A large proportion of our time is spent finding C++ code that just works rather than being creative and competitive with new functionality. What tools and strategies can we use to increase our productivity and regain our competitive advantage, without going for Windows only?"

"Our recent single-platform competitors (Windows only) can seriously outrun us in terms of productivity by using a single modern IDE development environment - such as C++ builder or Visual Studio - although we can scale onto larger multiprocessor Unix systems. With Windows 64-bit imminent we may lose our 'big-iron' scalability advantage. Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications."

22 of 410 comments (clear)

  1. Might I suggest... by XaXXon · · Score: 1, Insightful

    Perl? :)

    Platform independent, it's highly creative, and damn if you can't prototype stuff quickly.

    1. Re:Might I suggest... by akookieone · · Score: 5, Insightful

      Are you kidding me? They are building a real application that performs and does multi-threaded as only C++ can do. If you can't use java, what makes you think that perl, especially interpretted, would do the trick? Yeah, fine for prototyping, but how is this going to help?

    2. Re:Might I suggest... by bomb_number_20 · · Score: 2, Insightful

      I think the parent is a joke, but:

      if all you have is a hammer, eventually everything begins to look like a nail.

      --
      That's ok, Jesus likes me anyway.
    3. Re:Might I suggest... by kryonD · · Score: 1, Insightful

      Take it even a step further. Web base everything and ensure that your cgi cripts only produce HTML 1.0 compliant pages. You can of course go higher than 1.0, but then you start to get into the "What browsers do I support?" question.

      Your code could indeed be written in perl, although I would recommend ANSI C or C++ for two reasons. #1 You are already familiar with the language and compilers. #2 You probably deal with large variable quantities of data that are processor intensive and would suffer from "script" style languages.

      The beauty of this is you can now switch to only one compiler since the applications are only running on the web server. My programming shop is responsible for producing software that tracks and manages supply and maintenance in the Western Pacific for the Marine Corps. You may not have alot of customers who are running your software from a tent in the middle of BFE over an 8KBit pipe. But I'm sure web basing will still reduce the number of customer support issues that involve you going to the machine the software is installed on to see what the customer is talking about when he says, "I'm getting this strange error."

      It worked wonders for our shop of 5 programmers

      --
      I've dirtied my hands writing poetry, for the sake of seduction; that is, for the sake of a useful cause. --Dostoevsky
    4. Re:Might I suggest... by jericho4.0 · · Score: 3, Insightful
      hahahaha, you got modded troll.

      I would sugest the same thing though. Write your whole app in Python. That's your base. Port each function that needs to be ported to C++. At the end you'll have something much more maintainable.

      --
      "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
  2. try by BigChigger · · Score: 3, Insightful

    www.eclipse.org

    I think it runs on several of the environments you mention. And I think there are C++ plugins for it.

    BC

  3. gcc cross platform? by SirSlud · · Score: 5, Insightful

    why all the different compilers?

    Hrm, this seems too simple an answer, there must be something wrong with it .. but can't gcc cross compile? At least then you could dump alot of the compiler-specific scripting in your build procedures.

    --
    "Old man yells at systemd"
  4. Gcc? by JanneM · · Score: 4, Insightful

    Why not just use gcc for all four platforms? The sticking point would likely be Windows, but even if you elect to stay with MFC++ for Windows, you've reduced the incompatibilities from four to two different compilers.

    --
    Trust the Computer. The Computer is your friend.
  5. Primary platform? by binaryDigit · · Score: 4, Insightful

    Why not do what a great many other people do (though I have a feeling that you may be doing this already), and target a specific platform for initial release, and then release on the others afterward? This allows you to focus on the platform that gives you the most bang for the buck, but still keep your scaling advantage. If you already have an established product/development environment, then you should already know enough to keep from doing any of the "big mistakes" when it comes to writing portable code. Plus this allows you to divvie up your engineers into functionality vs porting.

    Another thing would be to standardize on say, gcc. since the source is available, you can do whatever tweaks you need to to get around any performance issues (I know, easier said than done). Then standardize on things like configure.

  6. Look several topics down. Design Patterns covers by dameatrius · · Score: 2, Insightful

    this topic (if you haven't read it already). The basic idea is to break out all parts that don't work across the different platforms into their own sections of code (classes/interfaces) assuming you aren't doing that already. Then when you do updates (that will hopefully work platform independantly) you can just right those sections once. Pretty obvious but I have seen so many places with this same issue who actually have completely seperate code bases rather then breaking parts out.

    Unfortunately if you are already doing this then you are probably screwed unless someone releases .NET CLR's for all those platforms.

  7. So many compilers - so little time. by MicklePickle · · Score: 2, Insightful

    controlling four different compilers (gcc 3.1, Sun Forte, Irix MIPSpro and Visual C++ 7)

    Couldn't you just use gcc across all systems? There are also plenty of opensource IDEs around. We use
    Eclipse along with ClearCase. Very good for cross platform.

    --
    -- main(s){printf(s="main(s){printf(s=%c%s%c,34,s,34) ;}",34,s,34);} $p='$p=%c%s%
  8. I'd be interested in knowning... by AKAImBatman · · Score: 5, Insightful

    ...why you think you can't use Java.For all the bad press Java gets about being "slow", it is mostly old, outdated FUD. Newer virtual machines are often faster than C/C++ applications, especially in the number crunching arena. Intensive graphics are no big issue since Java now has a fullscreen API (page flipping, double buffering, and all that), a very fast implementation of Java3D, and (if you prefer) OpenGL wrappers.

    Even if you feel that Java doesn't cut it for everything, apply the 80/20 rule. 80% of your non-performance critical code in Java, and the later 10& in C/C++. This solution would at least *reduce* your multi-platform woes. You might try posting this on JavaGaming. The guys over there are wizards at making Java perform with intensive graphics. (No surprise considering that some of the industries greatest performance experts hang out there.) They can also help you find the APIs you need. I'd really take a second look before you toss Java out as an option.

  9. JNI is your friend by Tim+Macinta · · Score: 5, Insightful
    Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications.

    Java isn't an all or nothing deal. You could write your app in Java and then convert the parts that really need performance into C and call it via JNI. Then you only have to deal with keeping a much smaller C library portable.

    1. Re:JNI is your friend by CmdrWass · · Score: 2, Insightful

      Absolutely!

      Not only that, there may be some merit for the "graphical aspect" of his argument, BUT the "high-performance numerical" part of his argument doesn't hold water.

      Java gets a bad rap for being "inefficient". The problem with java, isn't that it is slow, it is that it is so easy to learn that you have people programming in the language that have no business writing computer programs. I have proven time and time again to my peers that I can write code that is AS efficient or in some cases more efficient than comparative C++ programs. The thing is, I'm a java expert, and I know how to tweak things for performance. Any language can be inefficient if the person writing the code doesn't know what they are doing. And quite frankly, very few programmers I've met are at that level.

  10. Good to use multiple compilers by Anonymous Coward · · Score: 1, Insightful


    Here we have to develop a big tool for multiple platforms (lukily all Unix). It would be possible for us to use only gcc, but we decided to use two different compilers (gcc, IRIX) so that we can find compiler specific errors more easily.

    We found that this is a good policy to decrease complexity (even though it may look counter intuitive)

  11. Java is not currently an option by swagr · · Score: 3, Insightful

    Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications.

    So what you're saying is:
    You've coded it in Java, used native methods where applicable, optimized it, ran it, and it was too slow on every single hardware configuration known to man.

    Or are you just guessing?

    If you posted on Slashdot hoping we'd help you, give us the details. How "not an option" is it?

    --

    -... --- .-. . -.. ..--..
  12. No problem by AKAImBatman · · Score: 5, Insightful

    Step 1. Go to http://java.sun.com and download the JRE 1.4.1.

    Step 2. Visit http://www.datadino.com and click on "Webstart Now!".

    Step 3. Right click and save Meat Fighter. Find where you saved the JAR file and double click.

    Step 4. Right click and save Duke Nukes Stuff. Double click on the JAR.

    Step 5. Visit jGoodies and try their wide variety of products.

    If you are under Linux, I'm afraid the games probably won't perform well. (Little issue with getting X to be configured to handle high speed direct-framebuffer graphics). However, DataDino should work, although you may need to get the installer instead of using the super-cool WebStart link (Mozilla problem only!). If you don't have a database to use, visit the "Supported Databases" page and download the test HSQLDB database.

    The plain and simple fact is that Java is fighting two issues:

    1. Poorly written apps that give all Java apps a bad name. (For example, "genius" A decides to load a table before releasing the event thread. Table takes 5 minutes to load and user gets annoyed. The solution would have been to load the table in a separate thread so that the user can see and interact with the table items as they are being loaded.)

    2. Perceived performance vs. actual performance. People see Swing and the default look and feel and instantly "feel" that the app is slower than windows. Nothing could be farther from the truth. In all reality, it is probably running faster than the Windows app, it just doesn't seem right. This is caused by the Java L&F being way too "flat". Your brain doesn't quite connect the buttons and other objects as being solid objects to be manipulated.

  13. How we solved this problem by Anonymous Coward · · Score: 1, Insightful

    Hi. I'm not usually much of a poster to this site, but since I spent the last
    three years of my life doing exactly what the original poster asked
    about, I'm going to make an exception.

    First my credentials. What we do is write design software for
    engineers. Much of the code is intensive numerics, where performance
    is critical. There is also a fair bit of Gui work where we don't care
    nearly so much. Our target platforms are Windows, Linux and five
    flavours of Unix. We had no restrictions as to language, except that
    it had to be something we had a reasonable change of finding
    developers to work in, (so no Prolog or Haskell). The project is
    question was intended to go to a big installed user base.

    First, PERL. We investigated PERL and ended up using it extensively
    for scripting, but frankly it won't do the job for intensive
    numerics, when there are a million dot products to calculate.

    Second Java. We initially thought Java was our best bet for UI, and
    possibly the rst. Unfortunately it turned out that Java's performance
    is not up to it either. It may look fine on Windows and Sun, but some
    platforms were ten times as slow as the Windows implementation. That
    was the sort of performance hit we could not take. Admittedly this was
    three or so years ago. It took us only a fews hours to run a simple
    numeric Java program on all platforms, and there were several where it
    couldn't cut it. (Are you listening IBM?).

    We toyed with a split between Java and C++ for the numerics, but it
    would have taken a lot of work. A class can practically be only one
    language, and the application didn't split nicely into 'numeric' and
    'non-numeric' classes.

    We finally settled on C++ and like several posters went for GCC in
    order to get maximum portability. Obviously this is not possible on
    Windows, and we went with VC6 on that. In practice the number of times
    we found code that would run on one but not the other was very rare,
    with a big exception I'll come to later. This has worked pretty well,
    but GCC is not built for speed. We recently tried porting to the HP
    native compiler, and got a better than double speedup. However that is
    the sort of hit can can afford to take if it gives us full portability.

    There are some restrictions on GCC. Using shared libraries with C++ is
    very tough on some Unix platforms. And the native STL on VC6 has some
    incompatibilities with the GNU STL, which we fixed by going to STLPort
    on Windows.

    When we discarded Java, we picked up on Qt as an alternative GUI kit, and have
    never looked back. It's powerful, truly portable and very cheap. We
    have a few issues, and we don't use the really cutting edge features,
    but on the whole it probably saved us man years of effort. In my
    opinion its easier to use then Swing, but that's just an opinion.

    We also considered writing two separate versions, one for
    Windows and one for Unix. Unfortunately that would have essentially
    doubled the amount for work necessary, and have done it for ever,
    since we were pretty certain the codes would never have converged. We
    needed to have exactly the same look and feel across all platforms,
    and no-one wanted to settle the hundreds of disputes over whether the
    'Windows' or the 'Unix' way was the right UI.

    I mentioned a big exception a while back. Early on in the project we
    took a strategic decision not to permit multi-threading. We did split
    the GUI and the numerics into separate processes, so effectively this
    gives us two threads. We've never had a problem doing this, and it
    simplifies the code a lot. If you can do this too I'd recommend it.
    I suspect that it reduces the differences between GCC and VC6
    enormously. We wrote our own classes to isolate the differences in
    socket programming between GCC and VC6.

    Makefiles? Don't know. We have a hulking great set of Makefiles, hand
    coded, driven by hand coded Perl scripts, and both are a nightmare to
    maintain. Anyone with better ideas, please let us know.

    If you need to reply, call me "Engineer".

  14. Explaination by AKAImBatman · · Score: 3, Insightful

    Think about Point #2 in this context. How many programs have you tried that you are surprised to learn are Java? If you said none, you probably aren't looking hard enough. (Hint: Look for the java.exe file in the installation directory.) You tend to recognize Java apps by their distinctive look. The distinctive look has problems with perceived performance. As such, many good programmers change it to use a non-standard look.

    After you visit jGoodies, you should understand more of what I mean.

    As for Point #1. I don't know enough about MFC to be 100% sure, but I believe that Windows automatically handles repainting when you are populating complex objects such as tables. (e.g. You'll tend to notice large tables in SQL Server Enterprise Manager paint nothing in the table as you scroll. Instead, you can watch the text filled in after the fact.) Swing (the Java GUI toolkit) requires the programmer to make these optimizations. Why? Because that's who *should* be doing it.

    What if for some reason, I want to design a scrollable table that is fast enough when pulling data over dial-up connections? Under Java, I might design it so that the data doesn't display until the user stops scrolling, or I might display partial data. Under MFC, do I have much choice? Not without jumping through a great deal of hoops.

    Notice how Microsoft writes new components every time they have a new piece of software (e.g. Office toolbars, Outlook shortcut bar, etc.). They do this to improve performance in their programs. Java programmers shouldn't have to rewrite GUI components, just data models. However, few and far between is the programmer who actually does this.

    BTW, another spot you might want to visit is
    Swing Sightings. You can find links to all kinds of well written Java programs.

    If you'd like to try a Java program that uses native components instead of Java Swing, try Eclipse. While I personally don't like it, it should help you understand the perceived problem a little more.

  15. Some suggestions by Anonymous Coward · · Score: 1, Insightful

    On portable programming: remember the adage "only the paranoid survive". Assume that language-defined libraries will pobably not behave exactly the same on different platforms (e.g., threading). Rather than using such a library directly, write your own library around it, and code your application in terms of your library. Then, when you port it to the next platform, the only platform-specific changes should be in your library, not everywhere you used the library.

    On choice of language: C is probably the ultimate in terms of portability. You might code difficult sections in C. C++ can probably be written just as portably, but I would suggest that you restrict developers to a known-portable subset of the language features, especially with regards to class inhertitance and the "standard" library (whatever the old STL is called now). If one of your programmers creates something that "surprisingly works", expect it not to work on any other platform.

    As for RAD: that is a tough one. I've had good success with wxPython (Python is fantastically easy and powerful, and wxWindows provides a very nice set of widgets). There is also a wxDesigner tool for creating dialog boxes (and interestingly, it emits perl, python or C++, your choice). I haven't used it, but I would expect it to be well worth it (it's non-free). The rest of the common GUI development stuff (connecting buttons and menus to action functions) is trivial to code by hand in wxPython.

  16. Seems you need a threading abstraction layer by TheLastUser · · Score: 2, Insightful

    You might use Java for the interface and use JNI (Java Native Interface) to attach computation and rendering modules onto the VM.

    I know of several games that use Java interfaces and then run a real time simulation written in C++.

    Maybe you could build on a third-party threading lib?

  17. Hang in there by Anonymous Coward · · Score: 1, Insightful

    I work work for an oil and gas exploration company. We are starting on a project to take all of the windows geophysical systems off of windows and go with a Linux solution. Even last year we were trying to move all of our applications off of unix to Windows. Now were are considering the opposite.