Is Ruby any good for GUI development? [closed] - ruby

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am considering creating a GUI-based tool that I want to be cross-platform. I've dismissed Java, as I personally do not like Swing. I'm currently considering C# and using Mono to make it cross-platform. However I'm wondering whether new-fangled cross-platform languages like Ruby can offer me a decent GUI development environment.

The short answer: no (because you said cross-platform).
The long answer: cross-platform GUIs are an age-old problem. Qt, GTK, wxWindows, Java AWT, Java Swing, XUL -- they all suffer from the same problem: the resulting GUI doesn't look native on every platform. Worse still, every platform has a slightly different look and feel, so even if you were somehow able to get a toolkit that looked native on every platform, you'd have to somehow code your app to feel native on each platform.
It comes down to a decision: do you want to minimise development effort and have a GUI that doesn't look and feel quite right on each platform, or do you want to maximise the user experience? If you choose the second option, you'll need to develop a common backend and a custom UI for each platform.
ruby is not a bad choice for your common backend.

You'll have Ruby/GTK, which allows you to use the GTK toolkit under linux. I think that should be working under Windows and Mac Os (as for Gimp, Gaim and so on).
A french magazine post a good beginner article about Ruby/GTK.
Edit : According to main page on the SourceForge project, Ruby-Gnome2 (aka Ruby/GTK) is cross-platform (Windows, Linux, Mac Os).

Ruby has Shoes, but that might be a little lightweight.

With Ruby you can use Tk, which is a mature, cross platform UI toolkit. It is the defacto GUI toolkit for Python and Tcl, and is also available for use with Perl. The most recent versions of Tk make use of native widgets which addresses the primary concern that Tk looks dated.
A language-neutral website devoted to Tk is http://www.tkdocs.com/ which includes examples coded in both Ruby and Tcl.

There's also FXRuby which has the benefit of a Pragmatic Programmer book, as well as wxRuby which is based on the wxWidgets C++ GUI framework.

being a wxperl programmer, i know that wxruby is there as well. Wx is pretty fast and has true crossplatform look and feel.

Take a look at Ruby GUI 2008 Survey Results and the discussion here. You will love to know.

Not sure about Ruby, but you mentioned Mono/C# -- I've used Mono and GTK# quite a bit lately and am very impressed. Seems to be pretty stable and cross-platform portability is nice.

Ruby/GNOME2 works pretty well. You can use Glade to drag and drop window elemtns and load it the UI from your Ruby app.

Have you looked at SWT on Java? It uses native widgets and is much easier to get a nice interface with it than Swing.

If you ever venture over to the mac, check out RubyCocoa. It is obviously only for OSX, but I've seen a lot of folks scratch their head when looking to do GUI development on the mac and if you love ruby RubyCocoa is a lot of fun.

I strongly back Qt for cross platform GUI development. It's awesome and APIs are very intuitive. GUI look and feel almost native with Qt because it uses GUI controls provided by underlying OS.
Though the basic interface with C++ other language bindings are available. For Ruby RubyQt is available. Unfortunately it's very immature.

I would suggest looking at visualruby. Its an IDE to create GUIs using ruby. It uses GTK as its graphics toolkit, and the apps look great to me on any platform. You can see screenshots on Win7, WinXP, Ubuntu, and Mac on the screenshots page:
http://visualruby.net/site/Screen%20Shots.html
You can easily try it on every platform by installing visualruby on various platforms, and running the example programs.
The checked answer was written before visualruby was released.

Related

Is Ruby a good option for writing platform independent desktop applications [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Is Ruby a good option for writing (possibly and partially) platform independent desktop applications?
Is there any supported libraries to write code for windows,Linux, Mac Operating systems
I know Java have capabilities to write desktop applications, what about Ruby?
Ruby is a great language, but support for building graphical desktop applications is a bit weak. I would probably use JRuby + your Java GUI library of choice.
I believe JRuby can be pre-compiled to Java bytecode, which might also be a little bit better for closed-source applications than plain-text Ruby. (Although Java bytecode can easily be reverse-compiled.)
The problem with multi-platform GUI libraries is that they look ugly in any platform.
As a OSX user if I see a Java or X interface I automatically and mentally assign 10 less points to the quality of this application, even if it doesn't deserve it.
There is only one multi-platform GUI library that doesn't trigger any of my mental prejudices: HTML5. But of course you can not access to the native OS API.
I would recommend to try to define the architecture of your application is such a way that the 90% of the code is visualization agnostic. And then build this 10% of visualization layer for any platform adhoc.
If you are not worry about the professional perception of your app I can say that any of the propositions that have been done are a good choose.
I'd suggest you to take a look at Shoes.
Whether its a good option or not is a debate that depends on your constraints and preferences. If you are more comfortable with programming in Ruby as opposed to Java or C# then I'd definitely consider it to be a good option.
It depends on what kind of app you are developping. I would not say ruby is that cross plateforme for apps that need a complex gui for instance. Python seems a little bit more X-platform from my experience ,Java is definetly. And why not try C++ and Qt ?
http://qt.nokia.com/products/
Edit : since the question was edited , i would add go either with Java or Qt more than Ruby.
You could try FXRuby, it's based on the FOX Toolkit library and allows for cross-platform Ruby GUI development. Even more exotic platforms like FreeBSD are supported. You can package your Application together with a Ruby interpreter and all required frameworks to minimize target platform dependencies.
IMHO Ruby is a great choice for cross-platform GUIs. However, it depends on what GUI toolkit you use. The tools are: Qt, Tk, wxRuby, Shoes, GTK etc. I chose GTK because you can use the Glade interface designer to build your forms. You can see several examples of GUIs build with ruby at:
http://www.visualruby.net
About the programs' appearance, I've tried my programs on Ubuntu, Win7 and Win XP, and everything looks perfect. Also, if you look at Tks website, they have screenshots of TK GUIs in various platforms, and they look fantastic too.
The major benefit to writing GUIs in ruby, is that you get to use ruby instead of java. Personally, I find ruby a joy to work with. Good Luck.
I believe it can be with TideSDK. I recently discovered this and it seems to the one of the best approaches for multi-platform gui I have seen. It does use HTML5, but it has support for things like system tray and other native behavior.
I have looked into a bunch of the other alleged cross-platform solutions, but I don't find them appealing.
One note about TideSDK today: It only supports Ruby 1.8.7. This is actually a big issue for me as many of the gems I want to use is 1.9.2+. The TideSDK deployed on linux is 1.9, but not osx or windows, they are on 1.8.7. This is something they hopefully will update soon. Would love to see multiple ruby versions.
Anyways. Have a look at it. It is open source also, aka. free, so that is nice.

Right programing language for developing application for Mac

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 days ago.
Improve this question
I'm planing to buy a Mac. I would like to be able to develop GUI applications for Mac as well. Currently I develop in C# using VisualStudio as IDE. I also know Java and I'm familiar with NetBeans IDE. Application created in both of this languages can run on Mac (as can NetBeans IDE) but I was told that neither C# nor Java is recomended for MacOS X development.
So what language is recomended for MacOS X development ? I guess there is some recommendation from Apple for the developers ? I would prefer Object-oriented easy-to-use programing language (nothing like C) with good IDE that supports GUI creating (GUI designer).
Thank you for answers
There really is only one choice and that's Objective-C and XCode, anything else and you'll be running into problems and/or limitations.
As some have mentioned Python is one suggestion but what GUI toolkit to use? Then packaging becomes a problem.
Mono is OK but still a little buggy (and slooooow) on Mac's.
I haven't tried Java but the Apple port of the Java VM has just beed deprecated, make of that what you will.
XCode is very very good and integrates nicely with Mac/iPhone/iPad etc. but Obj-C takes a while to learn coming from a C#/Java background, plus XCode forces you to use MVC patterns in everything which again can be a culture shock.
I would say go with Obj-C and XCode and learn something new.
Objective-C with Cocoa should be your first, second, and third choices. That being said the learning curve can be steep but half the fun of this business is learning something new.
At my job (Seapine Software) we extensively use C++ with the Qt framework on the Mac and it also seems to work fine. If I were starting out I'd definitely go with Objective-C.
It's Objective-C. But if you want a beautiful and easy language, you can use python with wxPython. It'll look as native and, furthermore, it will make your applications multi-platform.
For the GUI designer, check wxFormBuilder. It supports wxPython for exporting.
I'm an iOS developer & use Objective-C every day, but if I were writing an OS X app, I'd definitely try out MacRuby. However, there is little controversy that, at present, if you want to write OS X native apps, you eventually must learn Objective-C. Most, like myself, grow to like it. Moreover, on OS X you have the advantage that you can run it garbage-collected and possibly save yourself some bookkeeping.
Daniel Steinberg says it well in the introduction to his Cocoa Programming book:
Use Objective-C. Sure, you can write Cocoa applications in other languages. But for now, learn the native language. There is a lot of support for new developers on the various Apple lists and in the support documentation, tutorials, and sample code accessible from Xcode. You will have an easier time of getting your question answered if you use the lingua franca of Cocoa development.
Yes it's Objective C. But check this out.
If you are familiar with HTML, CSS and Java Script, you can build platform independent desktop apps using Electron by Github. It's indeed amazing.
The desktop Apps like slack, atom, postman are built using this framework.
Please refer: https://electron.atom.io/
You can also use Qt which is a great cross-platform application development framework that is based on C++.
Please refer: https://www.qt.io/developers/
I started using swift to develop only Mac applications. But I wanted to use c for high performance apps, so I started using objective-c.

Which programming languages meet these criteria for GUI app development? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm trying to find a programming language I feel really comfortable learning and using for desktop/GUI application development. I realize it's unlikely that any language meets ALL of these criteria, but I'd like to find one that meets as many as possible. I've listed the following features ROUGHLY in order from most desirable/important to least.
Ideal Language Features:
Code Style: C/Java-like
GUI Development: Easy, elegant, and platform-Native styling
Community: Widely documented, active development, friendly & helpful, unity of focus
Object-oriented
Garbage Collection, no worrying about pointers, etc
Native compilation, NO 3rd-party runtimes like GTK or .NET
Multi-platform (can be compiled on *nix, Windows, Mac)
Reasonably fast
Mixed typing (soft-typed, OR both soft- and strict-typed -- i.e. Pike)
Background:
Most importantly, I need something that is straight foward and reasonably familiar, and something that isn't going to require a deep understanding of platform-specific APIs. I can't afford to spend a lot of time learning to develop Win32 apps in C++ for example. I've used wxWidgets, and liked the basic usage, but I'm really wanting to use a language with garbage collection, dynamic typing, and so on.
My frustration with Java, C#, and others is the need for a 3rd party runtime. I don't want end users to have to worry about installing and maintaining a separate platform.
Now then. Ideas??
Haha, due to the constraints you imposed you are now left with HTML and javascript. Good luck :)
The answer to your question is simply: None.
You excluded all desirable languages and platforms in your question.
I'd suggest you throw away your aversion against .NET and go with Delphi Prism. It's not C#, it is cross-platform compatible (everything is officially supported on Mono) and you can create applications that bring the runtime with them (Mono as part of your application).
I'd suggest Groovy and Griffon. Groovy is a dynamic language (like Ruby / Python) that runs on the JVM and integrates with millions of Java libraries out there easily. Griffon is a high-productivity RAILS-like framework for developing GUIs. Groovy has been around for 5 years and has a robust community and is supported by SpringSource (now division of VMWare). Griffon is a bit younger, but also has a fairly robust community.
These seem to fit your criteria.
I know I switched from Java to Grails (web framework written in Groovy that's similar to Rails), and haven't looked back.
Have you looked at QT? It's a really great GUI library and there are bindings for just about every language in common usage. There is a ton of documentation and a wide community. You mention that you want to do something in a language with garbage collection and dynamic typing, but rule out Python and Ruby, which are the 2 most popular languages that fit this criteria (also, they both have great QT bindings, I use pyQT4 and it is just awesome). They really aren't that far from what you do in Java/C, you just end up writing a lot less.
Wow you really limit your choices. I'm going to jump on the QT bandwagon and recommend C++.
Most of the objects in QT inherit from another object that sort of does it's own garbage collection.
There is incredible documentation out there for it.
QT is extremely powerful and has most of the elements you would like, and is extensible if you want to modify elements yourself.
If you do a static build for your release build the people you give the application to won't need distribute any other libraries as they will all be built into the .exe file.
The next iteration of Delphi is said to be cross-platform (Windows, Mac, Linux). I think it meets all your requirements except garbage collection.
No language meets all of those restrictions. Technically, it sounds like you're asking for something almost identical to Java but then explicitly disallow Java for unstated reasons. Conceptually, it sounds like you're looking for Python or Ruby but disallow them for using slightly different syntax.
Given the order of priorities, I think the closest you'll find in existing languages might be C with the Boehm GC and GTK+ for the GUI (and GLib for the object system). You do say "No GTK" under "No third-party runtime required", but I'm not sure what "runtime" you refer to here, since IIRC it's just a bunch of C libraries.
Given the specificity of the requirements, I think your best bet is to write your own language. Compilers really aren't that hard to write anymore. There are off-the-shelf tools to help with parsing and code generation and math and text processing and GC and so on. Once you get started you'll probably find people willing to help port it. Many existing cross-platform GUI libraries (like wxWidgets) use C/C++ so if you have a decent FFI you can use that, too. You want "support" and "documented" but if you're the primary author you'll understand it better than anybody. The hardest part about a language is design, and it sounds like you have a picture in your head of exactly what the language should be already.
There are a few if you can accept either WxWindows or GTK or QT as a toolkit.
In the order of my personal preference would be:
Eiffel Studio
D with the D-GTK binding
F#
javascript?
might be not the fastest one and doesn't fully address all your needs, but hey... its everywhere and easy to learn
didn't read after the list, but with prism You can probably achieve most your goals.
or You can try Qt and c++ autopointers
Silverlight could actually give you enough cross-platform availability to use C#/.NET, but I am not sure it fits all your requirements.
Sounds like Action Script 3 will make you happy. But it's more web oriented but you could try to make a projector or an Air application. I think it's a good solution because you can do anything with AS3 (image, video, text, sound video text keyboard and mouse input, pear to pear and 3d since flash 10, ...) and it's cross platform and you can use it on the web or your desktop :)
If you are a pure root coder (using vim and only command line for ex) you can make your whole app without using the flash ide, by just writing your as files and compiling them with mxmlc (that comes with the free flex sdk).
I suggest Python. Although it doesn't fit your first requirement of coding style, but it fits all your other requirements!
GUI Development: Easy, elegant, and platform-Native styling --> Yes
I'd suggest that you try wxPython (wxWidgets for Python). This is so "native" on Python that about 90% of all the wxWidgets code examples on the Internet are for Python! I've personally used TkInter, Gtk and wxPython. All of them are well supported on Python. My personal choice is wx.
Community: Widely documented, active development, friendly & helpful, unity of focus --> YES
Object-oriented --> Yes
Garbage Collection, no worrying about pointers, etc --> Yes
Native compilation, NO 3rd-party runtimes like GTK or .NET --> Yes. - You can eiter:
pack a single dll with your code - or
use py2exe which is able to create a single executable out of your project
Multi-platform (can be compiled on *nix, Windows, Mac) --> Yes.
Reasonably fast --> Yes. Well, it's not the fastest out there, but close enough that some serious projects are done in Python only.
Mixed typing (soft-typed, OR both soft- and strict-typed -- i.e. Pike) --> Yes.
Regarding your first requirement I'd say that you should give Python at least a try. It requires very little effort to get started. There is a 2-hour tutorial which gives you a serious introduction. There's a Basic to Advanced tutorial where I'd almost guarantee that you'll be writing your first application on the second day.
I also feel your pain Brian. Most time when I ask questions about desktop GUIs the only answer I get is: "Make it Web". You really nailed it, since your question is still open inspite some really non-constructive answers...
I've been watching closely JavaFX 2, it solves some of Swing problems and seems very promising. This may be the only thing Oracle did right since getting Java from Sun.
UPDATE:
.NET is finally becoming an open-source, cross-platform solution. .NET Core allows native compilation for multiple devices.
The new .NET experience is exactly what I was looking for when I asked this question several years ago.
Original:
Lots of good suggestions, despite being salted with negativity throughout.
I think I'm going to go with C# and Mono. I like C# well enough syntactically (I've been accused often of being shallow, but the syntax of a language is just as important to me as its features, because I spend a lot of time writing in that particular syntax). Although similar to Java, it has a few unique features that I appreciate, and I think the community seems more open-minded.
My biggest complaint about Java besides performance, frankly, is the community. It seems infected with an excess of arrogance, and it also seems to be very fragmented in terms of support for and development on various overlapping libraries, tools, and so on. The community surrounding Mono seems much more organized.
Actually, so does .NET itself, for that matter. Sun is a big enterprise company that seems every bit as confused about what it IS and what it DOES as Microsoft or IBM, yet they seem to be doing an even worse job of leading and organizing their platform than Microsoft, which is pretty tragic.

Can Ruby be used for UI based Windows apps?

I'm sorry if this question is noob-ish but I'm not having much luck with Google. Can Ruby be used for UI based Windows apps? I'm not looking for a Rails app, just Ruby.
Thanks
You have couple of options.
Use Gtk Ruby which works on Windows as well (http://ruby-gnome2.sourceforge.jp/).
You can use WxRuby or Tk.
You can use JRuby and Swing.In fact there are high level libraries which can help you there, such as (http://monkeybars.rubyforge.org/)
Yes, but the experience will vary depending on how you hook up the UI. TK or gtk, wxRuby, ruby shoes (not sure how alive that one is right now), Qt (which is cool) and fox (aka fxRuby) are some of the options. If you like to hurt yourself, you can hook directly to Win32 libraries, but I doubt you'll want to.
Additionally, if you target the nascent IronRuby, you can use WinForms or WPF.
I also prefer wxRuby. It looks great, uses native components, yet is cross-platform. On the Ruby On Windows blog there is a great write-up of how to get started. It helped me a lot.
You bet. wxRuby is what I use, but others use GTK. wxRuby also works on Linux which is where I am writing a program, but it should suit your needs. You can install it using
gem install wxruby
You could check out wxRuby..
Depends what kind of Window app are you going to implement. If this is your own pet project, then definitely you can try WxRuby or GTK. There is no risk here.
However if this is going to be serious, commercial windows app then you have to think twice. It is really worth using Ruby? It is great language. I use it on daily basis. But for a Windows app, C# integration with the whole environment is hard to beat.
check out Shoooes!

Create a small 'window-form' application that runs anywhere

I work in the embedded world, using mainly C and no GUI at all (because there is no display screen).
Moving over to the non-embedded world, in which I have nearly no experience, what is the best programming environment (langauge/IDE/etc) for me to build a simple window-form application that will run on all the common platforms: windows/linux/mac-os ?
I do not want to build a web-app.
I have my eye on Python and one of it's widget libraries, QT or WxWidgets. Is that a good option ?
I like GTK+ personally but that or any of the ones you mentioned should be OK. I don't know which is the best in terms of least RAM usage.
Both wx and QT have embedded/universal versions where the widgets are drawn directly.
They can both be called from python,but if you have a very small system python or py2exe might not be available.
Unless you want to embed HtmlWindow I'd go with wxWindows... works everywhere without problems so far for me.
I have both worked with PyQt and wxPython extensively.
PyQt is better designed and comes with very good UI designer so that you can quickly assemble your UI
wxPython has a very good demo and it can do pretty much anything which PyQT can do, I would anyday prefer PyQt but it may bot be free for commercial purpose but wxPython is free and is decent cross platform library.
Qt is a good choice to start with. In my opinion it has a best (easy to use, simple & informative) API Documentation. Package also includes many examples - from very basic to complex. And, yep, it`s truly crossplatform.
Check Qt Licensing page, the library is free only for GPL projects.
I`m using QDevelop as text editor, but there are many other alternatives - Eclipse, KDevelop, Code:Blocks, VS plugin & etc.
Why not use swing and java? It is quite cross platform, and looks reasonable for form apps. If you squint a bit and ignore the java, its quite pleasant - or alternatively, use one of them dynamic languages on the JVM (Groovy is my recommended one).
What kind of application is it going to be? Have you considered a web-based application instead? Web-based apps can be super flexible in that sense - you can run them on any platform that has a modern browser.
By far the simplest choice for creating native cross-platform applications is REALbasic. Give it a try and you'll have a working app for Mac OS X, Windows and Linux in minutes. No run-times or other stuff to worry about.
I think you should try Html Application.It is something like web page it contain DHTML,java script,ActiveX but it is execute like .exe .
Edit:
Sorry for advice you html application.I just know it can run on windows only.

Resources