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."

140 of 410 comments (clear)

  1. 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

  2. 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"
    1. Re:gcc cross platform? by tsetem · · Score: 2

      Along with GCC for cross-platform compatibility, look at using GLIBC to make sure the functions you expect to be there, are there for all of the platforms.

      Haven't checked recently, but is CygWin still being maintained? If it is, then you have GCC available on all four of your platforms, along with the same development libraries and headers.

      You may lose some of your "Big Iron" support since you are using GLIBC instead of the native libraries. (but I'm not an expert in this to know what kind of performance hit you may take).

    2. Re:gcc cross platform? by aridhol · · Score: 4, Informative

      You aren't necessarily using GLibC. GCC works just as well with other LibC implementations, so you can use your "Big Iron"'s own LibC and LibC++.

      --
      I can't say that I don't give a fuck. I've just run out of fuck to give.
    3. Re:gcc cross platform? by ncw · · Score: 5, Informative

      We do exactly this in our main product (a control and monitoring system). It is about 300k lines almost evenly matched between C and C++. Portability was a major concern in its design - we've already had to port it from an obsolete platform!

      We compile using gcc for unix (linux mostly) and Windows using mingw. We cross compile everything from linux and this all works from one Makefile. Recently we even managed to get the NullSoft NSIS installer working under Wine so we can make the install package under linux too.

      Once we got all this ironed out we don't really have to worry which platform we are working on - "it all just works". Any developer can compile for every platform too.

      We split the design into a server part and a client part. The server part doesn't do anything fancy but the client part of course interfaces with the user. We had flirtations with wxWindows [*]and GTK[*] as cross platform GUIs but in the end we decided to use SDL. SDL is very simple but it really works excellently - our application looks identical down to the last pixel on Windows and Linux. Of course we had to write our own windowing system but that is what C++ is for isn't it ;-)

      [*] In our experience GTK doesn't work very well under windows, wxWindows is just too different on Windows/Unix and we couldn't (then) afford the licence fee for QT for commercial products. SDL seemed just the answer for us.

      --
      Every man for himself, all in favour say "I"
    4. Re:gcc cross platform? by bmajik · · Score: 4, Informative

      gcc is the compiler people on linux use because its available, not because its the best.

      gcc on MIPS-IRIX is just awful. gcc is the least common denominator in terms of performance and just as bad as the others w.r.t. compilerisms and peculiarties. it just so happens that if you ported your code to gcc, it would _compile_ everywhere and run in a degraded state on non-linux-x86 platforms.

      so to review:
      On Solaris - the sun compiler smokes gcc for c, c++, and fortran code

      On IRIX - the SGI C++ compiler is almost a reference for how a good C++ compiler should be done. Oh yeah, its code generation is ideal on MIPS architectures (big surprise). can gcc even emit MIPS4 code yet ?

      On Windows - well, msvc is a pretty performant compiler.

      --
      My opinions are my own, and do not necessarily represent those of my employer.
    5. Re:gcc cross platform? by p3d0 · · Score: 2
      Have you tried gcc 3.2? Personally, I have not seen any big difference between the code quality of VC++, gcc, and Intel's compiler, though I don't have a great deal of experience comparing them.

      I can't speak for the other platforms.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    6. Re:gcc cross platform? by The+Snowman · · Score: 3, Interesting

      The latest version of GLibC is standards-compliant and faster than MSVCRT, Microsoft's implementation of the standard libraries.

      Actually they use an old version of someone else's libraries, I think the Dinkam libraries.

      Anyway, I haven't run into any problems with GCC/G++ and GLibC in a while. I think version 3 of the GCC fixed a lot of the standards-related issues, and GCC compiled code is plenty fast. It runs circles around the VC++ compiler.

      --
      24 beers in a case, 24 hours in a day. Coincidence? I think not!
    7. Re:gcc cross platform? by JoeBuck · · Score: 5, Informative

      This message is outdated, possibly reflecting experience with older GCC versions. GCC 3.x is in many ways closer to ISO C++ conformance than MSVC, and it has a new x86 backend that is a big improvement over what we had before.

      Sun's C++ compiler generates faster code than GCC for some cases, but slower for other cases. Sun tuned their compiler for the standard benchmarks, you will not see the gains they advertise for other platforms. In the recent pase, Sun regularly has broken binary compatibility in patch releases, leading to no end of problems for us in supporting customers.

      If you need Fortran, gcc's Fortran is not great. Also, the ia64 support is immature, you will not get fast code out of gcc for that platform.

      Sun, HP, and MSVC are all riddled with compiler bugs of various types; GCC's bugginess is now somewhere in the middle of the pack.

      Finally, differences between compilers can often be greatly reduced by simplifying the coding of inner loops. With code that has been given this treatment, we find that Intel's compiler is only about 5% better than gcc on our large codes.

      But if you do cross-platform C++, GCC can be a very good choice, as you have one set of front-end compiler bugs to work around instead of five or six.

    8. Re:gcc cross platform? by be-fan · · Score: 2

      Many ways better than MSVC? With regards to standards complience gcc blows MSVC away.

      1) MSVC doesn't even support partial template specialization! GCC is the only compiler to pass all the Boost library compiler tests, and is the reccomened compiler for Loki.

      2) GCC doesn't have nearly as many "magic" keywords as MSVC (you have no idea how many people think that some of thos MSVC stuff is standard C) and the stuff that it does have is being depricated. That alone makes it better :)

      --
      A deep unwavering belief is a sure sign you're missing something...
    9. Re:gcc cross platform? by be-fan · · Score: 2

      glibc is actually notoriously hard to port. Currently, only Linux and Hurd are officially supported, along with Windows support from Cygwin.

      --
      A deep unwavering belief is a sure sign you're missing something...
    10. Re:gcc cross platform? by Oestergaard · · Score: 2

      Working in a company that ships a product (server written in C++, agent in C) on anything from NetWare over NT to Solaris HP-UX and Linux, I think I should chirp in here...

      gcc-3.2 is pretty close to being C++ standards conformant. It is one *helluvalot* closer than VCPP 7 (the .net thingy) - and in my experience so far it is slightly better than Intel C++ 6.0 (the Intel compiler has Koenig lookup problems - and it suffers heavily from it's dependence on MS's poor excuse for an STL).

      I'm sure you're mostly right about the performance - gcc probably doesn't generate "fast" code compared to Sun or SGI's compilers, on their respective platforms.

      But in my oppinion you are wrong about g++ having any particularly annoying perculiarities, and you are *absolutely* wrong about msvcpp being anywhere *near* conformant to some standard resembling C++.

      Hell, I had to put
      #ifdef __MSC_VER__
      # define protected public
      #endif
      in certain header files in order to have them compile with msvcpp - how's that for a start... (and yes, the code is correct, it also compiles on g++ and intel's compiler - and the error is not something I can reproduce in a small example, it only happens in certain situations)

    11. Re:gcc cross platform? by e8johan · · Score: 2

      Qt is worth every penny you put into it. A fully working cross-platform toolkit, and so much more than just a GUI.
      Qt makes printing, sockets, fileaccess, database access, etc. so easy in a good cross-platform way. No need ever again to user #ifdef WIN32 to plant some special case non-unix platform code, simply use the appropriate class.
      As for support, they've got it, and training etc. So it will all work just great!

    12. Re:gcc cross platform? by whereiswaldo · · Score: 2

      Could be that MIPS is not first on the list of platforms to start optimizing for? Remember, it's open source, so somebody on MIPS needs to take the time to make and test careful, MIPS-specific optimizations all the while making sure they aren't breaking or slowing down gcc on other platforms.
      Correct me if I'm wrong.

  3. 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.
    1. Re:Gcc? by Mitchell+Mebane · · Score: 4, Informative

      custom app compiled with cc on solaris/sparc and aix/xlc was around 45-65% faster than gcc 2.95.1.

      GCC 3.2 performs MUCH better.

      --

      The roots of education are bitter, but the fruit is sweet.
      --Aristotle
    2. Re:Gcc? by Dog+and+Pony · · Score: 3, Interesting

      http://www.mingw.org/ || http://www.cygwin.com/
      - using GCC on Windows is not a problem anymore. I do it often, with no problems, and then you should keep in mind that I'm not very good at this stuff on any platform. :)

    3. Re:Gcc? by FooBarWidget · · Score: 2

      "However, at least in the programs I write, GCC still produces large executables."

      strip --strip-all foo ?

  4. GCC by captaineo · · Score: 3, Informative

    You can, with some loss of performance, use GCC on all of those platforms. That would cut out compiler quirks as a variable.

    Don't write Makefiles yourself. Instead write a script that translates simple build rules (foo.cpp -> foo.o -> foo.exe) into a custom Makefile for each platform. I went this route after battling for years with complex Makefile rules that never quite worked.

    1. Re:GCC by Sludge · · Score: 3, Informative

      Don't write Makefiles yourself. Instead write a script that translates simple build rules (foo.cpp -> foo.o -> foo.exe) into a custom Makefile for each platform. I went this route after battling for years with complex Makefile rules that never quite worked.

      I'm starting to look into using Cons for a cross-platform C/C++ makefile alternative. I haven't used it in a large project yet, but I can definitely get up and running faster than with Make.

    2. Re:GCC by captaineo · · Score: 2

      I personally don't like the auto* tools very much. They are difficult to set up and debugging them is a pain.

      A nice feature of my system is that it spits out one huge Makefile for the whole project. This avoids the speed penalty and complexity of recursive make (one Makefile per directory). If there is no work to do, 'make' returns almost instantly.

      IMHO the correct solution is to port the platform to the software, not the software to the platform. e.g. demand that the C compiler is always /usr/bin/cc and the X libraries are always in /usr/X11R6/lib (symlink them if necessary) rather than trying to figure out where they are on each system.

    3. Re:GCC by captaineo · · Score: 2

      I should add that the best part about my Makefile generator is that it contains much of the knowledge I've accumulated about portability.

      For instance, to correctly link to OpenGL on Linux you say "-lGL" whereas on Windows you say "-lopengl32". Or to use threads on Linux you must compile with "-DREENTRANT" and link with "-lpthreads", whereas on Windows nothing special is required. In my simple build rule I can just say "this executable needs OpenGL and threads", and the Makefile generator spits out the correct compiler and linker options for each platform.

      As I port my software to more platforms, I just add more intelligence to the Makefile generator. e.g. when I port to Mac OSX I'll simply add Makefile generation rules for whatever quirks OSX happens to have.

    4. Re:GCC by aminorex · · Score: 2

      All of those platforms can be easily accomodated
      with gmake, with cygwin as the windows build
      environment. There should be nearly zero
      conditional code, just a few link options, if
      it is done properly.

      --
      -I like my women like I like my tea: green-
    5. Re:GCC by be-fan · · Score: 2

      I'll testify for CONS. I used it for an OS kernel at one point. OS kernels necessarily have totally obscure build systems. One issue in particular was running a second multi-file optimization pass with Intel C++. I was able to do configuration and compilation in less than 500 lines of Perl. I actually got carried away with adding features (like doing line-counts for files) because it was just so easy!

      --
      A deep unwavering belief is a sure sign you're missing something...
    6. Re:GCC by forgoil · · Score: 2

      Don't use make at all. It is horrible and will eat up a LOT of time (and produce a bunch of errors and problems that you have to take care of along the way, and all your 7 developers won't know how to do the correct changes (because one of the others did it to begin with).

      I would recommend using a make replacement. You have a few examples in this thread, but I would like to throw in my personal favorite (because I use it myself of course;)).

      http://www.perforce.com/jam/jam.html

      It takes a little time to get into, but as soon as you have converted everything, it will be a breeze. It is WAY faster than make (does the whole dependancy on the fly), cleans up with lightning speed, and you won't need different files for different platforms. This is one of the most solid pieces of software that has ever graced a system that I have worked on. It is made by someone at perforce (one hell of a versioning system, blows sourceUnsafe et al out of the wall, and I wouldn't wanna touch CVS after using P4).

      A general note on GCC. If I understand it correctly, you have C++ code as well, and for at least four platforms. I am sure that not all your customers can upgrade to gcc 3.2 just like that. It would be very nice to have (for example on MIPS/Solaris) but first me very sure that your customers can run the software properly. I am sure that many here on Slashdot hasn't been developing software with the same kind of customers as you have, so they might be a bit too optimistical sometimes;)

      QT, as suggested, is a good idea, and you would hopefully be able to hide away as much as possible of the differences of the platforms. Just make sure that QT works (and is supported actively) on all platforms with all compilers.

      Start writing much simpler code. I know how frustrating it can be to do something simple, and have the system crap on you and then spend WAY too much time on this trifle problem while your competitor has pressed F5 and debugged it a long time ago.

      So what to do? Try to write the code as uncomplicated as possible. If needed, send your developers on some extra education. And make sure that you have what you need for finding bugs and squashing them. Get a better IDE/debugger, throw in asserts and other goodies, write down all the differences between compilers that you find, etc.

      (and yes, if you can use it, QT have already taken care of a bunch of the differences between platforms. Grab the evaluation version (or free linux version) and put one of your developers to port one of your components to QT)

    7. Re:GCC by Electrum · · Score: 2

      This is exactly what autoconf and automake accomplish. Why reinvent the wheel?

  5. 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?

  6. Re:Might I suggest... by Anonymous Coward · · Score: 2, Interesting

    Python? :)

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

    P.S. And you can actually understand the code months after you wrote it. ;)

  7. GCC/DJGPP by maverickbna · · Score: 2, Informative

    gcc is cross-platform, can cross-compile to different platforms, and for those who feel the need to use Windows, gcc has been ported, to the ever-popular development suite called DJGPP.

    GCC
    DJGPP

    --
    You are great player! Present you with points!
    1. Re:GCC/DJGPP by tempmpi · · Score: 2

      DJGPP is gcc for DOS not for Windows. mingw or cygwin are gcc ports for Windows.

      --
      Jan
  8. Re:Might I suggest... by SirSlud · · Score: 2, Funny

    LOL! Well, you didn't suggest Javascript, so I guess that counts for something.

    --
    "Old man yells at systemd"
  9. Re:Might I suggest... by EyesWideOpen · · Score: 2

    This would seem like a good solution on the surface of it but the 'immersive graphical aspect of our applications' that was mentioned may mean Perl is out of the question.

    Of course I've never done any graphical programming in Perl (besides Perl/CGI) so I could be wrong depending on the nature of the GUI.

    --

    As with the sun's light
    My mom was magnificent
    Unquestionable
  10. ...write portable code? by jukal · · Score: 5, Funny

    ...uhm...ahmmm...mmm. Dunno what to add.

    1. Re:...write portable code? by chennes · · Score: 2

      More difficult than you would like. Ever try to get something using templates to compile on those four platforms? I don't recommend it. If you are trying to get into the more complex things that you can do with C++, it's *very*, *very* difficult to write 100% portable code.

    2. Re:...write portable code? by jukal · · Score: 2
      it's *very*, *very* difficult to write 100% portable code.

      yes, but it might be *very*, *very*, impossible to get manage than non-portable code. Well, there's more experienced minds in here, but I would say atleast maximing the percentage of platform independant code is the path to go. Hehehe, giving advices is just so easy - and fun! :)

    3. Re:...write portable code? by ameoba · · Score: 2

      Hrmm... maybe I'm issing something here, but if portability is the primary concern, you AVOID doing complex things that might break on one of your platforms. Not to mention the other bennefits (readability, sanity, maintainability) of avoiding the complex outer-reaches of C++.

      --
      my sig's at the bottom of the page.
  11. Go client/server? by WasterDave · · Score: 5, Informative

    I assume that most of your problems are in the GUI end of the equation - why not break the application into two bits? Put the numerical stuff on a grunty 8 way box, and cook up the UI with whatever language best suits the available (and hireable) skills and platform?

    Communication between the two is probably best through SOAP, although to be honest I've not looked into this area for a long time. The GUI can still be built from Java (I believe Java has some reasonably fast OpenGL wrappers now), or look into wxWindows using the existing C++ resource.

    Dave

    --
    I write a blog now, you should be afraid.
    1. Re:Go client/server? by Twylite · · Score: 2

      Ah good, someone got in before me :) It is definatly a good idea to separate out the GUI part when dealing with cross-platform applications, since a lot of portability problems reside there.

      In all honesty, I don't recommand Qt or wxWindows - they are great toolkits, but you lose out heavily on productivity compared to visual development environments with GUI builders. While both of these have associated builder tools, I don't consider them very mature of capable compared to VB or Delphi/C Builder. There is also a write-once-debug-and-tweak-everywhere concern (just getting wxWindows looking good on Windows and Solaris takes some effort).

      Java is a great choice as it is supported on many platforms, has powerful GUI classes, a couple of builder products, and has several means for client/server support, including CORBA. But for UI applications it isn't hugely productive (strangely enough).

      Some of your other options include ParaGUI and SDL, gTk, GraphApp, V, Mozilla's XPToolkit and XUL, and WideStudio.

      I have grappled with exactly this question (legacy C/C++ needing to go cross platform with GUIs), and the best answer I've come up with so far is to keep your main code in C/C++ (since you have the legacy code AND the skills), define a clear UI abstraction layer, and create the UI in a scripting language such as Tcl or Python. Use SWIG to tie the script to native C functions.

      I have more experience with Tcl/Tk, and believe it is more widely portable (especially the GUI consistency), but it is slower and arguably more difficult to program than Python. Still, this depends on what skills you can acquire, and what your UI requirements are.

      Prechelt has an empirical comparison of some languages, including C/C++, Python, Tcl and Perl, and most importantly he has productivity figures! Keith Waclena has a Language Crisis page of comparisons, and Doug Bagley hosts the Great Computer Language Shootout. There are all invaluable resources for determining a balance between portability, functionality and productivity.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
  12. I've done this! by hajo · · Score: 5, Informative

    I've done something similar in a mixed environemnt. The way we set it up is to use java for GUI and logic development and then run a profiler against it and go native on those functions that needed it. These functions would be compiled into a library. (You'd be amazed how little of your code you need to optimize for huge performance gains!)
    If I had to do it again I would do the same thing except I would use python as the 'main, relatively slow, easy to code and maintain' language.

    Hajo

    --
    Hajo Monogamy: Belief so strong that millions of people end perfectly good relationships in order to start a new one.
    1. Re:I've done this! by WatertonMan · · Score: 2

      The problem with Python is that its GUI features are not fully cross-platform yet. We're still eagerly awaiting full OSX support. I don't know how that is going. There was a windowing manager I downloaded off of Source Forge but I couldn't get it working right.

    2. Re:I've done this! by pnatural · · Score: 2

      The problem with Python is that its GUI features are not fully cross-platform yet.

      Not true: wxPython. Sure, it doesn't come bundled with official Python distributions, but wxPython is cross-platform and quite capable, and blows the socks off Tk.

    3. Re:I've done this! by WatertonMan · · Score: 2
      Have you got wxPython to work though? (That's what I was alluding to) I don't know if it is because I installed Fink, which has its own Python disto, but I never was able to get it to work right.

      Has anyone else had these problems? I'm thinking it was due to Fink as I've had other subtle problems with Python since I installed it.

    4. Re:I've done this! by pnatural · · Score: 2

      I don't use Macs, so I can't speak to any of the Fink stuff.

      But wxPython works very well for win32-linux cross-platform development.

  13. Python, Java, wxWindows by g4dget · · Score: 4, Informative
    If you can do it at all, use something like Python: custom software is much easier to write in it than in C++, and it has good support for numerical operations. Java, too, is much easier and safer than C++.

    If you have to use C++, then wxWindows is a great environment: it works on lots of platforms and has extensive support for platform-independent I/O, threading, and networking.

  14. WxWindows and GCC maybe? by Dog+and+Pony · · Score: 5, Informative

    http://www.wxwindows.org/ - mature crossplatform C++ library, and not only for GUI, either.

    I don't know what you need, but WxWindows and GCC cross-compiling (see mingw32 faq, for instance) might be what you need?

    WxWindows also have good bindings to python and perl etc. for more rapid crossplatform development.

  15. Re:Different platforms.. different people by mxmissile · · Score: 2, Funny

    Read this.

  16. Huh? by wandernotlost · · Score: 2
    What tools and strategies can we use to increase our productivity and regain our competitive advantage, without going for Windows only?

    All Windows productivity oxymoron jokes aside, how do you go from most of your users being on Solaris and Irix to thinking about going Windows only?

    Erg...I just saw the second part of the article, after the ad. That was annoying. Maybe it's time to sign up for a subscription.

  17. 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.
  18. 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.

  19. Without joining any holy wars about language... by buysse · · Score: 4, Interesting
    It sounds like your biggest problem isn't the cross-platform code as much as the Makefiles and the compiler differences.

    I would suggest first using gcc on all UN*X platforms, and also trying out something like ant instead of the various forms of make you're dealing with now.

    Also, have you considered using a library like Qt to handle most of the porting details? It's not free, but it is good if you can deal with it's oddities (I personally consider preprocessing to be evil).

    Good luck.

    --
    -30-
    1. Re:Without joining any holy wars about language... by tpv · · Score: 2
      also trying out something like ant instead of the various forms of make

      I'll avoid my anti-ant rant here, but will suggest that you don't need to throw out make to go cross-platform. GNU make will run on *nix and Windows (cygwin).

      You can have cross platform makefiles.
      Especially if you have control over all the platform.

      --
      Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
  20. Re:Gcc? Speed. by for(;;); · · Score: 5, Informative

    gcc is built for portability, not speed. VC++'s code is faster, but has zero portability and its own magical, lsd-inspired "innovations." [" for(int i=0;in;i++); for(int i=0;in;i++); ? Why would anybody ever want to compile code like that?"] That intel compiler mentioned on /. a while back sounded fast; but the gcc-for-everything approach may not be best, if they find compiled java too slow.

    --

    "Whatever happened to fair use?"
    -- Duff-Man
  21. 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.

  22. 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%
    1. Re:So many compilers - so little time. by WatertonMan · · Score: 2

      Using GCC across all platforms doesn't guarantee no problems. (Although clearly it will simplify problems) I remember spending over a day tracking down a problem that was due to differences between GCC on OSX and GCC on Linux.

    2. Re:So many compilers - so little time. by (startx) · · Score: 2

      aah yes, and I've spent many nights over the last few years fighting the differences between g++ for linux on x86 and g++ for solaris on sparc

    3. Re:So many compilers - so little time. by sql*kitten · · Score: 2

      Couldn't you just use gcc across all systems?

      Not if you care about performance. Code compiled with a vendor-written compiler like Forte or MIPSpro can be over twice as fast as gcc's. At present, for example, gcc cannot optimize for the MIPS processor family, but SGI's compiler is finely tuned (remember SGI's bread-and-butter is fast compilation).

      Remember, gcc is the lowest common denominator. It'll compile you code sure, but that's all it will do, even with -O2. It might do a little better on Linux/x86 because it is the primary compiler on that platform, but I'd be very surprised if VC++ generated code doesn't outperform it, even allowing for the additional overhead of Win32.

      This isn't a criticism of gcc, since performance wasn't its design objective, but it does ably illustrate that Open Source isn't always the solution, and commercial software is often better.

  23. ant instead of make? by mrjive · · Score: 2, Informative

    Ant is an excellent alternative to Makefiles. It might not solve all your problems, but you should at least be able to simplify your build process quite a bit.

    Apache Ant

    --
    If you can't beat them, arrange to have them beaten. -George Carlin
    1. Re:ant instead of make? by tpv · · Score: 2
      No No No!

      Ant is kind of nice for Java work, but if you're writing a C++ app then using Ant is bordering on the insane.

      Ant does not simplify a build process unless you're running a fairly standard Java project, or you don't have anyone who knows how to use make properly (writing simple things in Ant is easier than writing simple things in make, but Ant doesn't scale)

      If you want cross platform, just use GNU make on all your platforms, and put wrappers around the compilers so they accepts the same commandlines.

      The solution to your issue seems to be:

      1. Use cygwin on Windows so that all your platforms have similar tools.
      2. Install bash and GNU make on all your *nix boxes. (You could use cons or jam, but it doesn't appear that you need to)
      3. Use the native compilers for speed.
      4. Write a compile.sh shell script that takes the same commandline syntax on all platforms, and converts that into the correct syntax for the native tool. That way you don't have to worry about putting all that logic into the makefile.
      5. Do the same for linking, dependancy generation, etc. etc.
      That should clean up your build process. If you need to hire a build engineer, then do it. Get a professional in for a month to pull everything in to place.

      As for the code...
      If you've been doing this for so long then why is it an issue any more?
      Surely you have established patterns to solve common problems.

      Abstract!
      Don't solve threading problems more than once, put a common abstraction layer into your code.

      If one compiler doesn't support templates properly, then document it, and tell the team not to use templates in that way.
      You have a fixed set of compilers to work with - it shouldn't take that much work to learn where they differ and document ways to work around the differences.

      --
      Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
    2. Re:ant instead of make? by tpv · · Score: 2
      I don't think it'd be that difficult to migrate their existing makefiles into ant-usable xml build files.
      Doing a very rudimentary conversion wouldn't be too hard, but Ant doesn't natively support a lot of stuff that make gives you out of the box. Converting that is not going to be easy.

      The biggest issues with using Ant on such a project would be:

      • Lack of good C/C++ tasks. Various people have proposed tasks, but I've not yet seen one that is well tested and well supported.
      • Poor dependancy analysis. Ant just simply doesn't do dependancies that way make does. You can do your own dependancy analysis if you want, but Ant's premise is completely different to make.
        Ant works on the idea that you build a system by going through a series of tasks. Compile the code, package it up, ... That's fine for java, but for large C/C++ systems it isn't so useful.
      • Ant build scripts get very compliacted very quickly. I don't believe that Ant scales well to large projects. Make struggles, but it has features that make it a better solution.
      Ant and Make a fundamentally different concepts. Converting from one to the other is not easy, and trying to use the ant method on non-java code is (IMHO) a bad idea.

      I don't see what benefit Ant would give a C/C++ developer.

      --
      Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
  24. Single compiler _interface_ by Ed+Avis · · Score: 2

    Instead of different makefiles for each compiler, why not write wrappers for the various compilers to give them all the same interface? Then at least for compiler invocation you could have the same makefile for all four platforms, just set CC=cc_wrapper which is a shell script (or .cmd script on Windows, or Perl or whatever) which mangles its command-line options into whatever weird syntax this platform's compiler expects.

    With more fundamental issues like differences in the code accepted by different compilers, you can use #ifdefs in the code, which is not elegant but probably much better than makefile hacking.

    Some suggested switching to gcc on all platforms, but then others said it might produce slower code. Well, you won't know until you benchmark. It's possible (just) that you might decide to compile most of your object files with gcc, to eliminate most of the compiler-specific hackery, and just compile those parts of the program that are speed-critical using the native compiler. This assumes that the object formats used by gcc and the native compiler are compatible, but in principle there's no reason they shouldn't be. (Perhaps not in practice, but give it a try.)

    --
    -- Ed Avis ed@membled.com
  25. Numerics in Fortran, Front-end in Java by PseudononymousCoward · · Score: 2, Interesting

    Check out the latest edition of OilIT. Applications like this are why Fortran is still a very popular language among those who use computers for numerically-intensive work. Fortran9x is so easily portable, its not even funny. Bindings exist for all of the major threading standards (OMP, MPI, etc) and it is FAST. Further, is there any language with a better selection of libraries available for number-crunching? I doubt it. Develop your 'work' code in Fortran, and your front-end in Java. Both highly portable. The interface between the two will be platform specific, but this will only be a small portion of the total project & much easier to maintain than the large #ifdef heavy project you now have. $0.02

  26. Re:Might I *STILL* suggest... by XaXXon · · Score: 5, Interesting

    In defense of my previous post:

    As for graphics, there is a QT binding for perl that will allow you to do cross platform GUI work (and it looks nice, too)

    As for speed, making C/C++ plugins for perl is not hard, and if you can break out your high-speed numerical pieces into small bits of code, it's relatively easy to call them from perl.

    That said, perl isn't that slow. After you break out a few critical routines into their own XSUB modules, I bet you'd be surprised how fast perl is.

    Also, perl 5.8 has very good threading support, and it isn't a global mutex around the interpreter like it is with some other interpreted languages.

  27. It's very simple. by eddy · · Score: 3, Funny

    Just add more people to your team! Double! Tripple! GO WILD WITH NEW RECRUITS!

    Sheeesh, some people never learn...

    --
    Belief is the currency of delusion.
  28. Re:Might I suggest.... by binaryDigit · · Score: 2

    And I assume that you walked to work, have a hamster run generator that's powering the computer that you posted on, don't use anything plastic or wear nylons or spandex?

  29. C++ = Object Orientation? by pVoid · · Score: 2, Informative

    Why not isolate threads and files, and IPC into light-weight objects?

    Sure you are going to have incompatible concepts across platforms (e.g. Windows doesn't support just unlinking an inode), but I'm sure you can find a happy subset without making too much compromise.

    I know Alias|Wavefront uses a very similar concept for their Studio and Maya products. (studio looks and behaves identically on all platforms - so it *is* possible).

  30. 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.

    1. Re:I'd be interested in knowning... by Dog+and+Pony · · Score: 2

      Yes, I know, I know, it is probably FUD, but how come I never ever find any java applications that are this fast as they say? I mean, I have this 1.8GHz computer with (only) 256 MB of ram and the rest average stuff. I have the hotspots and the JITs people talk about from different vendors. Why does no java apps actually perform?

      I like coding in java, you might even say "I want to believe" (in my best X-files voice) but how? People point to stuff like JBuilder, or other commercially built applications by big businesses. Nada. And no, I am not talking about my own applications either, although they be slow, they too... :)

      So give me one good example and tell me how to run it, and I will believe. Noone has, yet.

    2. Re:I'd be interested in knowning... by tpv · · Score: 2, Funny

      80% of your non-performance critical code in Java, and the later 10& in C/C++
      And throw the remaining 10% out?

      --
      Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
    3. Re:I'd be interested in knowning... by ProfessorPuke · · Score: 2

      The fullscreen API and 3D features don't help if you just want quick response in a traditional, windowed productivity app.

      The performance of Swing still lags behind native code. We have some Java tools for in house use, I can't bear to make them greater than 30% of the screen size because the refresh rate is too painful.

      Maybe there's some aggressive coding techniques that would accelerate things, but if you're not a game developer, your boss won't consider GUI optimization time well spent. The Qt or wx libraries (or even Microsoft Visual Basic(tm)) will give you a snappy feeling application after a few minutes of assisted layout.

    4. Re:I'd be interested in knowning... by Pseudonym · · Score: 2

      Are you volunteering to do the port of the ~300kloc mentioned while still supporting older versions?

      Unfortunately, in the real world, rewriting 80% of the whole system is almost never an option.

      The product I am paid to hack on is about 1.5Mloc. While this is bigger than the original poster's system, we've only ported to four platforms (32-bit Solaris, 64-bit Solaris, 32-bit Windows 2000 and IA64 Linux), so I suspect the headache level turns out to be about the same.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    5. Re:I'd be interested in knowning... by ProfessorPuke · · Score: 2

      Maybe so. I tried a day or two to increase its performance, then gave up and in an additional day re-wrote it in C++. It was immediately faster than we'd ever need. So you're correct, we don't spend time optimizing Swing, especially when I've seen no examples to suggest its even possible.

      Look at Eclipse and Microsoft Visual Studio(tm) side by side. The widgets may look equivalent, but watch them redraw a buffer and you can tell which one is native.

    6. Re:I'd be interested in knowning... by sacrilicious · · Score: 2
      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.

      I have not experienced this. I've ported a large graphics-processing application from C++ to Java, and was unhappy to encounter an overall 6x performance degredation despite my best attempts to use memory efficiently. When I last looked on the web six months ago, performance tests comparing java and C++ uniformly indicated a similar performance penalty for java.

      .

      --
      - First they ignore you, then they laugh at you, then ???, then profit.
  31. 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.

    2. Re:JNI is your friend by ealar+dlanvuli · · Score: 2

      I had to call native functions repeatedly in tight loops.

      Hint: Your supposed to factor the entire loop out, not just the function calls.

      --
      I live in a giant bucket.
    3. Re:JNI is your friend by AKAImBatman · · Score: 2

      In that case, why use Java? You could use another interpreted or scripting language...

      Simple. Because Java isn't slow and it's better supported under Windows than most Unix scripting languages. Most scripting languages ARE quite slow when it comes down to it. That's fine when we're talking non-performance critical web-apps, but if you are actually talking real-time systems, Java will keep your non-critical code from eating up all the CPU that the critical code needs.

      Besides, I'm betting that any project done in Java will end using very little JNI to improve performance.

    4. Re:JNI is your friend by truth_revealed · · Score: 2

      Hint: Unique Java Strings were constructed and returned by the JNI native function which was in part based on the loop index as a parameter. Factor that out your asshole.

      Hint: "Your" is actually spelled "You're" - short for "You are", jackass.

  32. Use ACE by TheGreatAvatar · · Score: 3, Informative

    I've developed several multi-threaded mulit-plateformed applications using ACE. This is a very well thought out package using various patterns to abstract the vulgarities of the different OS / compilers. ADAPTIVE Communication Environment

    --
    Three things are certain: Death, taxes, and lost data. Guess which has occurred.
    1. Re:Use ACE by cK-Gunslinger · · Score: 2, Informative

      I whole-heartedly agree with this. Many large corporations and projects are using ACE with lots of success. I find that multi-threaded and/or multi-process application development is simple and straightforward. We are only using the wrapper-functionality of ACE for the most part, but when combined with the pattern-abstractions and implementation, you can really achieve some well-designed, well-performing, cross-platform code.

    2. Re:Use ACE by ProfessorPuke · · Score: 2

      I've seen a pair of large corporations use ACE with no success. I wasn't directly involved in the code, so maybe the individual implementors were idiots.

      But ACE sure can produce some bloated messes of hyper-nested templates providing little real additional functionality beyond the POSIX standard library. It can get big, and it can get slow, and when you complain about the speed the developer will tell me "Oh, ACE takes care of all that. I can't touch it. Sure, its open source, but there's no way I could go in there and fix that! Just look at all the templates!".

      Regarding ACE in multi-process applications, the last time I looked there was a serious bug (14 months ago, it might've been fixed since then). ACE's IPC has a race condition that can deadlock, freezing your big distributed application. Thousands of runs would succeed before this bug popped up, but it did happen (usually long after the product was deployed to customers)

  33. ACE (or Rogue Wave) and gmake by demiurg · · Score: 2, Interesting

    Just rewrite all your makefiles for gmake - which is cross platform and can use any compiler and use one of these libraries (ACE or Rogue Wave) along witg STL - and you are set.

    I've done this... it works...

  34. Bridge pattern by yellowstone · · Score: 2
    Have you looked at using the Bridge pattern (c.f. the GOF Design Patterns book).

    The GOF book gives an example of using the Bridge pattern to provide a platform-independent interface to a GUI api.

    Disclaimer: I don't have any real-world experience with the Bridge pattern, so I can't say how easy it is to make work, or how it performs in performance critical situations.

    --
    150 Opening BINARY mode data connection for slashdot.sig (129323052 bytes).
  35. Hmm... by Fugly · · Score: 3, Interesting

    I've seen a few shows on TV recently that featured some really wicked looking oil and gas exploration software. Stuff that let geologists view layers of terrain collected by seismic data in 3d, moving around in realtime... If that's the kind of stuff you're into, I can understand why java isn't an option for display right now.

    However, java is exactly what you need. You can scale it across processors on the big iron or run it on the desktop without recompiling.

    Have you considered only writing your display logic in C++ and using java for the backend number crunching? For raw floating point math, I've read that java is barely slower than native code at this point. It's my understanding that talking to the OS so you can get to the hardware is where you take the major performance hits using java. If you could do your raw crunching in multi-threaded java code, you could then deliver the data through one of many different mechanisms to your display logic and have that be the only code that you need to port from OS to OS...

    Another thing you could possibly look at is licensing 3rd party libraries made for cross-platform development. From your post, the only thing I know you're definitely having trouble porting is thread-related code. I'm sure there are multi-platform threading libraries for C++ out there somewhere.

  36. Re:Might I suggest.... by Havokmon · · Score: 2
    Working for an industry that isnt helping to destroy the world?

    So can we also assume you won't help hunting the deer that have completely overwhelmed the upper midwest due to 'conservation'?

    http://datcp.state.wi.us/ah/agriculture/animals/di sease/chronic/faqs.html

    Hmm Under "Symptoms", one is said to be "depression". How many of our tax dollars went towards analysis of deer psychology?

    Damn bleeding heart liberals.

    --
    "I can't give you a brain, so I'll give you a diploma" - The Great Oz (blatently stolen sig)
  37. Qt by neonstz · · Score: 5, Interesting

    Have you looked at Qt? It supports all the platforms you are developing for. It is primarily a platform independent GUI toolkit, but it also got a lot of other stuff like container classes (if you for some reason won't use stl), thread support, sql classes, xml classes and socket classes, all which are platform independent. It is not only just a portable GUI toolkit, I think it is the best GUI toolkit there is. I recommend it even if you're writing for Windows only. If you think of Qt more as a platform than a GUI toolkit, writing applications that run on multiple platforms (with native speed) may be easier than you think. (I'm not an employee of trolltech, although I am wearing a Qt t-shirt as I write this :)

    1. Re:Qt by ProfessorPuke · · Score: 2

      One thing that blocks the use of Gtk for some projects is its internal use of CORBA. If your code also needs to use CORBA for some reason, then you can run into linking conflicts where each library tries to bring in its own version of the ORB.

      (I've seen this specifically with Gtk vs ACE/TAO. But then again, ACE isn't something you should ever use if it can be avoided.)

  38. Re:Select another language by SLOGEN · · Score: 2, Informative

    Obviously, you would leave the numeric and "immersive graphics" in C++, and link the python code to it....

    Leaving you to do interesting stuff _with_ the C++ components, but without having to formulate everything in C++.

    Just preempting the "you did not read the post"-posts :)

    --
    SLOGEN [ http://ungdomshus.nu : Sebastian cover music]
  39. GCC by Montreal+Geek · · Score: 2
    Simply moving over to GCC for all four platforms does seem to be the obvious choice; you can also flatten GUI differences by using a portable multiplatform library.

    I've had some experience doing just that. To date, Qt is the most mature of those and will give you uniform access to GUI, networking, threading and even database access for Win32, Unices (including Linux) and MacOS.

    If you aren't so worried about GUIs but need to output multimedia contents portably, SDL is a viable alternative. The portability of some of the more esoteric components is dubious but SDL has the distinct advantage of being completely free.

    As for performance concerns some people have raised about archaic versions of GCC, don't let that stop you-- even if you don't use GCC 3.2 (which produces very good code) the subtle improvement is speed is very rarely worth the greatly increased complexity in development and maintenance.

    Besides, with recent GCCs I'm hard-pressed to actually find any significant difference between code generated by it and other compilers (for IA32, anyways, and with all relevant optimizations turned on).

    -- MG

  40. Re:Qt (or maybe Java) by WatertonMan · · Score: 2

    I've heard good things about QT. How good are its non-GUI classes? i.e. for numerics and more importantly for threads? We're looking at doing some crossplatform stuff and QT's support of the Mac is a major selling point.

  41. Two tips by JohnZed · · Score: 2

    - First, Qt (www.trolltech.com) is awesome. High performance, excellent portability (including all the UNIX platforms you mentioned, plus Linux/Windows/MacOS X), legacy integration (with Motif, etc.), multithreading, etc. There are also third party toolkits to integrate more advanced visualization into Qt (http://www.trolltech.com/company/announce.html?Ac tion=Show&AID=108).
    Nowadays, Qt doesn't just handle GUIs. It also includes networking and threading abstractions, with really nice object oriented interfaces to them.

    - Second, think about what IDE features you're looking for. If it's a GUI builder (which seems doubtful, considering that you probably spend a lot more time writing visualization algorithms than dialog boxes), then you could use Qt Designer.
    But, if you're more generally interested in project management, integrated debugging, and source browsing, I'd suggest you take a look at Visual SlickEdit (http://www.slickedit.com), which integrates all those features into an amazing, cross-platform IDE/editor.

    Good luck!
    --JRZ

  42. Re:Gcc? Speed. by WatertonMan · · Score: 2
    If you regularly compile your code on multiple platforms this is less of an issue. For instance we compile our crossplatform code on Visual Studio, Borland, GCC on Linux, GCC on OSX, GCC on Solaris, and Codewarior on OSX/OS9.

    It's amazing how many things you find this way. It actually a good way to find many bugs as well. Since we've been doing this a while we also decided to avoid a lot of the "newer" C++ features and that really helped both speed and portability. (Since not all compilers did STL well for some time)

  43. Java for GUI, C++ for profiled code by eyefish · · Score: 2

    If you definitelly need speed AND flexibility, I'd write the main application logic and GUI in full Java, then profile the application to find out those parts that really need to be accelerated, and write those as C++ code (you'd be VERY surprised at how easy it is to do this with Java; your Java code wouldn't even know that it is calling C++ code).

    Give it a try, that way you can use only one IDE for all of your code (NetBeans, Forte, JBuilder, Visual Age, are all good tools).

  44. X-Platform Strategy C++ by 4of12 · · Score: 2

    I'm guessing you'll get plenty of suggestions to change your language, which is certainly something to consider if you have that option.

    But if you're like me, you don't have that option. You've got a load of C++ that's not simply going to magically transform into Python or Java overnight.

    I would suggest the hard road. Boil down supported standard features in the compilers that you can use and tell people to stick to that list unless they can make a case that all of the compilers now support the new feature that they want to use.

    Although I feel it is dated now, Netscape used to publish such a guide for their developers.

    For example, in our early days, we would not permit namespaces or RTTI.

    Now, as compilers have gotten more supportive of the ISO C++ standard, we permit those features in our codebase.

    But we haven't yet decided to open the floodgates on exception handling, although it's supported pretty broadly.

    Finally, you really need an automated build system that runs the latest repository snapshots through the compilers on all the platforms and throws the results up on a web page, like Tinderbox.

    That will tend to enforce good standards as developers will see that their check-in attempts fly through with green and no warnings, or get dirty yellow about warnings, or red with downright errors during the build.

    --
    "Provided by the management for your protection."
  45. Ask the experts! by joeytsai · · Score: 2, Informative

    Why not see what others who are facing the same issue have done? In particular, I'm thinking of mozilla, which is another C++ application which has builds for Linux x86, Windows, OS X, OS/2, HPUX, AIX and Solaris.

    Yeah, they had to make their own toolkit (XUL), but I don't know if you need one (it wasn't totally clear from the question).

    In particular, check out this helpful document the mozilla team made about writing portable C++ code.

    --
    http://www.talknerdy.org
  46. We don' need no stinkin' tools by seniorcoder · · Score: 2, Interesting

    I have written many cross-platform projects in C++ without a problem. All I did was identify low-level platform dependent issues and encapsulate them within subroutines, typedefs & #defines etc. Then write software using regular C++ code and use portability library. Example: typedef unsigned long PORTA_PID; // This function returns the current process ID. PORTA_PID getProcessID(void); As a previous respondent said, GUIs are a different matter. I would suggest to standardize on one GUI environment such as Java (or even MFC) and split the functionality so the GUI was a thin shell that communicates with the main business logic that exists in other C++ processes. You don' need no stinkin' tools, the amount of code required in the portability library is very small. That's my 2$. I'm worth more than 2c (just).

  47. Program with Java, build with Ant. by AugstWest · · Score: 3, Interesting

    I don't understand why people even look at Makefiles anymore now that Ant exists. We've completely automated all of our builds and deploys across NT, Linux and Solaris with it, across different architectures and different locations.

    I'm not going to expound on using Java, since it is fairly ubiquitous these days and if it would work for you, I'm sure you would have already considered it.

  48. Re:Gcc? Speed. by norwoodites · · Score: 2

    `for(int i=0;in;i++); for(int i=0;in;i++);' is the right way accounding to the c++ standard, the wrong way is `for(int i=0;in;i++); for(i=0;in;i++);'

  49. Re:Might I suggest... by voodoo1man · · Score: 2, Informative

    While we're talking about switching languages, why not Common Lisp? It compiles to native code and has all the features mentioned (fast numerical code, vendor support for multithreading (this will likely be standardized now that J13 has decided to meet again), portable graphics (CLIM), very platform-neutral, no more rat nest makefiles - hell, no more making at all). The only downside is that Allegro CL is the only compiler continuing support for SGIs (although it also supports hp-ux, aix and various flavor of DEC unix, with no extra porting effort unless you're doing tricky FFI). If the contract is large enough, it might be possible to convince Xanalys to port Lispworks to the SGI again (I'm fairly certain it ran on that platform sometime in the past).

    --

    In the great CONS chain of life, you can either be the CAR or be in the CDR.

  50. Re:Gcc? Speed. by gillbates · · Score: 4, Interesting
    gcc is built for portability, not speed. VC++'s code is faster

    You're joking, right? Perhaps I'm a little behind the times, but I was under the impression that GCC used a register based architecture where VC++ uses a stack based architecture. While GCC might spit out some average performing code with the default options, using -O3 will produce very fast running code. I've compared the performance of code compiled with GCC vs. the same program written in assembler, and at its best, GCC is only 50% slower than hand coded assembly, which is very good considering that some very well respected compilers will produce code that is 10 times slower than hand coded assembly.

    I've also looked at the assembly language output of VC++, and it's a joke. VC++ often inserts large sections of extraneous instructions into the code. I've managed to follow function calls in VC++, and it is not uncommon for a function call to have prolog and epilog code of several dozen instructions. Interestingly, GCC uses a register based schema, and I can actually follow the code pretty easily, in spite of the fact that it uses the AT&T syntax. GCC just produces cleaner code.

    --
    The society for a thought-free internet welcomes you.
  51. Hi Rob by MSBob · · Score: 2
    How are you, mate? How is everything at m*e?

    Have you considered java? Sounds insane, I know but Java3D seems to be coming of age and I've seen some pretty impressive large data visualisation demos written in it. It saves you a lot of headaches with cross platform development issues.

    I realise that most people think of Java only as a server side technology but Sun has been putting a lot of effort into making it more appealing to the scientific programming community. You should really give it another chance.

    Yours truly,

    You know who, eh? :-)

    --
    Your pizza just the way you ought to have it.
  52. You may be surprised... by merlin_jim · · Score: 2

    I do not know why noone considers Java as performant.

    I have a few words / acronyms...

    1. JIT. As in Just-In-Time compilation. Meaning Java software approaches native speed as time goes on.

    2. JNI. As in Java Native Interface. Ok, so you have a couple C++ libraries that really have to be as fast as they possibly can be, without necessarily incurring the wrath of the platform demon by being written in assembly. That doesn't mean that the 90% of your code that doesn't vastly effect the performance of your system ALSO has to be written in C++.

    3. Silicon. As in what chips are made of. Including chips that run Java. Though these are really targetted at the embedded market, to have your coffee machine run Java or whatever, a high-performance version is available. It plugs into your PCI bus. And runs Java there instead of in the main processor.

    Oh, not exactly on-topic, but insert obligatory note of how .NET is language-independent, supposedly platform-independent, being an open standard and all, and performant, as its compiled and not runtimed.

    --
    I am disrespectful to dirt! Can you see that I am serious?!
  53. Have you tried Java? by Big+Man+on+Campy · · Score: 2, Interesting
    A colleague of mine is in the same boat as you. He asked me to implement some of his numerical calculations in java. We then benchmarked both. Java was the clear winner for us. You should consider trying the same.

    Go out and download and install Java's sdk. Also, take a look at jama.

  54. 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?

    --

    -... --- .-. . -.. ..--..
  55. Re:I do the same by mmaster · · Score: 2, Informative

    Also, you can try the cross platform operating system facility from the same mozilla project.
    Check out
    http://www.mozilla.org/projects/nspr/about-ns pr.ht ml

  56. My 2 cents by WetCat · · Score: 2

    I still prefer Tcl (with Itcl for object-oriented programming). It's the easiest software environment to work with for me. I also use websh and dtcl extension for apache (tcl.apache.org).
    Using TCL you'll have a very compact and clean code.

  57. 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.

    1. Re:No problem by Dog+and+Pony · · Score: 2

      Thank you, I will.

      But I will tell you beforehand, I am not totally buying that explanation (#2)- it would mean that almost every java developer, including old professionals would suck, since I've seen quite a few java apps.

      And your point 1. is nothing I recognize at all... but maybe I am just lucky.

  58. Commercial support: Qt, MKS by msobkow · · Score: 2

    MKS Toolkit does a terrific job of integrating a Unix ksh-based CLI with WinNT/2K/XP, and couples closely with IBM DB/2 so that you can run DB/2 UDB scripts as you can under AIX. It is expensive, but worth it if you can afford it.

    Qt is a very, very nice cross-platform development library. Another option you could look at used to be Neuron Data's Elements Environment, but they renamed the company (www.blazesoft.com) and I don't know if they still sell EE as a seperate product (Advisor is a repackaging of their rule-base software, which was built on EE.)

    There are also the ever-present Rogue Wave class libraries, but I don't think they'll address your GUI requirements. However, if you use it to split out the core application functionality from the presentation (GUI), it might be helpful.

    A solid set of macros with compiler/platform detection directives can help a great deal for porting code, though many people prefer to use sed or perl scripts instead (ala config.) Macros have the advantage of dealing with portability more consistently, and localize the changes for platforms to the headers and migration binding code (usually done as a base library.)

    Using cross-platform libraries such as xml.apache.org libraries, IBM's ICU (Unicode support), et. al. can also make your code much more portable without requiring extra work after the initial coding.

    There are also various open source projects that provide portable thread libraries, portable GUI toolkits, etc.

    --
    I do not fail; I succeed at finding out what does not work.
  59. Java is *so* hard! by fishdan · · Score: 2, Funny

    Java is not currently an option for the high-performance numerical and immersive graphical aspect of our applications. Read: "We don't want to learn Java" No Java programmer who read that believes you. The answer is that what you can learn to do in Java in 5 DAYS won't be fast enough, but if you're willing to either hire a good contractor (for gods sake ask to SEE something he's built though), or take 8 weeks or so to get GOOD, you can EASILY do this in Java...Unless of course you are doing special effects for ILM, in which case I humbly apologize, and I've got some questions about the next movie.

    --
    Nothing great was ever achieved without enthusiasm
    1. Re:Java is *so* hard! by DanielDittmar · · Score: 2, Funny

      No Java programmer who read that believes you.

      Why not? They seem pretty gullible otherwise.

  60. cmake and cygwin by cant_get_a_good_nick · · Score: 3, Interesting

    As far as makefiles go, cmake looks promising. It seems to be a generalized Imake replacement. I haven't used it, but looks interesting. It is now part of the cygwin toolchain.

    as far as tools go, look at cygwin. My company uses gnumakefiles on NT and UNIX, with generalized Makefiles for each project, and platform specific build rules in universal gmake include heeaders. We use ACE for a lot of the cross platform C++ stuff, a lot of our things are servers so we avoid the cross platform GUI stuff.

  61. Probatus Spectra SDK by magi · · Score: 2

    Would a cross-platform SDK with a C API do, instead of C++? C is more efficient than C++ for many purposes and much nicer for integration.

    You might want to take a look at Probatus Spectra SDK. It provides many standard and advanced functionalities, as well as many helpful high-level frameworks for networking, globalization, and so on. A comprehensive cross-platform compatibility layer is an integral feature of the SDK.

    You mentioned that you need especially threading. Probatus Spectra SDK provides a very nice cross-platform API for threading. For example, it cross-implements the conditional variables in Unix threads and thread events in Windows.

    It also has an excellent build system based on a framework of makefiles that hides all platform-dependent issues.

    The currently supported platforms are Linux, Solaris (Forte compiler), HP-UX, IBM AIX, Tru-64 and MS Windows (VC++ and Borland C++ Builder compilers). Both 32- and 64-bit platforms are supported for Solaris,

  62. FLTK and Boost by printman · · Score: 2

    Definitely check out:

    FLTK - http://www.fltk.org/ - light-weight
    cross-platform C++ GUI toolkit with
    OpenGL support, etc.

    Boost - Portable, peer-reviewed C++ libraries
    including threading support, etc.

    --
    I print, therefore I am.
  63. Better compiler... by sfe_software · · Score: 2

    Honestly, I would use Visual Studio only as a deveopment environment -- but NOT rely on it. The other platforms will be easy enough to just use whatever text-editor the developers are comfortable with.

    I tried Intel's compiler for the first time today on Windows, and it's far superior to the one that comes with VC 6.0... it integrates nicely with the IDE (remember, the IDE is just an IDE, the compiler is a command-line utility) and -- in my case (fourier transforms, MP3 decoding) it produces code that is a LOT faster (though compile time is slower, output is larger...)

    Point being, there is no reason (ever) to tie yourself to visual studio. It's a glorified text editor, really, and as long as you keep it that way (stay away from MFC et al) then it won't introduce any problems with cross-platform programming. I personally run a couple of (private) cross-platform projects, and the best advice is to treat code as code. Don't rely on any of VS's magic, just use it as an environment that lets you edit text and compile with the push of the F7 key.

    --
    NGWave - Fast Sound Editor for Windows
  64. RogueWave by HapNstance · · Score: 2, Informative

    We have very similar needs in the medical software industry and we find RogueWave to be a pretty good solution for our cross platform C++ needs. They have various libraries (database abstraction, STL, math, etc.) which are all cross platform and provide decent performance. There is still some tweaking to be done to get all platforms to compile clean but it is much less than what we had before we moved to RogueWave.

  65. Erm.... No, sorry. by Anonymous+Brave+Guy · · Score: 2
    I do crossplatform day in day out, its NOT THAT HARD

    I seriously question whether your claim is true.

    I work on a serious cross-platform app at present. We build on something like 15 different platforms, from the latest Metrowerks CodeWarrior on the Mac and VS.NET on Windoze to antiquated HP-UX things and God knows how many Solaris builds.

    Today, I wrote a singly linked list class. I wanted it to be generic, so I defined it all using macros. Am I insane? Not at all. Several of our compilers don't support even basic templates properly, and if you look up STL in the help, you'll find no match. You can't get more modern compilers on some of these platforms, and even if we could, we're supplying to other development companies and are constrained to make our code work on whatever compilers they develop with.

    I could have written everything much more cleanly using templates, in much less time, or even faster still just used std::list, but then it wouldn't have built on something like half of our compilers. These things get confused when you combine overloading and overriding sometimes (what's the using keyword, anyway?) so more advanced techniques are right out of the Window.

    Boost is a fabulous thing. I sincerely hope that several parts of it make the next C++ standard, and fix up some of the glaring gaps in the current one. But while it's intended to be written in standard C++, and as time goes by it will become more widely useful, you could never call the sort of code they use "portable" in an industrial engineering sense at present. Portable amongst recent compilers on popular platforms, yes, but outside that scope, it's an academic toy that is of no practical use.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  66. Re:Gcc? Speed. by ProfessorPuke · · Score: 2

    Like he said , if i is declared previously, then there's nothing wrong. If you have

    int i;
    for(int i=0;in;i++); for(i=0;in;i++);


    Then you're fine. The compile might warn you that the second declaration of i shadows an existing variable, but that's all.

    (Me, I can't get over how ";in;" is supposed to be valid...)

  67. 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.

  68. Make File Alternatives by jaaron · · Score: 2

    Don't write Makefiles yourself. Instead write a script that translates simple build rules (foo.cpp -> foo.o -> foo.exe) into a custom Makefile for each platform. I went this route after battling for years with complex Makefile rules that never quite worked.

    A wonderful alternative to make is Jakarta Ant. It's java based, but there are ways to get it to work with C/C++ files and compilers. You can create an entire build/test/deploy process with Ant.

    --
    Who said Freedom was Fair?
  69. Re:Visual C++ Everett by Tony+Hoyle · · Score: 3, Interesting

    It doesn't mention Linux compatibility, only that it has been 'designed to appeal to the Unix and Linux communities' - basically they're pushing the standards compliance a lot.

    There will always be compatibility issues... VC.NET is a lot better than VC6 but there are holes, like MS' continued habit of putting underscores in front of 'unix compatible' names (snprintf for example), and calling other things completely differntly (eg. strcasecmp).

  70. Use Java & C++ native libraries by Crazen · · Score: 2, Interesting

    For the hevily computational stuff use C++ native libraries if the java "prototype" doesn't work for you everything else (persistance, interface, brokering) use Java.

  71. Abstractions, abstractions, abstractions. by AxelTorvalds · · Score: 4, Interesting
    Bummer, when you ask about this stuff, it's usually pretty late and there are often legacy decision that have been made that are hard to break free from. Or your young and naive and don't like something at work..

    This stuff is done for real. At IBM I worked on a very large project that compiled on AIX (several distinct versions that we were sensitive to) Solaris, Windows NT, Linux, HPUX, and supposedly OS/400 although I never actually built the OS/400 piece nor have I seen it operate. First things first, you need good coding conventions, don't let some punk break them either. Secondly you have to design some abstractions and build some foundation classes; or buy a really good set or downlaod some good free ones, I've heard positive things about ACE. This is mostly a problem with windows any more, back a few years you might support win16, win32, PM, and UNIX now it's pretty much just POSIX and Windows. You need to abstract the machine stuff out. Threads, possibly strings and such (Unicode vs. non-unicode..) possibly basic types (big endian vs. little) networking code.. A rule of thumb is that on this kind of project you should never talk to the OS directly without something in between, it's a huge effort to make that OS abstraction layer or learn the ins and outs of an off the shelf one but it's worth it, even if you pay with a little performance. Nothing sucks more than coding away on AIX building some cool classes and adding some cool new stuff, then checking it in and finding that it doesn't compile on any other platforms.. and you've got to figure that crap out ASAP to make a deadline. If you build one from scratch, as IBM usually does or did, you can tune some things for your application; your OS abstraction layer can be a great "helper" or "utility" layer.

    Typically well coded C and C++ can go from compiler to compiler pretty easily. Then you can use Pro64 on Mips, ACC on sparc, Intel C on Windows for performance critical portions of code. You have to be smart about it though and use some good conventions. The biggest rule would be avoid MS Visual Studio which is by far the most non-standard setup out there and if you do use it don't use their projects unless you have to. Some good make files with some good rules can help make this pretty easy. I don't know why more people don't do it but look at the Linux kernel's rules file. I have a Rules.make that I've built up and it includes things like different options for debug builds, profiled builds, and optimized builds, sets up some common rules for compiling C++ code and C code and what have you. My makefile include that file and then they are usually pretty short, generally not much more than a list of .cxx files and a library name. Then it's easy to make sweeping changes too. I think a good build system, one that will last should usually take a day or two to kind of put together pretty early on in a project, unless you can carp some good stuff from another project. The goal is a flexable and reliable build system that you don't have to worry about. Far too often people start cobbeling a build system together and then after 6-9 months it's broken and britle and hard to change because so many things have been changed and added through out the project. Put some effort in up front, consolidate your rules in to one place, use some environment variables to control some build switches. Use some shell scripts to figure out various things, not hundreds of lines of Bourne shell code, just little bits. Do this until AAP is ready and rocking and then use that. Also, if it needs to be said, use GNU Make; it runs damn near everywhere and it's pretty good at what it does the 15 minutes it takes to learn it will save you hours and even days worth of time in the long run.

    I'm a huge advocate of a solid and strong build. Mozilla is a project that festered for weeks or maybe even months becuase you couldn't build the damn thing when it went open source. Building code is something that can be done so well by tools that if you're worried about it then you need to fix the build. Building software is hardwork so take the pieces you can out of the equation, the build is the first one.

    Next, I assume you've abstracted out the GUI from the meat. If not, make this job one if you wish to have any chance in hell against your one platform competitors or even your mulitplatform competitors when you get down to it. View/Data Model and client/server: learn it, live it, love it. Or switch to a web based interface, lot's of people do it.

    While we're on abstraction. If you guys are really serious then you're probably going to have machine specific components. Look at /usr/src/linux/include and /usr/src/linux/arch for a starting point of reference. I would envision a project like this have a set of small Mips, Wintel, Linux-x86, etc. directories. Everything else can probably be compiled with GCC and then in those directories you'd have your assembly and machine specific compiled code.

    Lastly, you want to have a staged check in process. People hate not being able to commit code but at the same time you don't want them to commit code for real until it compiles on all of your platforms. Honestly, I don't know of a really good way to do this. Set up a build lab, do nightlies against the real code. Do nightlies against the "staged" code. Then have some kind of weekly merge meeting. That's how I've seen it, it's time consuming and somewhat painful. You bite off too much and you're spending a shitload of time merging stuff.

    1. Re:Abstractions, abstractions, abstractions. by chrestomanci · · Score: 2

      Mod parent up (...Oh it is +5 already)

      Seriously, this is very good advice. I have worked in a company that produced a multi platform product for embedded devices, and that is exactly what we did.

      (6 CPU architectures, 5 operating systems, and every available permutation of the two, about 20 in total, It was especially hard in our case, because as our product was for embedded systems, we could not use any complex client-server architectures, or make use of cross platform interpreted languages like Java.)

      The other thing I would say is that if the product is for visualisation, it may not be possible to separate the GUI from the back-end, as the main work will be in rendering and visualisation.

      Another company I worked for sold visualisation software for medical data (CAT or MRI scans, ultrasound images etc). Most of the work the software did was in rendering a huge 3D dataset for the screen, It would not have been possible to put than in a Java back end, as the performance would not have been available. The software had to use every (non portable) trick available to get the performance needed. If this is your situation, you will probably end up writing the same inner loop optimised for each of the targets you are using. The trick is to use a build system that means that is all you have to re-write for each platform.

  72. Re:Gcc? Speed. by aminorex · · Score: 3, Interesting

    gcc 3.2 is generally superior to VC++ emitted code,
    in my experience.

    Mingw32 is the target of choice if you don't want
    to license Cygwin.

    --
    -I like my women like I like my tea: green-
  73. 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?

  74. Cmake (and some other observations) by CFN · · Score: 2

    It seems you have two issues: having a managable build environment, and finding different compilers that agree on what c++ is.

    There is an utility, CMake (do a search), which is a CrossPlatform make tool. You set up some high level specifications (which files belong to which object, etc.) and it generates the platform specific make files (or VisualStudio projects) automatically. I have used it a little bit, to develop the software for linux and windows, but don't know if it would meet all your needs.

    As far as getting all your compilers (and headers, and libraries, etc.) to agree, the easiest solution would be to use the same compiler on each platform (gcc). To address some comments others have posted: for numerical applications running on Windows (at least the ones I compile), gcc by far outperforms VC7. It is a much more agressive optimizer, and has optimizations for P4 that VC does not yet have.

  75. Yes by AKAImBatman · · Score: 2

    Go to java.sun.com and you'll find the 64 bit VMs designed for Sun's big iron. These VMs are the ones that take ultra busy J2EE servers to task.

  76. 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
  77. Uh.... not quite by devphil · · Score: 2


    You're confusing C and C++ libraries.

    glibc is the GNU C library, and the system library for most Linux platforms. The C++ library is libstdc++-v3, which is completely separate.

    The MS 6.0 compiler used the most recent version of Dinkumware's C++ library at the time. I don't know what they used for 7.0, but Dinkumware has continued to update and improve their libraries. They even had bugfixes for their headers that MS hasn't included with 6.0, so you could patch them yourself.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  78. Re:Might I *STILL* suggest... by jericho4.0 · · Score: 2
    You're right about all that, but , IMHO, perl is the wrong choice for any large project.

    I love perl, for one page, quick-n-dirtys. But it's 'more than one way to do it' aproach leads to confusion and strife in larger projects.

    May I suggest a look at Python?

    --
    "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
  79. Mac OS X is the best for programming by afantee · · Score: 2, Interesting

    I have been programming C++ professionally for over 10 years on many Unix and Windows platforms (Sun Forte, MS Visual Studio, etc), and I can tell you that nothing comes close to ProjectBuilder, InterfaceBuilder, and dozens of other tools on OS X. The good news (for those who always think everything Apple must be expensive) is that they are absolutely free, so save that $2500 for Visual Studio.NET and buy yourself a decent G4 TiBook with a real OS and all those free tools.

    With GCC 3.1, you can programming in mixed C / C++ and Objective C / C++ in the same file or project. ProjectBuilder provides the best IDE and CLI for building multiple projects with dependency and multi-targets and multi-phases, apart from editing source files, icons, graphics, sound, document, etc.

    InterfaceBuilder is the only tool on earth that actually allows you to design and test professional UI with virtually no user code.

    1. Re:Mac OS X is the best for programming by Trillan · · Score: 2, Interesting

      I admit I have a Mac bias, but even so I found this part ridiculous "InterfaceBuilder is the only tool on earth that actually allows you to design and test professional UI with virtually no user code." Off the top of my head... Visual Basic, Delphi, Prograph, RealBasic, C++ Builder...

  80. Re:Java awt/swing versus QT by gregfortune · · Score: 2

    And Qt is soooo much easier to use :) The heavy licensing fee is something I'm willing to pay when do commercial development with a toolkit that makes my task substantially easier.

  81. Re:Might I suggest.... by binaryDigit · · Score: 2

    Actually my comment was not aimed at the validity of your ascertation, instead it was designed to point out the hypocracy of it.

    I don't want to come off sounding mean spirited, that is not my intention, but lets be real here. You're saying that "big business" as an entity has a tendency to put it's wants and needs before others. Well that sounds like pretty much most "living" things. Of course many do take this too far, both humans and corps, no denying that. But to generalize and stereotype and accuse but yet not do the sacrifices that would not group yourself into the same category as those you blast, now that is weak.

    As to your last statement, I completely, 100% disagree. Big business LOVES me (and you), because you and I are the ones that allow it to exist and flourish. We buy the products, we vote for the "bought" politicians, what's not to love?

  82. Re:Gcc? Speed. by Florian+Weimer · · Score: 2

    gcc is built for portability, not speed. VC++'s code is faster

    This is no longer true, vanilla Microsoft Visual C++ is not faster than GCC anymore. There are compilers which can do much better than GCC on certain platforms, but Visual C++ isn't one of the, usually.

    In addition, unless you've got some real-time applications which scratches at the limits of the currently available hardware, machine code quality doesn't matter a lot. If you use a compiler, you've already made a compromise in terms of effort vs. speed, and maybe you can shift the balance even further and concentrate on features which directly benefit your customers instead of dealing with cross-vendor compatibility issues.

  83. Re:autoXXXX not recommended (was: Re:GCC) by Znork · · Score: 2

    That's why you have a build environment and strangle anyone who plays around with it. As long as the build environment is identical with the target platform you dont get that sort of trouble.

    Autoconf and automake are a bit troublesome to set up, and they wont give you an immediate benefit until you migrate your checks over to use them, but there's a reason that so many portable opensource products use them. As long as you use them the way they're meant to be used they solve a whole range of portability problems, and will cut down the time spent on portability by a lot.

  84. Re:www.paulgraham.com by __past__ · · Score: 3, Informative
    No, that's just fluff, and list evaluation is the be-all & end-all of programming.
    Yawn. No, list processing is not the be-all and end-all in programming. That's why Lisp, for example, has arrays, hashtables, structs and a powerful object system.

    I don't care so much about Java, but with Python, it's just that a lot of its cool features are also in Lisp, like functions-as-data, classes with metaclasses and the ability to define and change them at runtime, dynamic typing, docstrings, the REPL/interactive prompt, keyword and "rest" arguments to functions, ability to fix bugs without having to stop the running program, ... However, it lacks, for example, macros (don't even try to compare the power and beauty of Lisp macros to the C preprocessor!) and good native code compilers, optional type checking and a variety of free and proprietary implementations all adhering to the same standard.

    As for syntax: Both Lisp and Python have the problem that people, esp. newbies, hate their syntax (the parentheses in Lisp and the significant whitespace in Python). Most people eventually get over it and even get to like it. Just because a language doesn't look like C doesn't make it bad.

    You are right about the lack of easy-to-find, ready-to-use libraries for common tasks, however (not about the "standardized" part, however. Last I looked there was no Python standard.) There are some projects to change that, for example CLOCC, but there's still a long way to go.

    IMHO, the single greatest problem Lisp has is non-technical. It is the (wrong) perception that the only data type in Lisp are lists, that there is no OO, or even iteration, that it is interpreted and slow, and generally dead. I'm not interested in forcing anyone to use Lisp, but I for one do like it, and if you are looking for a cool language to learn next, I'd say you definitely should have a look at it.

  85. Multiplatform Support Tools in C++ by MrWizard510 · · Score: 2, Interesting

    We use the 'understand C++' tool (www.SCITools.com) to provide a window into 1.5 million lines of C and C++ code. You configure this tool by telling it the subdirectory trees of your source code, and this tool builds a database of every file, object, line of source. It then provides both textual and graphical navigation tools for your code, including dependency trees.

    It has an integrated editor with syntax highlighting, and shows what code is #ifdef'ed out.

    I don't work for the company, but I've found the tool very useful. For your purposes, it should help locate where mods should be done, and what mods to do differently based on your different compilers and platforms. There are versions that run on Windows and Unix -- I use the Windows version, and 'point' it at my Windows and DEC VMS code.

  86. Java by hackus · · Score: 2

    Sounds like Java too me, with browsers as a front end. You can do some really wonderful stuff, and it won't take a long time to build with Java IDE's that are around for free.

    Java also is fairly easy to add multiple machines (spread out your Virtual Machines) to get more processing power out of commodity PC's. There isw simply no way your competitors could scale thier code on an equivalent Windows .Net implementation, it would cost way too much.

    I gurantee you if you proceed along those lines your competitors investment in .Net tools alone will save you the cost over the long run they will have to endure to maintain thier systems.

    Java 1.4 compiler technology (Virtual Machines) is very very good. If you are using numerical processing and large array types the effort you pour into C++ is simple not worth it.

    I am skeptical of your claims that Java is too slow. I suspect you haven't really used it for much of anything lately, because the slow excuse is an old one.

    You can go into any Barnes and Nobles book store and literally get a small stack on numerical procedures in Java and how to build distributed processing systems with Java, right off the shelf.

    If you don't know how to do it, let me know (reply), my company does these seemingly impossible things with Java everyday.

    -Hack

    --
    Got Geometrodynamics? Awe, too hard to figure out? Too bad.