From: Phillip Gawlowski Date: 2008-04-20T20:09:22+09:00 Subject: Re: Database construction in Ruby -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Christopher Small wrote: | Background: | | I'm interested in building a database for my company so that we can | store information on accounts, work orders, production records, | experimental data, etc. My programming experience started with | Mathematica, was followed by LaTeX, then by Matlab, then Maple, then | Labview and most recently, I've started learning Ruby. I really like | Ruby as a functional language, though I haven't gotten my feet too wet | with languages of that sort of ilk yet. I haven't been programming with | it (or any of the other) for very long, but I've found that with my | mathematics background I've been able to pick up all of these languages | very quickly, and feel quite confident that (with some work, to be sure) | I can build a database and GUI which will meet our companies needs for | an easy to use and highly flexible database. A question of my own: Do you plan to write the database engine from scratch, instead of using, say, MySQL, Oracle or DB2? That said, Kirbybase is a pure Ruby database, so it is certainly possible to write databases in Ruby. | | Questions: | | Having not had much experience in the sort of languages which would be | suitable for such an endeavor, I don't know what the pros vs. cons of | using Ruby to develop such a program would be. My impression is that | with Ruby's rich class structure and flexibility it would be a good | language to use. What I don't know is if there are things that I need to | consider before getting too far down along this path. For instance, I've | read that the linguistic structure of Ruby was created with the | programmer in mind, not the computer. Does that mean that a ruby program | of the sort in question might be too fricken slow to deal with all the | info? That depends. For realtime calculation Ruby is too slow (as are all interpreted languages), but you may gain speed by using JRuby and it's JIT compiler for Ruby. In most cases, a Ruby program is fast enough (and you gain productivity as developer, which is usually a good trade off, especially given the abundance of computing power nowadays). Without profiling and benchmarking your cases, it is hard to say if Ruby is fast enough for your needs or too slow. On the other hand, Ruby in combination with Rails is scales very well by now, even though ActiveRecord can be really slow (which, in most cases, doesn't matter, and you can tweak a lot by dropping down to SQL, for example). | I know that MATLAB is famed for it's array handling - is there a | way that embedded C compilations of matlab programs may be able to drive | an array based storage and retrieval scheme with more speed than Ruby | alone? Are there other problems that I haven't thought about? Have | others made programs like this with Ruby? Were they successful? You could farm out computationally heavy operations to C with normal Ruby, or to Java with JRuby. | The other concern of mine is making the GUI. Labview has a pretty simple | drag and drop style GUI development structure - that's all I've used on | that front. I tried working with visual basic once, but didn't get very | far, mostly because for what we were doing Labview was easier and | someone at my work was able to teach it to me (Incidentally, I've ben | learning Ruby for fun on my own time). As I understand it, there are a | few options for getting a Ruby-GUI. Ideally, this would be runnable on | either windows or mac (at work we use win but I run a mac on my | computer). I've downloaded Shoes, but haven't really used it at all yet. | It doesn't seem to be tailored for designing complex GUIs. As I | understand Cocoa is a great way to go if you want to run on macs - is | there a way to get a Cocoa script to run on PCs? How do programs like | iTunes work on PCs? In general, what would the best (or at least some | good) multi-platform language(s) be for embedding Ruby within a GUI? Apple has ported its GUI toolkit to Windows. And iTunes or QuickTime and Safari look out of place, but as far as I know, there is no port of the Cocoa toolkit to Windows. However, there are a number of crossplatform GUI toolkits, like GTK+ (with a drag & drop GUI designer usable for Ruby applications) with Ruby-GNOME2, wxRuby which uses the wxWidgets toolkit, which give a native look on different platforms, QtRuby (though the Qt toolkit has odd licensing, but that doesn't matter unless you want to sell your application to others), and JRuby can use the Swing toolkit for Java at least (and Monkeybars makes it unnecessary to touch Java, if you don't want to to create GUIs), where the Netbeans IDE comes with good Ruby support, as well as a very good GUI designer. Last but not least, there is the Fox GUI toolkit, too (which recently got a book published aimed at people who haven't created a GUI application yet, too). - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan ~ - You know you've been hacking too long when... ...you find yourself trying to CTRL-S the credits rolling on the TV screen. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgLJGgACgkQbtAgaoJTgL+ENACfdFfYhoJOEyQXH74RLVJTwHvr j1YAoJFjrNuIUM4tqyo8vu6CpyHLhIfm =sv4J -----END PGP SIGNATURE-----