views:

191

answers:

5

I'm interested in learning a programming language with support for GUI, multithreading and easy test manipulation (support for regex).

Mainly on Windows but preferably cross-platform. What does the Stack Overflow community suggest?

+1  A: 

I am a fan of Erlang:

  • Wx GUI tool

  • Regex (module regexp)

  • Cross-platform

  • Multi-threading (of course !)

  • EUnit testing

Of course Python is really appropriate too!

jldupont
+5  A: 

My suggestion would be Java. You can do all of that and much more.

ChadNC
A: 
  • Python is nice but has major problems with multithreading (unless you are using Stackless). it has nice support of multiprocessing, though. There're bindings to Tk (out-of-box), Qt, GTK and WxWidgets.

  • Ruby 1.8 has only green threads, and Ruby 1.9 uses native threads, but as @James Cunningham noted, it still has global VM lock, so it is limited in its concurrency too. It's the only of mentioned languages to have syntax-level regex support. AFAIK, it supports the same UI toolkits as Python.

  • Java supports native threads. It has two standard UI toolkits out-of-box (obsolete AWT and more modern Swing). There's also very popular SWT toolkit (Eclipse is developed with it).

If not you requirement of portable UI I would recommend you to use C#. It has more nice syntax then Java and generally less frustrating. But current state of UI on Windows and Linux is sad, unfortunately.

elder_george
You exaggerate about Python. The GIL does not prevent writing multithreaded software and there are tons of multithreaded apps written in Python. However there are some issues with doing GUI event loops and multithreading together http://www.informit.com/articles/article.aspx?p=30708 covers QT and this http://code.activestate.com/recipes/409244/ tells how to do it with GTK.
Michael Dillon
As hinted by Michael Dillon, problems with the GIL are *greatly* exaggerated. It does not prevent writing software that makes use of multiple cores; see the multiprocessing module. (If performance is of the essence, should you really be using Python, anyway?)Aside from that, Ruby 1.9 has a GIL, just like Python, so no (perceived?) advantage there.
James Cunningham
As far as I understand the way GIL works, it forces executing only one opcode at a moment. So, using threads we achieve tasks decomposition, but not performance boost at multicore. And yes, multiprocessing is a solution.@James Cunningham thanks for your note on Ruby 1.9. I've edited my post to include it.
elder_george
The GIL is specific of CPython. You shouldn't have any GIL with Jython (Python on JVM) or IronPython (Python on .NET).
Bastien Léonard
+1  A: 

If you really like typing go for Java, if you really like whitespace go for python, if you like programming more than you like high performance go for Ruby.

Seriously, Java is very complete and very cross-platform. I don't know how Python adds up for GUI stuff but when I was looking at Ruby in detail a couple of years back it seemed a trifle complex ( or at least, nothing is hard to write in ruby but it didn't look easy to produce a nice, modern-looking UI ) but I much prefer what I can achieve with a scripting language in terms of lines of code compared with Java's painful verbosity.

Erlang, which I see recommended above, I've never tried but it's a language I would be very interested to learn. Possibly well worth looking into if you're learning something new anyway, especially if multi-threading is important to you.

glenatron
A: 

I would call Tcl/Tk a natural choice for the features you listed.

But might be called old fashioned.

  • GUI - Tk, well integrated, looks okay if you know what your doing, you can also use Qt or gtk but thats a bit less common.
  • Multithreading - Tcl has both CoRoutines for cooperative multitasking, message passing based threads that do not have a global interpreter lock and scale nicely and in addition a built in event loop to make you need threads less
  • Test manipulation: you get a really flexible language to do test automation, add in the expect package and you have the tool of choice used for testing things like lots of routers, or with in the frame of DejaGnu the GCC testsuite for example.

Its usually easy to learn and has some cool features, but you won't usually find a job with it. The Tcl'ers Wiki is a good starting point, other points of interest might be The tkdocs homepage or the official language page at www.tcl.tk

schlenk