Best Language For Experimental GUI Demo Projects?
New submitter GrantRobertson writes with a question about quickly developing prototypes for new interface design concepts "My research/tinkering will be along two main lines: (1) Devising entirely new graphical user interface elements, mostly in 2D, though often in a true or simulated 3-D space. I am working on ways to visualize, navigate, and manipulate very, VERY large data-sets of academic research information. (2) Computer based education software, though of a type never seen before. This will combine some of the GUI elements invented in (1) as well as displaying standard HTML or HTML5 content via a browser engine My requirements are: (A) A decent IDE ecosystem; (B) A decent set of libraries, but ones that don't lock me in to a particular mind-set like Swing does in Java. (Boxes in boxes in boxes, Oh My!); (C) An ability to easily draw what I want, where I want and make any surface of that 3D object become a source for capturing events; (D) Ease of cross-platform use. (So others can easily look at my examples and run with them.); (E) No impediments to open-source licensing my code or for others to go commercial with it either (as I have seen when I looked into Qt). So, should I just stick with Java and start looking outside the box for GUI toolkits? Or is there something else out there I should be looking at?"
I'm not sure what impediments Qt has to proprietization of software since it's LGPL nowadays; in any case, Qt Quick and GNOME's Clutter seem like they could be a useful. Read on for more context.
"I am not a professional software developer and never have any aspirations to become one. I've been through a generic university computer science degree-program and I can tolerate C++ begrudgingly. I do OK with Java and prefer it, though I still have to look up every API before I use it. Most of the code I want to write will be not much more than prototypes or proof of concept stuff for the research I will be doing, rather than full-on applications ready for distribution and use. I can learn any language out there, if need be, but these days it is more about the ecosystem than the core language. IDEs, libraries, cross-platform compatibility, user support, open source licensing."
I'd be tempted to do it in English, but, given current demographic patterns, Chinese may be better in the long run...
Im sort of in the same boat (Graphic Designer with aspirations to be a UI/UX designer) and am learning to code of my own accord. I've had much success with Processing. It's really easy to get started and get functional code running. Also, you can run your processing files on a webpage with Java or Processing.js. I don't know about the large data sets you're dealing with, but since Processing is java based, I assume there won't be much difficulty
...I would recommend a careful combination of watercolor and origami.
If you need 3d and you are building your interface from scratch then you are probably going to want to use OpenGL in whatever language you are most comfortable with. Trying to bend an existing GUI toolkit into something it isn't designed to be will probably be more trouble than it is worth.
https://developer.mozilla.org/En/XUL
Multi-platform with Xulrunner, integration with HTML5 engine if needed.
Léa Gris
1. Processing (http://http://processing.org/) is great for visualizations, worth a look. It's used a lot for interactive visualisation tools
2. Clojure is a great option for general purpose prototyping. It has the advantage of being able to use all the Java libraries and tools, but on top of that is an excellent modern dynamic programming language with great code-generation capabilities. It's great for creating DSLs, for example there is a Clojure GUI library called seesaw that defines UIs like this:
(frame :title "Hello", :content "Hello, Seesaw", :on-close :exit)
I don't always write GUIs, but when I do, I prefer wx. But in all seriousness - I hate writing GUIs. I write embedded C for a living and am lost when it comes to the differences between window manager(s) on Linux or Windows or whatever. When I need to whip something up quick (and it's not embedded, and we're not going to sell it) sometimes I switch over to Python, and if that quick thing needs a GUI, wxPython (the port of wxWidgets from C to python) is something you can tack on there with minimum hassle. If you need a portion to be fast for your math calcs or whatever you can write that part in C. There's a boatload of tutorials via google (and youTube).
Well, Nokia open sourced Qt under the LGPL 2-3 years ago. I am a Nokia systems engineer. We are still the primary maintainers, but we are committed to keeping it that way (open source), and with the current moves of the company toward Windows Mobile on our high-end phones, we may well be considering pushing it out to the community entirely, but with some resources still assigned to it. I don't know for sure, but I'll try to find out what the plans are for it. Qt is an important part of our Meego and Symbian phones, which are still popular and getting a few new models. My own company phone is an N8 Symbian device.
A GUI in Visual Basic. I hear its good for this internetz stuff.
Yes...I know...Pascal..Ugh (it's a shame so many people under rate Delphi's Object Pascal). But, Embarcadero Delphi will enable you to build FireMonkey based apps that can run on Mac, Windows and iOS. FireMonkey still has a ways to go. However, if you look at the whitepapers posted on the Embarcadero.com website, you will see some interesting stuff. FireMonkey is evolving. Once of the nice things is that it can use the GPU vs the CPU for rendering. This makes 2D and 3D rendering a piece of cake. Additionally, FireMonkey controls can (and should be) stylized. The number of effects one can achieve for a simple button is amazing. Imagine what one can do in terms of designing new UI paradigms.
Are are some blog on using FireMonkey to render functions and demonstrate wave interference (in 3D).
http://blogs.embarcadero.com/ao/2012/02/02/39215/
http://blogs.embarcadero.com/ao/2012/01/30/39208/
http://blogs.embarcadero.com/ao/2012/01/27/39206/
and, for a commercial product by TMS Software http://blogs.embarcadero.com/davidi/2012/02/07/41510/
FreePascal w/ Lazarus is another way to experiment (and, get Linux and ARM as target environments as well). FireMonkey for iOS depends on the ARM compiler to bring the apps to iOS (at least until Embarcadero writes their own ARM compiler).
Granted, the tool isn't cheap. But, if you have the budget, it's worth adding to your tool bag.
Another alternative is getting intimately family with JQuery and the DOM. There is a lot you can do to experiment with new UIs.
What about QML? It's designed for rapid prototyping, it's cross platform, and you can extend it with C++.
There's no -1 for "I don't get it."
http://processing.org/
It's been ported to nearly every language, does 2d and 3d, has a straightforward syntax and lots of math libraries, physics engines, etc etc.
A fool throws a stone into a well and a thousand sages can not remove it.
As someone with experience with just about every major programming language. I'd seriously consider Javascript. Rather than "Embedding" something to render HTML, embed your special sauce in an HTML5 Canvas. Specifically consider writing it as a Chrome App. Not only will it be fast you'll automatically have a standard platform to release your work onto, no installer, no pain in pushing out updates as your work evolves.
See some examples here: http://net.tutsplus.com/articles/web-roundups/21-ridiculously-impressive-html5-canvas-experiments/
JSON is becoming the defacto data interchange format used by just about all web services and Javascript can also be used on the backend via node.js. You or anyone you're working with can easily learn javascript from places like http://www.codecademy.com/. Plenty of IDE support, but Chrome itself provides excellent debugging tools via "Inspection" and a javascript console which can be used as a rapid prototyping shell.
As an added bonus, javascript provides the best of both functional and object oriented programming, and just about every decent programmer knows javascript or can learn it easily.
Swing does in Java. (Boxes in boxes in boxes, Oh My!)
Oh my, is that what it troubles you? Let's see...
draw what I want, where I want and make any surface of that 3D object become a source for capturing events;
And you want to do this without imposing any hierarchy (of the type "boxes withing boxes") on the 3D object's surface, yes? Assuming that it is possible, once the event is generated, how would you implement the event processing if you can't discriminate on the type of your "event source"?
I do OK with Java and prefer it, though I still have to look up every API before I use it
Looking into every API, you say. And you say you'd like to finish looking in this life, so that you could do something?
My advice for this case: the shortest path to destination is the one you already know. Otherwise, if you don't plan to become a professional software developer, hire one.
Questions raise, answers kill. Raise questions to stay alive.
Are you really going to have time to learn something new with all that groundbreaking paradigm shifting you'll be doing?
Leverage your core competencies to push the envelope on impactful best practices, and hit the ground running - it's a win-win!
Synergy.
sic transit gloria mundi
to use Office products during classes in college, I think about how they wouldn't be above paying someone to spam slashdot with this stuff, over and over, even after the guy -specifically required portability-.
You dismissed the one framework that would do what you want. LGPL and if really necessary, Digia does not charge that much for a commercial license. I've been doing cross platform work for 20 years. Java was my first foray. Star Framework (Star Office was written with this) was a pretty good framework. But QT beats them all hands down.
If you want demonstrations and "proof of concept" stuff, you want a language which is expressive, not a language which is easy to learn or which generates heavily optimized code.
In the demo phase, you're not really worried about performance. The goal is to have something showing as quickly as possible, and not worry too much about how fast it runs, or how much memory it takes. Overspec your demo system for the time being (ie - make it really fast and install lots of memory), and once you have a reasonable interface go back and recode it in a simpler language which can be more easily optimized.
Languages which are simple to learn (c++, for example) are generally not very expressive. You end up wasting tons of time debugging issues of memory allocation, library interface details, and datatype conversion.
Languages which are expressive are a little harder to learn, but any individual line in the expressive language does a lot more. Since you are writing fewer lines, and since the fewer lines do more, you end up making programs more easily and in less time.
Yes, the programs will execute a little slower, but as mentioned, this is not important in the demo stage. Your productivity will be much higher.
Perl was written by a linguist, not an engineer. As such, it's harder to learn (it's got tons more keywords and context), but once you get the hang of it it's much more expressive. The following single line:
@Lines = sort { $a->{Name} cmp $b->{Name} } @Lines;
unfolds into several lines of C++, plus a subroutine definition with datatype definitions. The following line:
@Files = <c:/Windows/*.exe>;
can be implemented using one of over a dozen possible library calls in C++, but is builtin in perl. You don't have to look up the library call interface specific to your system.
I hear that Python is also expressive, although I don't use it.
Python Matplotlib covers some of what you might be interested in and it can be used with other GUI toolkits see http://www.scipy.org/Cookbook/Matplotlib and http://matplotlib.sourceforge.net/ - at the very minimum it might provide some food for thought about the feature-set you're seeking.
Don't assume too much in terms of playing nice with straight-up JAVA. I've been building a lot of interactive video projects (kinect interface with JSON queries to databases holding IP addresses, for mapping animations on spheres) and I've been using the Eclipse rather than the Proceesing IDE. There's a lot of weird shortcuts that the Processing IDE does to make it easy for n00bs (that's why I got into it ;) but once you start doing stuff with openGL, threading, or (most importantly for the OP) using fonts and UI elements, things get really convoluted. And the debugger blows.
Not to say you shouldn't do it-- but while the Processing learning curve is pretty easy, it gets quite steep when you want to incorporate more high-level functionality.
That said, there's a lot of libraries that will address most stuff you'll need in terms of UI elements-- controlP5 is one that deals with text fields, text boxes, etc, for instance.
My suggestion for you would be to check out Lazarus and Free Pascal. Lazarus is a cross platform and open source clone of Borland's (or whoever the hell own the company now) Delphi. Free Pascal is the compiler it uses, and it is pretty damn close to source compatible with Delphi, and also provides compatibility modes for other Pascal dialects as well, including it's own Object Pascal mode which fixes some of the stupid design decisions in the Delphi version of Object Pascal. The compiler itself has very speedy compilation times compared to C++ compilers, and generates decently quick code as well. The compiler itself is very mature and well maintained, and it gaining new features all the time. Lazarus is the IDE, which provides you with a RAD environment to quickly piece together the UI, and it is packed with all kinds of awesome features. The LCL, it's supporting library, wraps all of these functions up in a way that makes it very easy to deploy cross platform applications. It covers OSX, Linux (GTK+ and Qt), and Windows. The Free Pascal compiler can compile code for many more platforms, and has in fact supported some even before GCC. If you stick with the LCL, just about everything is covered between platforms and it uses the native components of the platform it is compiled for. It has a very healthy community, with plenty of bindings for all different kinds of libraries. It also provides a good method for creating custom components and reusing them, allowing you to install them in to the IDE and drag and drop them in the form designer just like you would with a standard button or text box. I've never done any stuff with 3-d graphics, but there's all kinds of OpenGL stuff available, and anything you can do in the native widgetsets you can do with Lazarus. The issue with Lazarus is that the IDE is still beta, and there still are a few bugs here and there, but they are fixed pretty quick, and there aren't any major show stoppers. The big issue is that it uses GDB for debugging (there is a native Object Pascal debugger in the works, but it won't be finished anytime soon), which is really aimed towards C based languages, so debugging isn't always smooth. Most of the basic tasks, like setting breakpoints and stepping through a program/function work fine, but there are a few issues with the differences between Pascal datatypes and C datatypes that can make things confusing.
The reason I recommend this tool is because even though it doesn't have a massive ecosystem like C++, it is coherent and works very well between platforms. The Object Pascal language is very easy to learn, it's powerful, and well designed. While not as fast as C or C++, is you look at the alioth debian language shootout page, it is pretty quick compared to other languages. It provides access to all of the familiar C library functions, and includes all kinds of stuff in the language for compatibility with the C language. It's not the old Pascal from the Turbo Pascal days that people like to bash, almost all of the complaints I hear about the language itself were taken care of a decade ago. The only issue I can really think of is that the language can be a bit verbose compared to C, but compared to Java it's pretty succinct.
Han Solo: Hokey religions and ancient weapons are no match for a good blaster at your side.
Obi Wan: But the forth will be with you, always.
do() || do_not();
"run rings around it" is a matter of opinion. I've used all 3 in anger, and I'm far and away more productive in Cocoa. Of course you'd use the gui interface builder (on either GnuStep or cocoa), that's an integral part of the system.
Pure cocoa would get you farther, easier - the GnuStep stuff imposes limits, but personally I'd use core data for persistence, quartz composer for data visualisation, Grand Central for parallelism (using NSOperation) and you can drop into C or C++ for performance when you need to. All basic building blocks that work well together and ObjC is far nicer to work with than plain old C and desnt have the gargantuan complexity of C++.
Simon.
(rather surprised that I was modded down to 0....)
Physicists get Hadrons!
I'd use [software environment and platform here] ...
No. Just use paper and pencil. Create a story board, http://en.wikipedia.org/wiki/Story_board, showing how the user will use the interface.
Go to the academics that represent your users. Ask them what they want to see in a visualization, how they expect to do a search, how they expect to manipulate things. Give them paper and pencil and tell them to just draw things however they think it should be, not what they are used to seeing in their current environment and applications, rather whatever they can imagine would be a good way, a way that feels natural.
Why not just use Flash & ActionScript, along with Unreal. Specifically, Scaleform. Since it already does the "never before seen" 3D GUIs you want, and game engines are particularly good at visualising extremely large data sets (we call them game worlds).
Any amount of searching "HTML 3D" would have turned up WebGL, which uses OpenGL in existing browsers... That would be a good prototype platform for me.
I take particular issue with the childish statements against using Java (and Swing), considering they already support 3D Swing components (see XTrans demo). Swing displays HTML components, even in tool tips. In fact, there is already an entire 3D collaboration framework in Java ready for any "Never Seen Before" GUIs you wish to dream up... It displays HTML, images, & PDFs etc.
Furthermore, their indignant remarks smack of ignorance, considering Java 2D & Java 3D exist, and both have rich non standard box shape intersection libraries, which can be used to create custom components of any shape or position, hierarchical or not restricted only in that they should be used in a Canvas, to save yourself some time.
They want someone to hand them a magic library that has all the bells and whistles already to go, but heaven forbid any of them have an API that requires using... Have fun inventing that shiny new wheel.
Absolutely, seconded.
Without a doubt, QT is the reigning king of quick, pretty and cross platform GUI development. And of course you would do that with C++ if you want your code to be most widely portable, and to put your demo in the best light by starting fast and responding fast. But QT works well with many other languages, including having excellent Python support. Here is an idea: use Lua both to drive your demos and be the embedded scripting language at the same time. That would rock.
Have you got your LWN subscription yet?