views:

203

answers:

6

I'm not an electronics guy, so I might not be able to explain precisely what I need. This is a question a friend keeps asking me.

What my friend is looking for is a programming language that would allow him to:

  1. Interface with hardware (via serial and USB ports).
  2. Write multithreaded code.
  3. Throw together UIs very quickly.
  4. Port his code to Linux and OS X as easily as possible (okay, this is what I want).

He is building a tool for a local group that teaches very basic robotics to college students. Right now he's using C++, but writing the UI code in C++ is not exactly a fun task. He is also using some Windows-specific libraries for (1), which means I can neither try out his code nor help him with fixing bugs (I use a Mac).

EDIT: Libraries for Python/Ruby are welcome.

A: 

Ruby and Shoes (GUI) would work nicely, especially well suited to a learning environment / multiplatform

Edit - Found it (its a bit hard to find):

http://shoooes.net/

Chris
+4  A: 

You may want to have a look at the rather complementary Processing and Wiring tools. Processing is an environment for building user interfaces, and Wiring is an environment for programming I/O boards such as the eponymous Wiring board, its simpler cousin Arduino, and related devices. The Wiring boards typically communicate with a desktop computer over a serial link, or USB with serial emulation.

Jeffrey Hantin
+1  A: 

Java might be a good option here. It has libraries available for the low-level threading and communication APIs, and it should perform well enough for a control loop. I know it has a serial port communcations library, and I believe there are some open-source USB libraries. For the UI, you could use the Java 2D Graphics API, or for a more advanced UI you could try the slightly neglected Java3D or newer JOGL libraries. Swing has its faults, but it's actually pretty easy to use for making basic forms UIs.

Andy White
A: 

ACE (http://www.cs.wustl.edu/~schmidt/ACE.html) is a platform independent C++ library (no UI), QT (http://www.qtsoftware.com/products/) is a cross platform UI library for C++. Accessing hardware is unfortunately something that is still platform dependent)

lothar
+1  A: 

If you want easy and lots of supported hardware I think your best bet is Labview. It's all graphical programming (drag blocks, make connections) and many USB devices (DIO for instance) have Labview support. Serial support is built-in. It can make UIs rather easily (it's primarily intended for GUI control).

Stephen Friederichs
You need to remove your last sentence. LabVIEW is certainly not Windows only (http://www.ni.com/labview/how_to_buy.htm), in fact it originated on the Mac. And it certainly does multi-threading, in a way that is mostly transparent to the programmer. I won't down-vote your answer, though, because LabVIEW is certainly a good match for controlling hardware.
mghie
A: 

The easiest thing for your friend (using native Windows) would be Delphi. Lots of 3rd party components available (for Rs-232, etc.) and of course you can use any manufacturer supplied DLLs/Drivers. Delphi makes designing Windows UIs very simple and fast.

As for cross-platform support, take a look at Delphi Prism which is .NET based but is designed to work well with Mono.

SoftDeveloper