Slashdot Mirror


Platform Independent C++ OS Library?

quench writes "Hello! I have been away from Windows and Linux application software for 5 years or so, doing mainly C-like embedded C++ programming. Now, I am about to start a project emulating embedded hardware on Windows. Been there, doing #ifdef WIN32 and #ifdef LINUX stuff, don't really want to go there any more. What I actually need is a platform independent lib covering Windows and Linux variants to handle sockets, IPC and threads abstractions. And a rock solid but simple embedded database to emulate flash memory. My reflex said, go for ACE and Berkeley-DB. Tell me, am I out of time? Am I missing something new and trendy, easier to use and better? Did time stand still?"

66 of 310 comments (clear)

  1. JAVA by Anonymous Coward · · Score: 3, Insightful

    This platform independent lib you are looking for is called JAVA.

    1. Re:JAVA by HiThere · · Score: 3, Interesting

      That's not really a bad suggestion. Ruby, Python, even some dialects of Basic would work.

      Also consider Pascal. There are dialects of Pascal that have strongly attempted to be identical across platform boundaries.

      Additionally, anything that's running on a virtual machine would be a reasonable consideration. That includes qemu and xen, not just Java, Python, etc.

      What's at question are "What are the requirements??". Without knowing that, there's no way to know which, if any, of these suggestions are reasonable. Given that the initial language is C++, I'd expect that Pascal is the best replacement, with Java a close second. But if speed isn't a limiting factor than the other suggestions should be given consideration.

      Of course, what he's asking it probably more readily answered by something like FLTK, but it's hard to know, since we don't know exactly which features he needs to be handled by his library. FLTK is platform independent, and callable from C++, but pretty much only handles the graphic interface. If that's all he needs, then it's a good answer, but we don't know what his needs are.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    2. Re:JAVA by Jeremy+Visser · · Score: 2, Insightful

      One thing that appears to be a requirement is this must be a library for C++.

      There are C->Java converters.

      Let's play spot-the-difference!

    3. Re:JAVA by Anonymous Coward · · Score: 2, Funny

      I don't think you know what that word actually means. Let me look it up for you:

      Main Entry: moron
      Pronunciation: \mor-än\
      Function: noun
      Etymology: irregular from Greek mros foolish, stupid
      Date: 1910

      1 usually offensive : a person affected with mild mental retardation
      2 : a very stupid person
      3 : someone who uses a cross-platform language to solve a cross-platform problem

      Oh snap. They've gone changed the definition of moron - so I guess you were right!

  2. Qt by Anonymous Coward · · Score: 5, Insightful

    Nokia QT rocks...

    1. Re:Qt by KirstuNael · · Score: 5, Informative

      I concur. My Qt-powered multithreaded and networked (TCP&UDP) application is compiling and working nicely in linux, osx and win32 without any os-specifc #ifdefs.

    2. Re:Qt by d235j · · Score: 2, Informative

      Simple: They post source code at opensource.apple.com and since they keep away from LGPL 3, they can use signing to, in effect, do "tivoization." And the iPhone and apps have dynamically linked libraries.

    3. Re:Qt by HeronBlademaster · · Score: 2, Informative

      OP didn't say anything about UI, as you'd surely know if you had bothered to read the summary:

      What I actually need is a platform independent lib covering Windows and Linux variants to handle sockets, IPC and threads abstractions

      I wrote my own little socket class in C++ that does the Windows/Linux abstraction for me; they're mostly the same anyway, unless you want to get into epoll and such. I had planned to write a similar class for threads, but the idea is not exactly appetizing. I'm told boost has a thread class that might do the trick.

    4. Re:Qt by Anonymous Coward · · Score: 4, Informative

      Point for point:

      - sockets
      - IPC
      - threads abstractions
      - Database. Well, not quite so simple, but Sqlite3 as backend is available.

    5. Re:Qt by morgan_greywolf · · Score: 2, Informative

      Or GTK. Or specifically, gtkmm. Recent builds of GTKmm and Glibmm include stuff for handling sockets (Gtk::Socket). threads (Gtk::Thread, Gtk::Mutex, etc.) and IPC (GTK::Plug). Don't forget the GIO stuff, too.

    6. Re:Qt by rtfa-troll · · Score: 4, Informative

      OP didn't say anything about UI, as you'd surely know if you had bothered to read the summary:

      QtCore has more or less nothing to do with UI.

      --
      =~ s,(.*),<sarcasm>$1</sarcasm>,g if any_point_you_wish();
    7. Re:Qt by Lord+Kano · · Score: 3, Informative

      It's LGPL (So it's free for commercial projects as well)

      I'm sorry to nitpick, but this is an important distinction. You can use GPL code in a commercial project. I don't think that there's any dispute that RHEL is a commercial product. LGPL allows you do use code in proprietary projects.

      LK

      --
      "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
    8. Re:Qt by jmv · · Score: 4, Interesting

      I've once attempted to use Gtkmm for a new project. While the API is generally well designed, I found that the documentation for many features was totally inexistant. Even more annoying was the fact that some components were either buggy or not wrapped (from C Gtk) at all. Combined with the fact that components get created and deprecated at a huge rate, you don't even know what you should be using. Overall, I've had a really bad experience with Gtk (and especially gnome) development. I've only tried using Qt a little bit and so far I like it a lot. I've never done GUI with it though. I've used the "platform independent system library" part for things like threads, sockets and the like. The only thing I found a bit annoying was that it didn't integrate well with the STL.

    9. Re:Qt by digitalunity · · Score: 3, Funny

      Mono on windows isn't there yet.

      --
      You can't legislate goodness. Let each to his own destiny, by will of his freely made choices.
    10. Re:Qt by Doppler00 · · Score: 2, Interesting

      Qt is okay for networking applications, but in my experience Boost has much, much better performance, not to mention better support for things like multicast without creating some hacks. Qt ends up using a lot of Qt specific classes internally to create buffers and network functions, so it ends up being slower than Boost which seems to act more as a wrapper than anything.

    11. Re:Qt by TemporalBeing · · Score: 2, Informative

      Qt is okay for networking applications, but in my experience Boost has much, much better performance, not to mention better support for things like multicast without creating some hacks. Qt ends up using a lot of Qt specific classes internally to create buffers and network functions, so it ends up being slower than Boost which seems to act more as a wrapper than anything.

      But does Boost provide behind the scenes threading?

      One of the things I've noticed with Qt is that they went out of their way to make the best possible performance. There's a lot of Qt classes (such as QTcpSocket) that implement threading behind the scenes so the performance is really hard to impact your application with (not impossible but a lot harder).

      Additionally, while there are a lot of things you do need to use the Qt classes for, it's typically very easy to convert many of those classes to and from C++ STL. Nearly all classes that have an STL equivalent have a function to convert the class to that STL equivalent or to to be initialized by an STL equivalent.

      Furthermore, you can easily intermix Qt Signals/Slots with other Signal/Slots implementations - such as the version provided by Boost. If you use the standard terminology then Qt will gladly use the third party Signals/Slots mechanisms itself; otherwise, you can use a couple macros (Q_SLOTS, Q_SIGNALS) to specify that you always want these signals/slots to be run via the Qt Signals/Slots.

      Honestly, I can't say that any other API platform has so much provided and so many methods for working with language native and third party mechanisms.

      The only thing that took a little getting use to was: (i) using a lot of pointers without having to keep track of quite all of them since the Qt Object Meta-systems does a lot of the cleanup for you (so long as the QObject has been parented), and (ii) Signals/Slots across threads requires a special QThread class implementation that only has signals with an internal class instance that has the signals/slots you would normally expect. Otherwise, Qt is the most intuitive, well documented, platform agnostic, and high performing framework out there.

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
  3. Boost? by piojo · · Score: 2, Informative

    I know Boost has threading support, but I'm not sure how much. Have you looked at that? (It also has a bunch of other useful libraries, perhaps Filesystem being pretty useful for cross-platform work.)

    --
    A cat can't teach a dog to bark.
    1. Re:Boost? by Homburg · · Score: 4, Informative

      Boost has pretty strong threading support, which is the basis for the threading capabilities in the forthcoming revision of the C++ standard. Boost also has cross-platform IPC and socket libraries. It would be a good choice for the OP, I think.

    2. Re:Boost? by Profane+MuthaFucka · · Score: 2, Funny

      No, USE Boost for exactly those reasons. It's an extremely advanced library, and working with it will quickly make you a much better C++ programmer.

      --
      Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
    3. Re:Boost? by Pseudonym · · Score: 2, Interesting

      That's correct. Boost has the most stringent code review practices of probably any open source project.

      This seems like an anti-open-source thing to do, but it's critical considering what Boost has to do. It's partly that library of infrastructure that all serious C++ projects need before they start, and partly the place where additions to the standard library are born. Boost development is slow, but Boost code is bulletproof.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  4. many choices by Anonymous Coward · · Score: 2, Interesting

    NSPR, APR, boost system, threads

  5. Qt by Anonymous Coward · · Score: 5, Informative

    Use Qt. It's LGPL (So it's free for commercial projects as well), is well documented and offers a ton of abstractions (including sqlite).

    http://qt.nokia.com/

    And tool support is excellent as well (Visual Studio Add-In, Eclipse Plugin and a standalone IDE called QtCreator).

  6. Pthreads by SoftwareArtist · · Score: 3, Informative

    I've used Pthreads successfully as a cross-platform threading library. http://sourceware.org/pthreads-win32 is a quite good implementation for Windows, and it's built into Linux (and all other POSIX compatible OS's, such as OS X, as well).

    --
    "I'm too busy to research this and form an educated opinion, but I do have time to tell everyone my uninformed opinion."
    1. Re:Pthreads by QuoteMstr · · Score: 2, Interesting

      pthreads-win32 is excellent, but regrettably, LGPL licensed. It's interesting to note how complex it has to be to give you POSIX semantics --- pre-Vista win32 threading primitives are fundamentally flawed.

      Vista, on the other hand, gives us brand-new innovative 21st-century Microsoft technologies like condition variables.

  7. Qt or GLib by ciroknight · · Score: 2, Informative

    Qt's "Core" library is a pretty solid platform shim. Plain GLib is also (somewhat easier to port due to no C++ ABI differences, but no native C++ api makes it less attractive to you).

    Either one is an exceptional choice.

    --
    "Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
  8. TBB works wonders for threading by Wrath0fb0b · · Score: 5, Interesting

    Intel Thread Building Blocks (http://www.threadingbuildingblocks.org/ is (are?) fantastic. Open source (GPL), works on any ISO-compliant C++ compiler and is fairly intuitive. It allows both high-level (parallel_for) and low level (task-based) parallelism. Particularly useful are the concurrent containers, since it saves you from reimplementing these basic structures.

    1. Re:TBB works wonders for threading by Wrath0fb0b · · Score: 3, Informative

      From the FAQ - http://www.threadingbuildingblocks.org/wiki/index.php?title=Licensing:

      TBB is available under the common OSS license GPL v2 with the libstdC++ Runtime Exception. This is the same license used for a variety of well-known OSS applications including MySQL, NetBeans, and the Linux kernel.

    2. Re:TBB works wonders for threading by PCM2 · · Score: 3, Informative

      You're quoting from the commercial license. TBB is quite explicitly dual-licensed. If you don't like the terms of the commercial license, you have the option to use it under the terms of the GPL v2.

      --
      Breakfast served all day!
  9. Boost by aePrime · · Score: 4, Informative

    Boost has libraries for each of these three: sockets through the ASIO library, IPC through the Interprocess library, and threads through the threads library.

    http://www.boost.org

    The only thing that Boost is lacking for which you asked is a database library.

    1. Re:Boost by mls · · Score: 4, Informative

      SQLite databases are small, powerful and platform independent and might be a good choice to fit your database needs. The code is public domain.

      --
      -mls
  10. As someone working on a massive project... by QuoteMstr · · Score: 4, Informative
    I'm working on a rather large cross-platform C++ project at the moment. Here are a few tips:
    1. Use Boost. It's a very liberally-licensed, high-quality library from the people who created the C++ language itself. It contains a ton of cross-platform libraries that do lots of useful things, from threads to regular expressions to writing testsuites and parsing command-line options. If Boost provides a piece of functionality, there's very little reason not to use its version.
    2. See rule #1.
    3. If you need cross-platform code that isn't in Boost, at least use the following approach:
      • Create a common interface definition
      • In separate files, implement the interface in terms of various platforms' primitives
      • Keep platform-specific code out of the rest of your program; if you can help it, don't even include platform headers in most of your program
    4. Use autoconf to handle platform idiosyncrasies. There are a ton of available macros to help detect things about a build platform.
    5. Write testcases. You should write tests for all your programs, but it's especially important to do it for cross-platform code because it's easy to break something and not notice.
    1. Re:As someone working on a massive project... by Anonymous Coward · · Score: 3, Insightful

      Use autoconf to handle platform idiosyncrasies.

      Ugh. Autoconf & automake are the most horrible things I've tried to use in recent times. These tools are far from simple and what works with newer versions of the tools isn't even compatible with older versions. The syntax is antiquated and there are multiple ways to achieve the same thing each with different pitfalls.

      Somewhere there is a meteorite set to strike autoconf. I hope it gets here soon since it's about 20 years late...

    2. Re:As someone working on a massive project... by Anonymous Coward · · Score: 5, Funny

      it is all well and good, but he cannot even read options 3,4 and 5 because of your recursion!

    3. Re:As someone working on a massive project... by Pseudonym · · Score: 2, Informative

      Use Boost. It's a very liberally-licensed, high-quality library from the people who created the C++ language itself. It contains a ton of cross-platform libraries that do lots of useful things, from threads to regular expressions to writing testsuites and parsing command-line options. If Boost provides a piece of functionality, there's very little reason not to use its version.

      Agreed, but you left out one crucial reason: If you use Boost today, this maximises your chances that your code won't need very much porting to work with the C++ standard library of tomorrow.

      Use autoconf [...]

      I'd like to agree here, but IME autoconf and Boost.Build don't work so nicely together.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  11. Re:Apache Portable Runtime by boilednut · · Score: 5, Informative
    From the wikipedia articel:

    APR was originally a part of Apache HTTP Server, but has now been spun off into a separate project of the Apache Software Foundation, and is used by other applications to achieve platform independence. The range of platform-independent functionality provided by APR includes:
    * Memory allocation and memory pool functionality
    * Atomic operations
    * Dynamic library handling
    * File I/O
    * Command argument parsing
    * Locking
    * Hash tables and arrays
    * Mmap functionality
    * Network sockets and protocols
    * Thread, process and mutex functionality
    * Shared memory functionality
    * Time routines
    * User and group ID services

  12. wxWidgets might work by Beached · · Score: 2, Informative

    wxWidgets (aka wxWindows) does windowing, sockets, thread. I am not sure about DB, but I think it does. I haven't used it for DB yet.

    --
    ---- aut viam inveniam aut faciam
    1. Re:wxWidgets might work by Thundersnatch · · Score: 2, Insightful

      It also does infuriating bugs. Programs that work fine with small amounts of data explode when you get them into production. Doom!

      And why, exactly, are your programs not exposed to realistic data sets until they are in production? I don't think you can blame wxWidgets for that massive failure.

  13. Re:ACE is great! by mallan · · Score: 3, Interesting

    Qt has been modular since ver 4, so you don't have to include the GUI components if you don't want to. The API is clean, elegant and consistent, plus the documentation is great. I don't have anything bad to say about ACE or Boost - they're both high quality toolkits - but if I had to choose just one toolkit to use for the rest of my life, it'd be Qt, hands down.

    --
    "Good people drink good beer"
  14. Cygwin or UWIN by jdb2 · · Score: 4, Interesting

    If you want "close to the metal" POSIX API compatibility then there's Cygwin which is easier to use IMO and more actively developed but doesn't support the *full* POSIX spec or there is UWIN which supports most of the POSIX spec.

    Combine this with OpenGL, OpenAL, the SDL and Cygwin/X, QT, a Java layer using the SWT from Eclipse, *shudder* GLUT *shudder* ;) or IMNSHO preferably wxWindows/wxWidgets and you've got yourself a full cross-platform programming toolkit that can do just about anything.

    jdb2

    1. Re:Cygwin or UWIN by TheNetAvenger · · Score: 3, Informative

      If you want "close to the metal" POSIX API compatibility then there's Cygwin

      Ok, but this is borderline 1990s thinking or a bit insane...

      You would be better off telling the person to just use the SUA of NT and develop a full *nix OSS solution and ignore Win32. As this is effectively what you are getting with Cygwin, except the SUA of NT is a full BSD subsystem that DOES RUN AT METAL 'so to speak' and doesn't have all the horrible 'kludges' of Cygwin.

      I mean seriously, I think people forget that NT does a very good V5 and BSD Unix already, that is far beyond POSIX compliance and yes even beyond Cygwin crap.

      ----

      To give a good answer to the OP, it would help to know what they are doing a bit more, as just knowing if they ware writing GUI or non-GUI code makes a BIG difference in picking a common or easily portable library. Also performance, what kind of performance do they need? Depending on what they are doing I could recommended truly using the SUA or Java or *gasp* .NET via Mono or QT or a ton of other solutions that do work and work well. Hell they might be doing an application can should be shoved into something like Silverlight.

  15. You might want to look at Zoolib by Orion+Blastar · · Score: 2, Informative

    Zoolib at Source Force under the MIT open source license. It has a flat file database format, exists for multiple platforms, has platform-independent thread and mutex classes, graphical user interface toolbox, thread-safe reference counted smart pointers, file access, TCP networking. You can ask the main developers Andy Green or Michael Crawford to port it to a new platform that isn't supported yet, but it supports all of the platforms listed on the source forge page.

    The Zoolib Cookbook can help you get started.

    The flat file database support is designed in Zoolib so that you can email someone the database file and they can click on it and open it up as an email attachment.

    --
    Remember, Slashdot does not have a -1 disagree moderation, and no, troll, flamebait, and overrated are not substitutes.
  16. Sorry, C variants aren't trendy... by CptNerd · · Score: 5, Funny

    Unfortunately all the trendy cool kids are using Java these days, and only web-based applications are worth working on if you want to keep up with the times. The days of small, simple client-server apps are over, old hat, out of date, archaic. Nowadays you need to implement a web application using AJAX, web services, Struts and Spring and Hibernate, and you have to do it using Agile methodology. If you aren't linking in at least 100 Java class libraries, you don't have a "real" application.

    C++? Too simple.

    --
    By the taping of my glasses, something geeky this way passes
    1. Re:Sorry, C variants aren't trendy... by Trepidity · · Score: 2, Interesting

      C++ has a lot of properties, but "simple" is hardly one of them. It's got so much stuff munged into it that the spec contains literally hundreds of pages special-casing bad interactions between features, and it takes a gigantic effort just to determine the type of an expression. Parsing C++ is actually not only not context-free, but undecidable, in general. It takes a heroic effort to determine whether A f(B,C); is a function declaration, or a call to a constructor. Static resolution rules are horrifically complex. The interaction of templates with everything else in the language is riddled with pitfalls. Etc.

    2. Re:Sorry, C variants aren't trendy... by JustNiz · · Score: 3, Funny

      >> It's got so much stuff munged into it that the spec contains literally hundreds of pages special-casing bad interactions between features, and it takes a gigantic effort just to determine the type of an expression.

      Yeah I'm so glad Java came along... oh wait...

    3. Re:Sorry, C variants aren't trendy... by cerberusss · · Score: 2, Interesting

      C++ has a lot of properties, but "simple" is hardly one of them.

      We use Qt at my job for creating servers, daemons, interacting with hardware as well as doing GUI stuff. You don't really need to use the fancy C++ stuff, it's OK to just use the Qt classes and be done with it. Our code almost looks like Java, so simple.

      --
      8 of 13 people found this answer helpful. Did you?
    4. Re:Sorry, C variants aren't trendy... by dgriff · · Score: 2, Funny

      C++? Too simple.

      That's not a statement you see very often.

  17. Yu left out one #ifdef by tomhudson · · Score: 2, Insightful

    #ifdef __BSD__

    BSD and linux are different in some aspects when it comes to sockets. Made it a real PITA to code on linux, runs perfectly, then won't compile on BSD without a few more includes and some extra code.

  18. Re:C++ is so old school... by cbhacking · · Score: 3, Informative

    It's mostly because they aren't answering the OP's question, and aren't contributing any useful information to the discussion. Compare the posts above with the following:

    From what I've heard, one of the best cross-platform libraries for C++ is QT, (originally developed by Trolltech, now by Nokia). It's available either open source (LGPL) or commercially, and while best known for its UI toolkit also provides an extensive library of other functions. Wikipedia has a long list of things it has been used for, and other information.

    On the other hand, if you're not too wedded to C++ specifically, Java, C#, or Python might be good alternatives. Syntax-wise, C# and Java are extremely similar to C++, and all three have extensive libraries (built in) that provide the functionality you're looking for. They're also cross-platform (with C# you'd need to stick with stuff Mono can do, but that's still pretty extensive) and you don't even need to re-compile. Speed-wise, both Java and C# are nearly as fast as native code for most applications today, as are certain Python run-time environments. If you need explicit memory management for something, you can even do that with C# (although at that point it may be better to stick with C++).

    --
    There's no place I could be, since I've found Serenity...
  19. Just use POSIX by Anonymous Coward · · Score: 2, Insightful

    That handles all the things you mentioned, and you can compile pretty much all the same code natively on Linux or using Cygwin on Windows without having to bother with #ifdeffery at all.

  20. Boost and sqlite by rudedog · · Score: 3, Interesting

    For most cross-platform stuff, boost will do what you need. boost::thread will handle all of your threading needs.

    boost::filesystem for manipulating pathnames; boost::datetime for date and time operations; boost::format for typesafe printf style I/O.

    It also has boost::asio for sockets and boost::interprocess for IPC. I know nothing about them, but to judge from the quality of the rest of the boost library, they are probably very good.

    For database, use Sqlite. It's a solid relational database stored in a single file, and you can even access the database from the command line for ad-hoc queries/debugging/whatever.

  21. Apache Portable Runtime by Jester99 · · Score: 3, Informative

    You say that you're writing a lot of "C-like" embedded C++. Are you doing fully OOP style coding and using 'new' and 'delete'? Or are you mostly taking advantage of conveniences like namespaces, scoped variable declarations, etc?

    If your code is really more C-ish, you could take a look at the Apache Portable Runtime (http://apr.apache.org/). The APR is the library that Apache httpd is based on; they cover most system-level utilities (sockets, files, etc) you could need in a portable way. The APR is more 'C-like' in that a file descriptor is an opaque handle which you pass in to functions like apr_file_puts(), etc., rather than doing the C++ thing of file->puts()..

    But if you're ok with the syntax, it's Apache licensed (corporation friendly), well tested (httpd is pretty ubiquitous after all) and actively maintained.

  22. Re:C++ is so old school... by Profane+MuthaFucka · · Score: 5, Informative

    Yes, QT is really excellent, but it's worth it to look at Boost as well.

    Want a database? Why use Berkeley when there's SQLite?

    Portable sockets? QT and Boost both have them.

    Portable file ops? QT and Boost both have them.

    Data structures? QT has a bunch, but STL is what you should learn.

    Windowing lib? QT works on both Windows and Linux. You may be tempted to use WXWidgets, but don't. Despite the fan boyz, you'll find that library to be buggy as shit, and impossible to debug. Sorry, that'll probably get me marked as a troll, but it's true.

    And QT on Windows comes WITH the MinGW compiler for Windows package. You don't need to use any other tool than gcc on Linux, Mac, or Windows.

    --
    Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
  23. Re:Boost and POCO by Profane+MuthaFucka · · Score: 2, Informative

    No, POCO is not very good. The documentation is poor, and it's buggy.

    --
    Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
  24. SQLite for database by PizzaFace · · Score: 2, Interesting

    SQLite dominates discussions of embedded databases these days, but Berkeley DB still has fans who don't need SQL. There are a lot of comparisons on the web.

  25. Heh, ACE is for old foggies by solid_liq · · Score: 2, Insightful

    Duh, Qt!

  26. Re:Microsoft POSIX Subsystem by alexmin · · Score: 2, Informative

    The sole reason for POSIX subsystem in WIndows was to satisfy formal criteria in some US government specs. No one is using it to actually _code_, AFAIK.

  27. Another couple of options by EvilIdler · · Score: 2, Interesting

    There's always wxWidgets, which you can compile into your program if you feel like it. Quite liberal.
    It's not a mere library, but a full framework, like Qt. I find the wx runtime to be smaller than an equivalent Qt program most of the time, and the Mac version of Qt's dylib bundler sometimes makes some stupid decisions which bloat the app by 50MB. wxWidgets (statically linked) gives me a 1.7MB executable for a Hello World-ish program.

  28. Your App Will Suck Anyway: So Use Java by RonBurk · · Score: 2, Funny

    The Java repliers are right on the mark. Trying to use app-independent portability layers ensures apps of any complexity will suck. By "suck", I mean "compromised at every turn by lowest-common denominator design decisions". Your app will end up using threads on an O/S designed to make multi-processing beautiful (Linux), or end up using multiple processes on an O/S designed to make multi-threading beautiful (Windows). It'll be clueless about the nifty GUI features that exist on a Mac but not Windows, and vice versa. Knowing up front that your app is going to suck allows you to, in all good conscience, choose a language that highly adapted for creating apps that suck in this manner. When I fire up a Java app on Windows (and I ALWAYS know it's a Java app the minute it finally manages to lumber onto the screen), I know I'm going to get the same sucky behavior if I fire that app up on a totally different platform (well, assuming I can manage to figure out whatever obscure infinite-megabyte downloads are needed to get the right "runtime engine" for the given app). Really, the only way you can make your app suck even more and be even more portable is to just go ahead and make it a web "service". That has the added advantage that nobody really expects anything but poor performance and clunky UI design from the get-go. But if for some reason you can't have your app suck as bad as a web service, then Java is definitely the next-suckiest way to achieve that portability that your end users don't give a crap about, but you hope will make your life easier.

  29. Re:Boost and POCO by gbjbaanb · · Score: 2, Informative

    agreed, I used POCO for its email classes, and while it worked its documentation was somewhat out of date or incomplete. Still, I could figure out what was needed. what I didn't like was their adherence to the 'one true OO way' of developing libraries, too much of an exception hierarchy just isn't good.

    I didn't try the other parts and am probably not likely to. If boost had some general purpose classes (instead of mostly algorithms and general purpose classes) then I wouldn't have even looked at Poco.

  30. Java, Perl, and WxWidgets... by taoboy · · Score: 3, Insightful

    ...are ones with which I have the most experience. WxWidgets IMHO is the best 'close-to-the-metal' API, with the most available constructs to allow me to implement in C/C++ the Perl prototypes I develop. But most recently I've been noodling with Java to develop a high-availability platform, and I regularly run multiple jvms in Windows command shells to build stuff out, and then take the classes unchanged to a ttylinux-SunJRE-based cluster I run with VirtualBox.

    I'm not a Java advocate by any means, but you can't ignore the portability...

  31. Re:Unfortunately probably not worth it by Anonymous Coward · · Score: 2, Interesting

    I have long given up using the threading module in python itself, and have actually been using the Parallel Python module written by Vitalii Vanovschi extensively for my parallel processing needs. If you need multi-core / cluster processing and want to stick with python, this library is quite excellent. http://www.parallelpython.com

  32. Has any one here every written an emmulator. by strangeattraction · · Score: 2, Funny

    Obviously there are not a lot experienced embed heads reading slash. Java:( If you don't like ifdef this or that try Java. Instead of ifdef, Java programmers us xml in what I call program by configuration file. It adds an entirely new dimension to programming that most skilled programmers would never have thought of. It is even more delightful when they use multiple overrides on their configurations files and you have to hunt through multiple files to to see how things are configured. Not only that, they can actually change the way code executes with configuration files. So not only do you have to look at code to see execution paths, you have to dig through multiple configuration files. It is truly the strangest methodology I have ever encountered. Stick with a C or C++ library. QT works well. For key value searchers Berkeley has no peer but SQLite works ell if you are into SQL.

  33. POCO project by jbb999 · · Score: 2, Informative

    Definatly take a look at poco project http://pocoproject.org/ It seems to covera lot of what you want

  34. Re:C++ is so old school... by Hal_Porter · · Score: 2, Funny

    I think modding people Troll is the /. equivalent of smacking dogs on the nose with a rolled up newspaper when they defecate in the apartment. I.e. it's just a way to stop them doing it again. Clearly no one wants to read "Why not use Java?!" in these sorts of discussions. Now you can't explain to a dog why indoor defecation is bad, just like you can't explain to Java programmers why Java is just a bad idea. Still shit in the apartment and posts advocating Java is not something which you need to tolerate.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  35. Try TnFOX by ned14 · · Score: 2, Informative

    I also come from an embedded background and I didn't find a C++ platform abstraction library to my liking (i.e. fun to use and giving the programmer maximum power and control), so I went off and wrote my own: http://www.nedprod.com/TnFOX/ (docs are at http://tnfox.sourceforge.net/TnFOX-svn/html/). You can build a noGUI version which leaves out all the GUI stuff which should provide what you want: it also has a type reflecting metaprogramming database adapter with a copy of SQLite3 thrown in for good measure, and it is very seriously fast and efficient unlike most GUI toolkits e.g. all the bottlenecks use assembler or intrinsics and there is ample stream computing support which uses metaprogramming to assemble vector instructions. One major difference from libraries such as ACE is that I deliberately made TnFOX as fun to program in as possible - I have made zero attempt to make it academically "proper" or "pure".
    Hence it does come with an unusual programming paradigm - I make heavy use of C++ metaprogramming constructs and C++ exception handling and pervasive multithreading. And almost no one else uses it which I take it to mean that its learning curve simply isn't worth it for most people which is fair enough. In the end, if you ever want someone else to be able to work on your project then you need to use a well established toolkit which has a significant programmer pool attached to it. And ease of finding programmers is vastly more important than a "right" or "proper" or even "good" programming paradigm - as the designers of Plan 9, BeOS and NeXT found out.
    If your project is something recreational, do give TnFOX a look. If it's for something ever destined for outside your personal fun time, go with Qt or wxWindows or any big free portability library.
    HTH,
    Niall