Slashdot Mirror


RAD with Ruby

Amit Upadhyay writes "KDE's award winning integrated development environment KDevelop, has integrated support for Ruby, an excellent and easy to use object oriented scrpting language. If you are looking for a good programming tool for quickly developing a professional one off application, Ruby (with KDE bindings) maybe just the thing for you. There is a quick tutorial and an online book to get you started. You may also want to read a quite informative comparison of Python with Ruby. If you are web developer or write enterprise applications with JAVA etc, take a look at Ruby on Rails(api), they have a nice blog too. KDevelop provides a GUI builder and Debugger for rapid application development(RAD) with Ruby, which is getting better. There is a nice tutorial on using KDE libraries with Ruby. And if you have lots of code in C/C++, extending Ruby to use them is easy.
"

162 comments

  1. Ruby Rules! by Mr+Foobar · · Score: 2, Interesting

    And Python and essp. Perl just plain drools...

    Ruby will be easy for any Perl user to learn, and it really is OO from the bottom up, not just bolted on like Perl's so-called OO.

    And Ruby's OO makes much more sense than Java's and Python's OO. I can't explain it, but I can't think OO in Java or Python, and I can in Ruby.

    --
    -> I dislike sigs...
    1. Re:Ruby Rules! by Zorilla · · Score: 4, Funny

      Perl just plain drools...

      You dare badmouth Perl on Slashdot?! Take this! s/(12^\n)monkeychar6969BakerStreet(monkey(gibbon(p rocoscismonkey(mandrill))))^%52!

      --

      It would be cool if it didn't suck.
    2. Re:Ruby Rules! by Anonymous Coward · · Score: 0

      Ruby is basically just Smalltalk with a (slightly) more confusing syntax.

      Python is Smalltalk with some nice ideas and some bad ones (for instance, trying to be too Perl-like). Python's OO is barely better than Perls. The private member syntax is just plain ugly.

      Perl is ineffable :)

    3. Re:Ruby Rules! by Anonymous Coward · · Score: 0

      not just bolted on like Perl's so-called OO.

      I here this a lot and do actually want to try Ruby. However, 'so-called' OO in perl is real, honest to goodness, full hit OO. It may be fugly but it does everything (and more) than a lot of OO languages.

      Just because perl can do other things and isn't a one trick pony casual observers believe that OO in perl is lacking. It really isn't, but often there are nicer ways to attack a problem.

    4. Re:Ruby Rules! by Pxtl · · Score: 0, Troll

      Yes, Python managed to be just as mutch a kludgefest as Perl, just with a more human-readable syntax. Its still an inconsistent mess.

      Ruby, to my mind, is an ugly smash-up between Python and Smalltalk, but unfortunately isn't focused on claiming the merits of either - it isn't half as legible as Python, and not half as consistent as Smalltalk.

      Still, the fact is that for a modern language to catch on, it has to have a popular free implementation, a massive robust system scripting library, etc. This is why languages like Perl and Python catch on - not because they're the best, but because they "just work" batteries included, and have a lot of people pushing them. Smalltalk didn't have that - at least, not in the free implementations.

    5. Re:Ruby Rules! by Anonymous Coward · · Score: 0

      ?
      lol

    6. Re:Ruby Rules! by Anonymous Coward · · Score: 0

      There was a thread on perlmonks.org recently about this subject. One of the guys said something intelligent: "real OO" is typically used by people who don't really consider what it really means, they just repeat what they heard and *think* they know. But in reality it's a matter of perception. A smalltalk coder for instance will not likely consider Java to be a "real OO" language. So "real OO" is a moving target, depending on who you talk to.
      As for myself, I don't give a rat's ass. I don't even use Perl's OO mechanisms, other than when calling some module's interface. The stuff I do has so far been implemented and maintained very well with simple procedural code. I never really bought into the whole "OO is teh rox0r" trend. I can see that in some cases it can present an advantage, but oftentimes it seems people code OO because "it's 'mo bettah". Even people who should know better.

    7. Re:Ruby Rules! by multi+io · · Score: 2, Informative
      [Ruby] isn't half as legible as Python

      Example?

      not half as consistent as Smalltalk

      (so you agree that Ruby is more consistent than Python?)

      Smalltalk has no form of MI, has it? At least not in the original version. That may be consistent, but it's not practical at times...

    8. Re:Ruby Rules! by Guido+von+Guido · · Score: 1
      It's semantics. I think the problem is that you can still see the bolts where perl's OO-ness was hacked on. It's just much more elegant in other langugages, including ruby.

      Oh, and it's not just ugly. You left out "royal pain in the ass."

    9. Re:Ruby Rules! by davegaramond · · Score: 1

      And your post is just an inferior troll. Python is trying to be too Perl-like, and Ruby is not? WTF?

    10. Re:Ruby Rules! by davegaramond · · Score: 1

      Ok, I couldn't care less if I'm using "real OO" or not. But I want better syntax, damn it! Perl's OO syntax is just horrible! But luckily there are Perl modules to hide that.

  2. But does it work on Windows? by OllySmith · · Score: 4, Insightful

    Windows support is the big thing it needs to match the flexibility of Python+Glade for RAD stuff. I'm using Python+Glade every day at the moment for prototyping and for making up quick little proof-of-concept solutions, but Windows support is neccessary for my employer to take it at all seriously (even tho I do most of my actual development on Linux).

    1. Re:But does it work on Windows? by pmazer · · Score: 1

      http://rubyinstaller.rubyforge.org/wiki/wiki.pl Yep

    2. Re:But does it work on Windows? by Anonymous Coward · · Score: 3, Informative

      Here's Ruby for Windows. It includes many extras such as FreeRIDE (a Ruby editor written in Ruby):

      Ruby One-Click Installer for Windows

      With Ruby, there are even classes that let you do OLE automation.

      And calling C/C++ functions is super-easy using Ruby so you can use all those DLL functions out there.

    3. Re:But does it work on Windows? by OllySmith · · Score: 3, Insightful

      Sorry, I hadn't made myself clear - the sticking point was is there a one-click installer for the GUI prototyping environment too like there is for Python+Glade (ok, it's a handful of one-click installers for Python/PyWin32/GTK+/Glade/PyGTK, but you get my drift)? Is deployment of a Ruby+KDE(?) prototype application going to take anything other than double-clicking a few exe's to get the runtime environment setup and installed? I may be completely wrong (and too lazy to do the research - welcome to Slashdot!), but last time I checked, KDE and Windows weren't a very happy couple.

    4. Re:But does it work on Windows? by IamTheRealMike · · Score: 1

      That's not quite what he meant. KDE is not ported to Windows and Qt has a hefty cost especially if you're just doing a one-off custom app thing. Python + Glade is quite a powerful combination because it includes the GUI environment as well, not just the runtime.

    5. Re:But does it work on Windows? by rffrff · · Score: 1

      you could have even said "ruby + glade" the ruby-gnome2 project support Gtk and libglade on windows and they run quite fine.

    6. Re:But does it work on Windows? by HiThere · · Score: 1

      You can use either Fox or wxWindows with Ruby (or GTK...though I know even less about that than about wxWindows). Still, all three are protable GUI toolkits. Fox is the most popular GUI interface on windows, probably because that's what the people who built the installer liked. I'm not sure what FreeRide uses...I thought it was GTK, but I haven't checked, and don't remember why I thought that.

      OTOH, the last time I checked, FreeRide was a bit alpha. But that's quite awhile ago, so that could have changed.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
  3. What the hell is this crap?! by Mmm+coffee · · Score: 4, Insightful

    Don't get me wrong, I'm quite the Ruby fan myself. However, what the hell kind of story is this? There is little to no real meat to this story, it's just a long winded ad for two Free Software applications! What's to discuss, how great these two things are? Where's the thought provoking stories from the olden days of the site?

    1. Re:What the hell is this crap?! by FudgePackinJesus · · Score: 1

      If I haven't heard of it before then it's news to me.

    2. Re:What the hell is this crap?! by Doctor+Memory · · Score: 2, Insightful

      Actually, this *is* more like the stories from the elder days. It's news for nerds, not news for webmonkeys. BITD, this was the kind of thing I came to /. for -- what's in the new kernal, is there going to be a new filesystem, is there support for >512M of memory yet? Articles like these help keep this site true to its roots.

      --
      Just junk food for thought...
    3. Re:What the hell is this crap?! by anpe · · Score: 1

      Where's the thought provoking stories from the olden days of the site?

      I know my friend they've been quite rare this days... However, for spelling's sake, you should use plural ;)

    4. Re:What the hell is this crap?! by ryanvm · · Score: 4, Insightful

      Where's the thought provoking stories from the olden days of the site?

      This is known as "Star Wars Syndrome". It's the delusion that the content used to be good, when in reality, the sufferer was just less discriminating.

    5. Re:What the hell is this crap?! by cloudmaster · · Score: 1

      So, is this your second ID, or do you change them yearly? :)

      Personally, I'm pretty sure that Ruby will remain forever in Python's shadow (which is a dark shadow, since Python is stuck in Perl's shadow), and therefore could care less what's new with Ruby. :)

    6. Re:What the hell is this crap?! by Slime-dogg · · Score: 1

      There really isn't a good analogy that refers to media. I was going to say that he's like the kid that has grown up on phantom menace, judging by the magnitude of his UID, but that doesn't work so well in /. sense. Sure, there are older articles, but that form of media isn't as readily accessible as the Star Wars trilogy on DVD.

      I'm willing to bet that he wasn't around much before 2001, and isn't quite hip to what the "old" days were like. I remember. We'd have announcements of new ways of playing with E, or the newest version of red hat. /. got heavier into the news-news when the MS anti-trust thing was going on. It's been that way since, I guess, with all of the SCO crap, and this and that.

      So, yeah. This is good content. It spreads the word on Ruby, which looks to be a cool language. I don't care whether or not it's cooler than Python, I relegate those types of arguments to the insecure-geek scrapheap.

      --
      You need to restart your computer. Hold down the Power button for several seconds or press the Restart button.
    7. Re:What the hell is this crap?! by Anonymous Coward · · Score: 0

      There is little to no real meat to this story, it's just a long winded ad for two Free Software applications!

      It's a KDE story. KDE stories don't require any back up or content to get onto slashdot... just the magic K in front of the name.

    8. Re:What the hell is this crap?! by Anonymous Coward · · Score: 0

      Sorry to break the news to you, but Junis got his Amiga confiscated by some taliban stragglers that infiltrated his village. He's back on his Vic 20. *sniff*

    9. Re:What the hell is this crap?! by Anonymous Coward · · Score: 0

      However, what the hell kind of story is this? There is little to no real meat to this story, it's just a long winded ad for two Free Software applications!

      It's called slashdot.

    10. Re:What the hell is this crap?! by Anonymous Coward · · Score: 0

      Sayeth user nr 679570. Mmm irony.

  4. Why Ruby? by Anonymous Coward · · Score: 5, Informative

    With so many other languages out there, why bother with Ruby?

    Perhaps an example would be best.

    http://www.rubyonrails.org/show/AccessControlLis tE xample

    NOTE: In the above example, the Model Code (just a handfule of lines) is what creates all the database-mapped classes and relationships. In other words, the implementation of functions used in the Example Usage were created on the fly!

    If you haven't done enough object-relational mapping using other languages to be blown away by this example, then here are 37 other reasons:

    http://hypermetrics.com/ruby37.html

    Ruby Home
    http://www.ruby-lang.org/

    1. Re:Why Ruby? by cozziewozzie · · Score: 1

      Shows up empty for me.

    2. Re:Why Ruby? by bruthasj · · Score: 1

      First, the examples are blank.

      Second, hypermetrics.com doesn't work.

      Third, you didn't use <a>.

      You're making me work too hard!!

    3. Re:Why Ruby? by phildog · · Score: 1

      OK Ruby evangelists, after checking out the 37 reasons on the list above I can give you 1 big reason I haven't dived into Ruby yet:

      What is the Ruby equivalent of CPAN and why isn't it on this guys list?

      --
      slashsearch.org - slashdot search. powered by google.
    4. Re:Why Ruby? by BlueGecko · · Score: 1

      Someone--probably from here--keeps deleting all contents of the page. Click "Back in Time" at the bottom of the window. I'm trying to revert it, but whenever I do, the person just deletes the page again.

    5. Re:Why Ruby? by GnuVince · · Score: 3, Informative

      The equivalent is Gem and the reason it isn't mentionned is because this 37 list was written about two years before work on Gem began and the list has never been updated since then.

    6. Re:Why Ruby? by phildog · · Score: 1

      Thanks GnuVince!

      Next question: at the front page of that site I can't query the available packages. What gives? Is there a search function that is web accessible? (like search.cpan.org) For example, one nice Perl module I recently started using is MIME::Lite. How can I easily find out if there is a Ruby equivalent to this module?

      I've read about Ruby and am eager to try, but CPAN isn't just important to me--it is perhaps the only reason I use Perl.

      Not trying to be a pain: I know I can google for this stuff, but aggregating the info here on a slashdot thread is useful to me and perhaps others. And the expert evangelist is ALWAYS superior to Google :-)

      --
      slashsearch.org - slashdot search. powered by google.
    7. Re:Why Ruby? by slamb · · Score: 2, Interesting
      That example really shows off why I hate object-relational mappings (Ruby's or any other). It looks like each of those lines of code requires a round trip to the database. In fact, this one requires three:
      role.add_permissions(Permission.find(2), Permission.find(3))

      If you put some actual thought into the queries you make, you can do much better. For example, what you'd really like to do is see what permissions the user has. So:

      select distinct perm.id, perm.name, perm.serial
      from user_roles user_role
      join roles role on (user_role.role_id = role.id)
      join permissions_roles perm_role on (perm_role.role_id = role.id)
      join permissions perm on (perm_role.permission_id = perm.id)
      where user_role.user_id = :p_user_id

      That query allows you to go straight from the user ID to the actual useful information about permissions in a single database round trip. Notice that I used joins. These are things that object-relational mappings seem to neglect. And the foundation of the relational model.

      SQL is not hard. Why must everything be an object? I love object-oriented programming, but this isn't a good use of it.

    8. Re:Why Ruby? by DigitalTechnic · · Score: 0

      Those dudes ripped Perl's DBI line for line anyway.

    9. Re:Why Ruby? by fvwmfan · · Score: 1
      Okay, I'll bite.

      I am not disputing that the SQL you gave is more efficient than the corresponding Ruby, or that OO may be a poor paradigm to choose for querying a relational database.

      But..

      There is a saying .. "Premature optimisation is the root of all evil"

      From where I stand (don't know Ruby, rarely use SQL) the Ruby example is easy to understand, and the SQL example is far from obvious. This is from someone that has never used Ruby but has used SQL.

      The point is that unless some analysis shows that that particular piece of Ruby code causes an unacceptable bottleneck within the context of the application (from the point of view of the user), then stick with the code that is shorter, simpler, easier to write and easier to maintain.

      I guess part of what you are saying is that there are existing (old) technologies that are better in some sense if only people would take the time and effort to learn about them, rather than chasing the flavour of the month. If that is part of your message then I whole-heartedly agree. I like fvwm!

    10. Re:Why Ruby? by slamb · · Score: 3, Interesting
      From where I stand (don't know Ruby, rarely use SQL) the Ruby example is easy to understand, and the SQL example is far from obvious.

      To someone who uses SQL frequently, the code I gave is obvious. (It'd be even more so if slashdot allowed me to indent it properly.) And most people making code to access a RDBMS will have used SQL recently, because they just designed a schema to access. The tool doesn't do that for you.

      With object-relational tools, you need to know more than you did before. There's much more complexity and bloat in the system. And the resulting SQL is crap. There's no benefit.

      "Premature optimisation is the root of all evil"

      More accurately, "premature micro-optimization is the root of all evil". You will save a lot of effort by choosing an efficient high-level design right away. Passing around objects that tie you to an object-relational tool like this one is not an efficient high-level design.

      The point is that unless some analysis shows that that particular piece of Ruby code causes an unacceptable bottleneck within the context of the application (from the point of view of the user), then stick with the code that is shorter, simpler, easier to write and easier to maintain.

      Yes, that particular piece of Ruby code would cause an unacceptable bottleneck. In many organizations (including mine), the database server and the webserver are not the same. Imagine every round trip taking 50ms and you'll begin to understand. The number of round trips must be O(1) for acceptable performance, and the closer to 1, the better. That's not true for the Ruby code. It makes m + n round trips, where m is the number of roles for that user, and n is the number of permissions for that user. So if that's 20 (depending on how granular permissions are, that's not unlikely), that will add a second per hit. Ugh.

      I guess part of what you are saying is that there are existing (old) technologies that are better in some sense if only people would take the time and effort to learn about them, rather than chasing the flavour of the month. If that is part of your message then I whole-heartedly agree. I like fvwm!

      In part. But mostly, it doesn't make sense to add on layers of complexity unless they accomplish something for you. This layer does not, and it does take away your performance.

    11. Re:Why Ruby? by patSPLAT · · Score: 1

      I've done alot of work with ruby in my free time on narf (http://www.narf-lib.org/). I'm not particularly fond of the permissions example either.

      ruby is a young community, with a tolerant and diverse set of opinions. Rails isn't the only ruby O-R mapping; there is also lafcadio (http://lafcadio.rubyforge.org/). And Rails isn't the only web enviroment; there is also iowa (http://enigo.com/projects/iowa/index.html), as well as narf.

      The english-speaking ruby community is young. Some parts of the language are very mature, and some parts are immature. It's an odd mix. I figure the ruby community now is about ~ to the php version 2-3, with different demographics.

      Ruby usage is dispersed among alot of different projects. There are alot of different opinions about the right way to get things done; it's larger than one library.

      ~ patrick

  5. Short version... by Cooper_007 · · Score: 5, Insightful
    KDevelop has Ruby bindings.

    That's all the news in there. I really don't understand why the submitter chose to include a whole bunch of Python vs Ruby links. The actual news bit isn't about that at all...

    Cooper
    --
    I don't need a pass to pass this pass
    - Groo The Wanderer -

    1. Re:Short version... by BalloonMan · · Score: 5, Insightful

      That's cutting it just a bit short. KDevelop now has Ruby bindings... but why? Perhaps because Ruby is gaining momentum and mindshare, which is a good (IMHO) and newsworthy thing.

      As for the Python vs. Ruby soapbox: I think it'a a valid component of the news because the two languages are fighting for mindshare in the same pool of savvy OO-script developers.

      Without getting into particulars, I must say I've been through Perl, then Python, and now Ruby, and I'm most satisfied with Ruby. Sadly, Ruby folks seem to be so busy doing cool things that they are just awful at evangelizing their language. The language a little bit younger and less polished than Python, but they're catching up fast. The inclusion in KDE is an indication of this progress.

    2. Re:Short version... by FudgePackinJesus · · Score: 1

      I'm sorry Cooper, pimpin' linux tech is oldschool /. style.

      If a story isn't about CPUs, SCO, the DMCA, Games, or Linus himself then it doesn't make it any less interesting. It's people bitching about content like this that's been making Slashdot into another mindless web portal.

      In fact, it's little jems like this that keep the saturation of the same old crap from being too much.

    3. Re:Short version... by EachLennyAPenny · · Score: 1

      That's cutting it just a bit short. KDevelop now has Ruby bindings... but why?

      It's always the same Open Source principle: it's there because somebody had fun to do it. Nothing more and nothing less.

    4. Re:Short version... by ultrabot · · Score: 3, Funny

      Sadly, Ruby folks seem to be so busy doing cool things that they are just awful at evangelizing their language.

      Really? It seems to me that all the ruby people do is evangelizing their language...

      --
      Save your wrists today - switch to Dvorak
    5. Re:Short version... by Anonymous Coward · · Score: 2, Funny

      Well, you see here's the day of a typical Ruby programmer:

      8am-10am : Write basic new CMS application in Ruby on Rails. Design and create DB tables, use Rails Active Record to create object layer in ~50 lines of code, use scaffolding feature to prototype app. Deploy to customer site and wait for feedback.

      10am-11am : Help Jim with HotDotCom.com's big Java app (he needs to set up some XML files for Hibernate). Just show him how to do one table and let him tackle the other 22 on his own.

      11am-12pm: Lunch!

      12pm-1pm: Customer feedback on CMS: they need some big changes, including adding new tables and columns to the DB. Implement them. Unit tests pass.. deploy!

      1pm-2pm: Check on Jim, he's done 3 more XML files. Some problems are showing up.. I decide not to visit Jim any more or I will get sucked into an XML black hole. Jim's emails are full of angle brackets, poor guy.

      2pm-6pm: Customer is happy with CMS. Says "you must have an amazing team to build an app like that in one day". Chuckle to self. Done for the day, time to hit the blogs and start evangelizing Ruby!

    6. Re:Short version... by Ian+Bicking · · Score: 2, Interesting
      As for the Python vs. Ruby soapbox: I think it'a a valid component of the news because the two languages are fighting for mindshare in the same pool of savvy OO-script developers.
      Not really; if you are a savvy OO-script developer, you are using Ruby or Python or something like it already, you've made your choice. Both languages are trying to pull new developers from other languages, like C or Java. As such, I think they actually help each other -- the potential pool of new people is still very large. Once you've gotten as far as using Python (if you have a statically typed, compiled background), it's a small step to use Ruby, and vice versa. A Python developer should feel quite comfortable with Ruby, compared to most other languages (and vice versa).

      Or, if Python gets a good CLR/.NET implementation, the process and lessons will be very applicable to Ruby. Ditto Parrot. Ditto SWIG. And so on.

    7. Re:Short version... by jmccay · · Score: 1

      There is one problem. KDevelop is an IDE, and it's not really a RAD. It's missing the graphical dialog, message box, and window builder utility. It might have one for QT as an external program, but I doubt it binds anything else like Ruby or wxWidgets. If does have one, especially one that can build wxWidgets dialogs and windows, I haven't found it yet.

      --
      At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
    8. Re:Short version... by tyrione · · Score: 1

      From what I have been told, the reason Ruby bindings, like any other non-native language to Qt has bindings is because someone took up the role of creating the bindings as a KDE project.

      I was told Objective-C was there but stopped being maintained and presently isn't in the tree. Too bad. I'd rather see ObjC and ObjC++ than Ruby.

  6. Another scripting language by putko · · Score: 3, Interesting

    I'm quite partial to scsh.
    I mention this because I understand Ruby's semantics are like Scheme (but the syntax is different, or we'd call it a Scheme).

    The intro from the scsh paper (Olin Shivers) convinced me to try it out:

    "Shell programming terrifies me. There is something about writing a simple shell script that is just much, much more unpleasant than writing a simple C program, or a simple COMMON LISP program, or a simple Mips assembler program ..."

    He's not talking about a simple shell program (like "rm -fr /") -- but something with variables, control flow, conditionals, etc.

    --
    http://www.thebricktestament.com/the_law/when_to_s tone_your_children/dt21_18a.html
    1. Re:Another scripting language by MC6809 · · Score: 0
      I'm quite partial to scsh.
      I mention this because I understand Ruby's semantics are like Scheme (but the syntax is different, or we'd call it a Scheme).
      The intro from the scsh paper (Olin Shivers) convinced me to try it out:

      The intro he wrote where he referred to the 9mm Sig-Sauer, Prozac, and Jack Daniels was much more entertaining.

      Unfortunately, compared with other Schemes that I was familiar with (MzScheme, StkLOS) I didn't feel like it was the next best thing in scripting languages.

    2. Re:Another scripting language by Anonymous Coward · · Score: 0

      I've been looking for a good Lisp-based language (Scheme too, in fact Scheme is a little nicer). I love Lisp but never use it because of the lack of useful libraries and interfaces to the outside world. They all seem like they are from the 1970's.

      I tried scsh, thinking "this is it", but it wasn't. It's EXTREMELY slow. It does a lot of "list building" (cons'ing) rather than applying a function to each element of the list.

      So I'm sticking with Ruby until somebody comes up with a Lisp that can actually compete with today's dynamic languages (NOT scripting please, I write big apps in Ruby).

      If anybody out there wants to come up with a NEW Lisp dialect with a specific goal of making all other Lisps and Schemes obsolete, and with a specific goal of superceding Ruby, Python, Perl, etc. PLEASE do it!!!

    3. Re:Another scripting language by Anonymous Coward · · Score: 0

      If anybody out there wants to come up with a NEW Lisp dialect with a specific goal of making all other Lisps and Schemes obsolete, and with a specific goal of superceding Ruby, Python, Perl, etc. PLEASE do it!!!

      Working on it... ;-)

    4. Re:Another scripting language by zorander · · Score: 1, Insightful

      How can a language in which functions are not first-class objects be semantically similar to scheme? Semantically Python has much more in common with lisp variants such as scheme than Ruby ever has.

      Objects, messages, mix-ins, the mixing in of kernel to the implicit root object, etc. are not elements of scheme. Blocks come from smalltalk, though they enjoy relatively simple representation in scheme, they're in no way the same concept. Iterators (in the ruby sense) don't appear in scheme either.

      I generally think of scheme as a predominantly functional language and ruby as an overtly object oriented one. You'd think that this would imply semantic differences, though apparently the parent poster disagrees.

    5. Re:Another scripting language by putko · · Score: 1
      Isn't this below valid Ruby? Looks like a first class function to me. this
      Ruby def foo (n)
      lambda {|i| n += i } end

      Here's more code for you
      210 # File is a subclass of IO. "foreach" is a class method
      211 # that opens the file, executes the block of code once
      212 # for each line, and closes the file.
      213 IO.foreach(ARGV[0]) { | line |
      214 line.chomp!()
      215 puts "insert into table values ("
      216 print "\t'"
      217 print line.split(/,/).join("',\n\t'")
      218 puts "'\n)"
      219 }

      Blocks look first class to me -- they are passed as arguments. This tells me Ruby is like Scheme, but with an object system. You may argue that blocks are not meant to be used by lambda, but that is an aspect of style and typical Ruby programs, not the meaning of the language. However, the fact that Ruby has no formal semantics prevents us from really talking about meanings of programs. This isn't meant to be a slight of Ruby, b.t.w. There is no formal semantics for C/C++ either, and those are pretty popular.

      One advantage of Scheme is that you can take your pick of object systems, if you want one. They are all pretty tiny too. You are not stuck with the tradeoffs made by Ruby's system.

      However, if Ruby is just scheme with an object system and different syntax, they are quite similar.

      Calling Scheme primarily functional doesn't make sense. Typical scheme programs are functional, but the presence of set! means that the language is definitely not functional.
      --
      http://www.thebricktestament.com/the_law/when_to_s tone_your_children/dt21_18a.html
    6. Re:Another scripting language by putko · · Score: 1

      What in particular were you trying to do with scsh that was so slow? Depending on what you were doing, it might be spending time in scsh or scheme-48 code.

      The speed of Scheme-48 is around that of the Java machine without JIT (because they are both byte-code compiled).

      Although that is slower than something that compiles to efficient native instructions, it is fast enough for most cases. But scsh's speed should be faster than the purely interpreted languages you might replace it with (sh, ruby?, python?).

      If I have a performance problem, it normally solvable via better Scheme programming.

      --
      http://www.thebricktestament.com/the_law/when_to_s tone_your_children/dt21_18a.html
    7. Re:Another scripting language by Anonymous Coward · · Score: 1, Funny

      If anybody out there wants to come up with a NEW Lisp dialect with a specific goal of making all other Lisps and Schemes obsolete, and with a specific goal of superceding Ruby, Python, Perl, etc. PLEASE do it!!!

      Working on it... ;-)

      Mr. Graham, thank you for taking the time to pause your essay writing and descend from your tower to let us know that you are still working on Arc, but the Vages odds are on several other extremely events coming to pass prior to the first release of Arc.

      And thanks for equating everyone who doesn't use Lisp to people who have to take "the little bus" to do their programming work. I get a chuckle out of that all the time when I hear people arguing about programming languages.


      --
      Snobol kicks ass!

  7. Shouldn't that read ... by maxwell+demon · · Score: 0

    ... scripting language?

    --
    The Tao of math: The numbers you can count are not the real numbers.
  8. Crossplatform Ruby by beware1000 · · Score: 3, Interesting

    I actually wish I had had these details all in one place when I was looking afew months back (abit of googling eventually showed all those pages).
    Personally, I have found if you are really interested in RAD w/ Ruby + QT is fine for linux.

    But Wx is cross platform and free! and tools like VisualWx which has support for WxRuby certainly help.

    Unfortunately it is only on windows atm AFAIK

    1. Re:Crossplatform Ruby by zorander · · Score: 1

      How does wxRuby compare to wxPython? I have extensive experience with the latter, but have never experimented with the former. wxPython has the best user-community of any open source project I've encountered, and Robin Dunn is IMHO one of the most dedicated project heads out there. There is also a lot of python-specific wx stuff in wxPython (custom widgets, STC, OGL, etc). Does wxRuby have similar extensions or is it basically a thin layer over wxWidgets?

  9. Nice one editors by Anonymous Coward · · Score: 0

    Java is not an acronym, nor is it capitalised. "Debugging" is not a proper noun, and so should not be capitalised. "May be", in this context, is two words.

    I could go on, but I'm not the one being paid to do this.

    1. Re:Nice one editors by TheRaven64 · · Score: 1, Funny

      Slashdot has editors now? I thought they just used a shell script to randomly select 1% of submitted stories. If not, then I have a script they might be interested in buying...

      --
      I am TheRaven on Soylent News
  10. Here's the fixed URL by Anonymous Coward · · Score: 0
    Looks like there's a space in the first URL.

    AccessControlListExample

    1. Re:Here's the fixed URL by Anonymous Coward · · Score: 0

      Seems like this lame Anonymous Coward (64.230.25.224) deleted it. Can you rollback it?

  11. KDevelop by Pemdas · · Score: 5, Insightful
    I love emacs. (No this is not an attempt to start a flamewar).

    Since I wanted to see what the fuss was about, I recently grabbed the most recent KDevelop and took it for a spin. It's got a ton of really, really cool stuff in there. Integration with valgrind is sweet. The debugger integration is a Good Thing. The reasonably intuitive API documentation access is great. The integration with QT designer is beautiful.

    If I were just starting to code, I'd probably use Kdevelop.

    However, I found over the course of a couple of painful days that I'm too dependent on some features of emacs to make the switch worthwhile. Quick searching. Tab indentation. Keyboard split buffers. Mouseless cut and paste.

    Some of these have equivalents in Kdevelop that would just require relearning a different way to work, which is fine, if somewhat aggravating in my personal case. But some, like tab indentation, don't. So I'm back in good old emacs.

    I hear that there may be an effort to embed emacs as one of the source code editor options, in which case I'd definitely switch. I'd probably even switch if there were some reasonable emacs-like bindings in Kate. It looks like a really cool tool generally, and I'm hopeful that I'll be able to make a switch sometime in the not too distant future.

    1. Re:KDevelop by Anonymous Coward · · Score: 0

      Some of these have equivalents in Kdevelop that would just require relearning a different way to work, which is fine, if somewhat aggravating in my personal case. But some, like tab indentation, don't.

      Settings | Configure KDevelop | Source Formatter | Indentation
      Settings | Configure Editor | Indentation

      Between these two screens, I can configure pretty much any common use. It's not very intuitive, I agree.

      I hear that there may be an effort to embed emacs as one of the source code editor options, in which case I'd definitely switch.

      Serves you right for not being a vi fan - there's already a vim kpart :).

    2. Re:KDevelop by david.given · · Score: 1
      If I were just starting to code, I'd probably use Kdevelop. However, I found over the course of a couple of painful days that I'm too dependent on some features of emacs to make the switch worthwhile. Quick searching. Tab indentation. Keyboard split buffers. Mouseless cut and paste.

      Ditto, ditto, ditto, except in my case it's with vim.

      I'd love to be able to use vim inside kdevelop. I'm actually a bit better off than you are, because there's a vim kpart, so it's theoretically possible to do: except whenever I actually tried it, it always died horribly.

      Maybe someone needs to come up with a good way of abstracting the text editor part of an application from the actual application logic, to make this kind of thing easy. However, I suspect that that would involve rewriting kdevelop, vim and emacs, so I doubt it'll ever happen.

    3. Re:KDevelop by Anonymous Coward · · Score: 1, Interesting

      KDevelop uses the Kate interface from KDE, which can handle any number of editor plugins (kvim, ) for example. I think the lack of a KEmacs, so to speak, stems mainly from the fact nobody has written it.

    4. Re:KDevelop by GnuVince · · Score: 5, Funny

      I think the reason there's a KVim and no KEmacs is because the Emacs folks didn't understand that the goal was to embed Emacs into KDE, not KDE into Emacs.

    5. Re:KDevelop by Q+Who · · Score: 1

      Rofl :))

    6. Re:KDevelop by fireboy1919 · · Score: 1

      Funny. Actually, KVim is quite broken when it comes to embedding.

      Maybe the Emacs folks just didn't want the embarassment (btw I'm a pure VIM user myself).

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    7. Re:KDevelop by immerrath · · Score: 1

      hey man are you trying to start something or what

    8. Re:KDevelop by Anonymous Coward · · Score: 0
      Maybe someone needs to come up with a good way of abstracting the text editor part of an application from the actual application logic, to make this kind of thing easy. However, I suspect that that would involve rewriting kdevelop, vim and emacs, so I doubt it'll ever happen.
      Yzis is a rewrite of Vim which will offer this. Part of the point is to allow easier integration into other applications like Kdevelop. So changes to Kdevelop shouldn't be that big of a deal.
    9. Re:KDevelop by 10am-bedtime · · Score: 1

      sometimes understanding a goal really well results in avoiding that goal.

    10. Re:KDevelop by Pemdas · · Score: 1
      Settings | Configure KDevelop | Source Formatter | Indentation
      Settings | Configure Editor | Indentation

      Nope, sorry. Those control how the editor defaults to indenting a block, but never let you bind a key (like, say, tab) to re-indent the current line of code, or the current block of code.

      Serves you right for not being a vi fan - there's already a vim kpart :).

      Hey, I said I was not trying to start a flamewar, you vim-using scum-sucking infidel! :)

    11. Re:KDevelop by Anonymous Coward · · Score: 0

      Nope, sorry. Those control how the editor defaults to indenting a block, but never let you bind a key (like, say, tab) to re-indent the current line of code, or the current block of code.

      I'm not sure what you mean by "re-indent". If you have a block of code selected and hit tab, it all gets indented to another level. If you hit shift-tab, it loses a level of indentation.

      Are you saying that in emacs, you can bind a key combination, so that it will automatically detect which block of code you are in and indent it another level? That doesn't sound too useful to me, but I suppose if you are used to using it then it would be a pain to give it up.

  12. Ruby seems on the right track. by master_p · · Score: 3, Insightful

    Developing web applications is a nightmare, because the knowledge domain is too big and too heterogeneous.

    Ruby seems on the right track: the decision of not using thousands of XML configuration files but rather doing everything in code seems like heaven.

    1. Re:Ruby seems on the right track. by guet · · Score: 2, Interesting

      Just out of interest, which web developement systems use thousands of XML configuration files?
      There must be some awful uses of XML config files out there, because a lot of developers complain about it.

      I don't know much about it, but seems like they could have a use in some circumstances, and allowing users to edit those rather than strings in the code might be a Good Thing. This depends of course on them having a decent end-user XML editor, clear and succinct XML, and tools for processing XML for the programmer.

    2. Re:Ruby seems on the right track. by master_p · · Score: 2, Informative

      "Just out of interest, which web developement systems use thousands of XML configuration files?"

      J2EE. Application servers. Tools that generate mappings between databases and Java classes. Struts. etc etc etc.

    3. Re:Ruby seems on the right track. by Anonymous Coward · · Score: 0

      FWIW, you are talking about "Ruby on Rails" (see rubyonrails.org), which is a awesome use of Ruby in it's own right. Rails is Ruby, Ruby is not Rails.

    4. Re:Ruby seems on the right track. by Kingpin · · Score: 1


      Thousands of files? Nah. Some files, with thousands of lines. Generated though, so what's the fuss?

      --
      Unable to read configuration file '/bigassraid/htdig//conf/14229.conf'
      Geocrawler error message.
    5. Re:Ruby seems on the right track. by TheLink · · Score: 1

      But what's the point?

      Don't tell me you have a normal text config file that looks something like:

      param1=1
      param2=10.2

      And then you run it through something to convert it to XML, and then that is parsed by the java application...

      That'd be weird.

      I still don't get it - e.g. I used the XML style config files for configuring Jetty, and it's bitten me before when I tried to configure something in the XML style (after digging through all the docs and copying the styles). Didn't work, after checking on the mailing list turned out that the XML configuration option just wasn't implemented by Jetty- had to pass it on the _command_ line.. D'oh...

      So what are the advantages?

      --
    6. Re:Ruby seems on the right track. by Ian+Bicking · · Score: 2, Interesting

      Python Is Not Java is a good description of how to approach programming differently when using a dynamically-typed language. Pretty much everything it says applies to Ruby as well. One of the things it mentions is that in most cases where Java programmers use XML, it's to make up for the deficiencies of Java, and you express the same things using Python (or Ruby) source code, which is easier to work with and more general than any XML configuration.

    7. Re:Ruby seems on the right track. by HiThere · · Score: 1

      Or, for that matter, Lisp. The first time I saw that argument it was someone claiming that XML was merely a weakened version of Lisp (well, of s-expressions, but basically that means lisp ... and he was saying this in a context that made this clear).

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
  13. Re:Why Ruby? Google cache by Anonymous Coward · · Score: 0

    Why Ruby? Page:s Google cache:

    HERE

  14. JRuby and RDT by Headius · · Score: 5, Informative

    As long as we're dumping Ruby links, I must plug a project I work on and a project I work with daily:

    JRuby is a 100% java implementation of Ruby 1.8. The most recent release is pretty old, but the version in CVS is shaping up nicely and is getting quite stable. I joined development over a month ago, and work has been rapidly ramping up.

    The Ruby Development Tool aims to bring a full Ruby develop/test/debug environment to the Eclipse platform. It is also rapidly maturing, and may in the future use portions of JRuby for parsing and debugging. While using or developing JRuby, the RDT is a welcome companion, allowing me to stay within Eclipse when developing both Java and Ruby.

    I would also recommend tracing back to previous Ruby posts on /. for more information and links.

    1. Re:JRuby and RDT by goofyheadedpunk · · Score: 1

      I'm curious, why reimplement Ruby in Java? What is the benefit of doing so?

      --

      What if the entire Universe were a chrooted environment with everything symlinked from the host?
    2. Re:JRuby and RDT by Anonymous Coward · · Score: 0

      Me too. There is also Jython which is python on java.

      Now, ruby and python are already languages that execute bytecode right? Also java executes bytecode right? So why you want to run ruby/python bytecode on JVM/.NET bytecode, escapes me.

      If you want bytecode use ruby/python. If not use C/C++.

    3. Re:JRuby and RDT by Headius · · Score: 1

      Ruby does not run bytecode, at least not until the new VM is completed (sometime in 2005). I don't know about python.

      Ruby is strictly interpreted in C Ruby. In Java Ruby we try to boil it down to an AST, but it's still strictly interpreted. It will be interesting to see how the Ruby folks come up with a more advanced VM; I'm sure we'll piggyback on their research.

    4. Re:JRuby and RDT by Anonymous Coward · · Score: 0
      So why you want to run ruby/python bytecode on JVM/.NET bytecode, escapes me.

      Jython is an easy way to extend your Java program with scripting capabilities - you can let the user type in some Python code, then execute it when needed. Example:
      PythonInterpreter x = new PythonInterpreter();
      x.set("someVar", someVar);
      x.exec(userCode);


      someVar's methods are automatically exposed to the Python code (i.e. you don't need to define the Java-to-Python conversion anywhere), and userCode is executed (it's just a String containing Python code). The only other thing to do is catch PyException.
  15. Get out your wallet by mrbnsn · · Score: 3, Insightful

    "a good programming tool for quickly developing a professional one off application"

    All well and good, but if your professional application is proprietary (non-open), you'll need a paid-up Qt licence to go with it.

    1. Re:Get out your wallet by gregarican · · Score: 1
      Exactly. That's why I use other toolkits such as the Tk Ruby extension. Then the GTK Glade stuff is out there as well for Ruby. Plus Fox, Wx, et. al. To me the Qt licensing makes me wary.

      There also a good IDE called Widestudio. It's a large download (over 100MB) because it comes with installs for Python, Perl and Ruby. But it's a good tool for creating effective GUI applications.

    2. Re:Get out your wallet by 10Ghz · · Score: 1

      Not if you do in-house software. Then you can use GPL just fine and not release your sources. If you are planning to sell your software for a living, but can't afford the relatively modest fee of commercial Qt, then you should REALLY reconsider your career-options.

      Do carpenters get free tools? No, they have to buy them. And if their products are good enough, they can easily afford them. If your software is so crappy that you can't afford Qt, may I suggest different career?

      --
      Lesbian Nazi Hookers Abducted by UFOs and Forced Into Weight Loss Programs - -all next week on Town Talk.
  16. wx..Ruby? by mattr · · Score: 1

    I've been getting into wxPerl as I've decided it's gained critical mass and you can do real things with it. Of course some functions are still getting filled out but it has a great mailing list and it is fun.

    Seems to me it would be really interesting if there was a wxRuby and a way to package the wxRuby app. Perhaps when parrot is finished this will be a ring to bind them?

    1. Re:wx..Ruby? by Anonymous Coward · · Score: 1, Interesting

      Have a look at the WxRuby homepage. I've used this before for coding up a frontend for a Ruby game and it has worked very well for me. I was also able to package it up into one binary via RubyScript2Exe and ExeRb which was important for me.

    2. Re:wx..Ruby? by Anonymous Coward · · Score: 0

      There is a wxRuby! Go to http://wxruby.rubyforge.org/

    3. Re:wx..Ruby? by davegaramond · · Score: 1

      wxRuby is nice, but sadly, as long as Ruby doesn't have OS threads ("real" threads), coding complex GUI apps in Ruby will still be a pain...

  17. <nitpic>Java isn't an acronym</nitpic> by JLavezzo · · Score: 1

    Yeah, um, it's just Java, a word, not JAVA. It's not an acronym for anything, like SQL (Standard [English] Query Language). It's not all caps for no good reason, like .NET. It's not even a witty recursive acronym like GNU (GNU is Not Unix) or PHP (PHP Hypertext Preprocessor). Just a word for coffee commandeered for another use.</nitpic>

  18. Why reimplement Ruby? by kahei · · Score: 3, Interesting


    Well, the trouble is that Ruby is a great language in search of a good implementation.

    The current Ruby implementation has various weaknesses -- primitive text support is the most mentioned one (you can't step through a string char by char, I kid you not). Lack of native threading (it uses weird homemade application-level threads) some concurrency issues (it's C with lots of static variables -- I may be very out-of-date here though) and integration problems (it's very much designed with a 'C and UNIX and nothing else' mindset) are also problematic.

    Thus, a port of Ruby to the Java or .net runtime, that kept the language intact but performed text processing, threading etc via those runtimes, would be absolutely amazing. The .net one stalled, though -- maybe the Java one is doing better.

    --
    Whence? Hence. Whither? Thither.
    1. Re:Why reimplement Ruby? by WayneConrad · · Score: 3, Informative

      That's a good summary of some of Ruby's shortcomings.

      You can step through a string character by character, though. It's just not obvious how, and that's a bit of a flaw. There should probably be an obvious method like "each_char".

      If you don't mind getting your characters as numeric codes, you can use String.each_byte. It's easy to turn each byte back into a character using Integer.chr:

      "abc".each_byte do |b|
      puts b.chr
      end

      Or use String.scan:

      "abc".scan(/./) do |c|
      puts c
      end

      Ruby being Ruby, there are probably another dozen ways to do it. And, for those who wish Ruby did have a String.each_char method, just add it:

      class String
      def each_char
      scan(/./) do |c|
      yield(c)
      end
      end
      end

      And now...

      "abc".each_char do |c|
      puts c
      end

      (Please excuse the lack of indenting. /. and I can't seem to agree on how to make indenting work.)

    2. Re:Why reimplement Ruby? by geniusj · · Score: 1

      irb(main):010:0> "hello".each_byte do |ch|
      irb(main):011:1* puts "%c" % [ch]
      irb(main):012:1> end
      h
      e
      l
      l
      o
      => "hello"

      Are you referring to something other than what I just demonstrated?

    3. Re:Why reimplement Ruby? by kahei · · Score: 3, Interesting


      (this goes for both comments above)

      I'm referring to stepping through a string character by character -- I should have said that rather than 'char by char', which is open to misinterpretation. I meant 'text character' rather than a C 'char' type, which can indeed be done with 'each_byte'.

      For instance, a lot of strings contain Asian characters that are intrinsically more than 1 byte long, or combining characters which consist of a 'main' character and 1 (for most european languages) or more (for the nightmare that is Vietnamese) accent marks. To ruby, it's all just bytes -- if 64 A7 03 A7 04 means an 'a' with an acute accent and a dot, ruby will cheerfully give you those 5 seperate bytes and let you implement the concept of a character yourself.

      There are various libraries for Ruby that extend the string class to handle text in different languages and encodings, but this is still nothing like as good as just being able to get, set, read, write, and match characters, as I can in most other high-level environments. Unfortunately, while the concept of a text encoding is built into ruby, it is hardcoded with knowledge of a few particular encodings and it only uses them for IO -- in internal processing, it's welcome to the wonderful world of each_byte.

      All this would go away (along with many other issues) if there were an implementation of Ruby for some modern runtime environment such as Java.

      This situation and the discussions behind it is one of the things that inspired me to write this essay (which may or may not be interesting, I just mention it):

      http://www.jbrowse.com/text/unij.html

      --
      Whence? Hence. Whither? Thither.
    4. Re:Why reimplement Ruby? by Anonymous Coward · · Score: 0

      you can't step through a string char by char, I kid you not

      What about String#each_byte? Or do you mean, more subtly, that Ruby doesn't know the difference between a byte and a char? If so, I agree, it does need better Unicode support.

      String#each_byte
      str.each_byte {| aFixnum | block } -> str

      Passes each byte in str to the given block.
      "hello".each_byte {|c| print c, ' ' }
      produces:
      104 101 108 108 111

      Lack of native threading (it uses weird homemade application-level threads)

      You can use native threads these days, though hardly anyone does. But in practice the "weird homemade" threads (??) are just fine. Haven't you ever written a program with an event loop that does select() based I/O, basically a big state machine? Think of Ruby as having that feature built-in.

      it's C with lots of static variables -- I may be very out-of-date here though

      What on earth are you talking about? You just said it doesn't do threading so how could there by concurrency issues?

      C and UNIX and nothing else

      What else is there? :-)

      a port of Ruby to the Java or .net runtime

      That would not be "amazing", that would be a step backwards. The Java and .NET VMs are incredibly simplistic and don't support an execution model with first-class continuations. Maybe some Lisp virtual machine will do the trick. If you want .NET try Iron Python or whatever it is.

      Yes, Ruby needs a *better* implementation, but Java and .NET will have nothing to do with it.

    5. Re:Why reimplement Ruby? by Headius · · Score: 1

      You hit the nail on the head. While a Java implementation like JRuby isn't able to implement the full set of POSIX methods provided by Ruby, it is able to provide an entirely different VM. While JRuby still needs work in plent of areas, it already provides things like JVM/native threads for Ruby threads, integration with standard Java code, and easy access to the full J2SE library set.

      We've also started the process of (helping with) standardizing the "Rubicon" suite of unit tests that defined the Ruby "specification", as well as flushing out a couple inconsistencies in Ruby core. Competition is always good, especially when the two competitors aren't necessarily going to be used in the same domains!

      The Rubicon tests are on rubyforge

    6. Re:Why reimplement Ruby? by HiThere · · Score: 1

      You have a good point...but Ruby isn't alone in having this problem. In fact most languages that I've encountered have it. Partially this is because it is so common for a language to assume that a character is a char, and this is largely for efficiency reasons (and historical reasons, admittedly).

      Currently D (Digital Mars D) is having a library built to address the problem, even though the language was designed with a wide character type. Stepping through a character string in an arbitrary character set appears to not be a simple problem. (The solution being adopted appears to basically be import a library that already handles the problem from outside...reasonable, but not what one does for a trivial problem.)

      But do be aware that this isn't a problem which most people even notice. Usually one can say "this string is in 8 bit chunks" or "this string is in 16 bit chunks", but if one goes to full unicode, then some chunks will be one size, and some another (up to 32 bits).

      I can see utility in including this functionality...but it's not a basic part of the logical design, and SHOULD be handled as a library. Possibly as one that's included with the distribution, but still as a library. (Just consider that even something as basic as IO is now generally agreed to be properly handled by a library.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    7. Re:Why reimplement Ruby? by kahei · · Score: 2, Informative

      if one goes to full unicode, then some chunks will be one size, and some another (up to 32 bits).

      Sounds like a case for my Unicode FAQ!

      http://www.jbrowse.com/text/unicode.shtml

      Character set != encoding. Longest representation of a character in a standard Unicode encoding is necessarily > 32 bits.

      In any case, Java, C# and (with eg Boost) C++ don't have this problem and Perl and Python, while not perfect, are much better than Ruby. If you have a mass of generic text to process, like maybe a big database of emails written in various languages, with Ruby your first task is to sit down and implement the relevant character encodings, followed by an enhanced string class and maybe plugging in a new regex engine. This makes Ruby a particularly bad choice for a lot of things, although I maintain a bit of an interest in it anyway because it's a good way to practise reading docs in Japanese.

      --
      Whence? Hence. Whither? Thither.
    8. Re:Why reimplement Ruby? by davegaramond · · Score: 1

      > > C and UNIX and nothing else
      > What else is there? :-)

      Suddenly your post loses all credibility. :-)

      The "lacking implementation" (e.g. no native threads in CRuby, subpar speed, Unicode support) problem is very real and needs to be addressed as soon as possible. Ruby is already 10 years old, people expect it to be stable and solid, language-wise or implementation-wise.

    9. Re:Why reimplement Ruby? by HiThere · · Score: 1

      If you are practicing "reading docs in Japanese", then I can understand why this would seem more important to you than it does to most people.

      OTOH, I was surprised that in Ruby a characterwas, by default, an integer. And I can certainly sympathise with having strings be an array of chars, where chars were an appropriate number of bits long. But this would greatly slow down regexp handling, which is an important part of how Ruby operates. (I didn't know that full unicode ever required more than 32 bits for a character, but that's another reason to avoid it...that over a fourfold expansion in the size of documents, and probably in the amount of ram used. [Plausibly ONLY in the amount of ram used.. disk files can be compressed with reasonable expense.])

      Still, for me, and for most people I know, this is only of academic interest. I only deal with 8 bit characters. I know that it's important that programs be able to deal with more flexible character sets...e.g. UTF-8, 16, ... but I never personally need it.

      OTOH, it's quite surprising that a language coming from a person whose primary language is Japanese has this feature. It causes me to believe that there must be quite strong reasons why it's a better choice even than it appears to be on the surface.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    10. Re:Why reimplement Ruby? by Forbman · · Score: 1

      So can Java classes be used within Ruby? If so, then why not figure out which ones need to be used to handle I18N/L10N on strings in a clever Ruby class?

      Or, for Win32, identify which Win32 DLLs/Com objects need to be invoked to do it, etc.

  19. Ruby's remaining problems by fizbin · · Score: 3, Informative
    Ruby still has two big problems that prevent it from being my scripting language of choice when compatibility with others isn't at issue:
    1. I find Ruby's limited multi-language string support a bit surprising for a language that was created in Japan. Perl and python have had UTF support built into strings for... how long now? Come on, ruby, get with it. (I frankly would expect ruby to come with the swiss-army-knife character set support that you see in emacs+mule)
    2. Performance. Compared to even, say, python, ruby has performance problems. Most of the time this isn't an issue, but when it is it makes me reach back for perl. Ruby's performance should be sufficiently good so that when I find ruby isn't fast enough, I'm at the point where what I need to do is reach for a compiled language.

    Of course, any scripting language is a big disadvantage when compared to perl because only perl has CPAN. The organized central archive for extensions with support distributed as a standard module was a brilliant move by Larry Wall; every other scripting language is still playing catchup, and still no one else can compare to even where CPAN was four years ago. (RAA is better than nothing, but it's still not there. CPAN's hierarchical naming scheme, while occasionally inconsistent, was a really good idea)

    For commercial use, I'd also want some of ruby's remaining licensing issues cleaned up, but I understand that's been taken care of. (I haven't checked lately)
    1. Re:Ruby's remaining problems by Anonymous Coward · · Score: 3, Informative

      Well, it supports *Japanese* encodings! This is a shortcoming though, for some apps.

      Performance: Well, don't forget it include programmer performance. My Ruby programs are written in 1/5 the time of my Perl programs and usually have acceptable performance.

      Ruby is dual-licensed, and one of the licenses is the familiar GPL so commercial use is no problem.

  20. Re:Good morning by Anonymous Coward · · Score: 0
    Ruby (with KDE bindings) maybe just the thing for you

    The word "maybe" is a noun or adverb, not a verb. You meant to say "Ruby...may be just the thing for you." Words mean things, and if you can grasp the subtleties of a language like Ruby you could probably also understand the syntax of a language like English if you tried.

  21. Point of Ruby + Qt? by TampaDeveloper · · Score: 1

    Can someone please tell me what the advantage of Ruby+Qt is? I'm not knocking open source. I can see lots of use for commodity/infrastructure software. In fact I plan to open source a CRUD tool I needed to build for a project. But to pay the bills, I need to develop vertical. $1550+ seems a little steep just to maintain my intelectual advantage. Especially when I can do it for $379.

    1. Re:Point of Ruby + Qt? by Anonymous Coward · · Score: 0

      I current OSS languages kits and GUI lib bindings do not compete with commercial 4GL tools for GUI development. Python and Ruby will not be the same as Delphi (which by the way is far, far advanced than RealBasic though it does not support the Mac like RealBasic) when it comes to drag and drop WYSIWYG GUI design.

      The advantage of the dynamic languages is in.. well the language. I know Python/Ruby/Perl to be at least 5 times more productive than Basic/Pascal/C++ variants.

      Your best bet is to choose wisely (Do I have to write more GUI code for this application or manipulate data structures?) and use where one is more appropriate (Call code across languages so that you can use the language that is right for the job - This will take some getting used to but it is well worth the effort).

    2. Re:Point of Ruby + Qt? by Anonymous Coward · · Score: 0
      > $1550+ seems a little steep just to maintain my intelectual advantage.

      You might want to achieve that intellectual advantage before you start worrying about maintaining it. Especially if your intellect is what's paying the bills.

      BTW, Konqueror (an open source browser) includes this nice thing called a spellchecker built-in. It comes in handy in times like these.

    3. Re:Point of Ruby + Qt? by TellItLikeItIs · · Score: 1

      Yeah, I was speaking specifically of cross platform development. Thats the only reason I can think of to use Qt. I use whatever language is best for the job. I've used Perl many many times. I think you destroy your credibility as soon as you start saying its 5 times more productive. I suppose it depends on the developer. Different strokes for different folks.

    4. Re:Point of Ruby + Qt? by TampaDeveloper · · Score: 1

      Thanks for taking a cheap shot at a typo. I was at work, thus the lousy browser. I'm happy with Safari (includes spell check) thank you very much. And sorry I struck a nerve by making you try to come up with a use for Ruby and Qt.

  22. KFlow by Doc+Ruby · · Score: 1

    Where's the flowchart preprocessor for KDevelop? I need to whip out flowcharts to snag marketdroid budget slices, then compile the flowcharts into Ruby or Perl for prototypes, then all the way "down" to C++ or Java. In the same IDE, showing the flowcharts back to the marketdroids in demos at every step, to keep their ADD nailed to their check-signing hand.

    --

    --
    make install -not war

    1. Re:KFlow by Anonymous Coward · · Score: 0

      Check umbrello

    2. Re:KFlow by Doc+Ruby · · Score: 1

      That looks cool - how's the code it generates? How's the UML it regenerates from code tweaked in emacs?

      --

      --
      make install -not war

  23. Re:Java isn't an acronym by Anonymous Coward · · Score: 0


    "Nitpic" is not a word.
    SQL stands for Structured Query Language
    "PHP Hypertext Preprocessor" should read "PHP: Hypertext Preprocessor" (you forgot the colon).
    </nitpick>

    Have a nice day. :)

  24. J2EE by guet · · Score: 1

    Thanks; never used Java or Struts so that'd be why I wondered what all the fuss was about.

  25. Someone please tell me what I gain over Python? by _am99_ · · Score: 4, Interesting

    I learned Python last winter and have not looked back to Java despite being a Java programmer since it was in wide-distribution.

    And since Python makes win32 programming easy for those who don't use Visual Studio, I have learned to be a Windows programmer over the last couple of weeks.

    What do I gain over Python by switching to Ruby? I see a lot of explainations, but as far as I can tell, in addition to the awesomeness of Python's language and libraries, these are the things that I need that I can't seem to find in Ruby(but might not be looking in the right place):

    1) Java byte-code compiling (jython)
    2) full win32 APIs
    3) full win32 COM access
    4) Complete Object Database implementation (ZODB)
    5) List-comprehension

    Someone please educate me on the advantages of Ruby over Python. Cause right now, it is hard to imagine a better language than the snake!

    1. Re:Someone please tell me what I gain over Python? by Anonymous Coward · · Score: 1, Interesting

      Python is okay. I'd hardly call it "awesome" but it's kinda like the Java of open source. Gets the job done and there are lots of libraries (and lots of half-baked code).

      Ruby does have some *language* improvements over Python. For instance blocks and a lighter syntax, and also a real (and only ONE) object model.

      Ruby also has a much nicer community. The Python community has essentially become the Perl community (arrogant and self-important).

      I like how you list "List-comprehension" as a *FEATURE* of Python. It's a strange little arbitrary syntactic wart on the language. In Ruby you can write your own control structures.

      Also I don't know why you list "complete object database implementation" (a third-party system) as a language feature either. Ruby has libraries that give it *transparent* object persistence! For instance you just load the object and change a field, and the change is persisted. I'm sure Python has the same thing.

      Since you seem like a Windows dude you might not be interested in Ruby's Unix-centric view. When you upgrade to a Powerbook you might like it. :-)

      But for now just check out that Rails video on the Rails web site, it's just 10 minutes. Then try and implement the same thing in Python.

    2. Re:Someone please tell me what I gain over Python? by the+quick+brown+fox · · Score: 2, Interesting

      The advantages right now are mostly not pragmatic, but aesthetic. Programming with anonymous functions, closures, and higher order functions is more convenient in Ruby. The OO model seems better thought out.

      JVM implementation: http://jruby.sourceforge.net/

      Win32 support:
      http://www.rubycentral.com/book/win32.ht ml

      Object DB: http://www.garret.ru/~knizhnik/dybase.html (I don't know anything about this one, just found it on Google)

      List comprehension: Ruby blocks are a more general (and IMO more elegant) mechanism. For example,

      [x*2 for x in mylist]

      becomes

      mylist.map{|x| x*2}

      Note that in the Ruby version, x*2 doesn't need to be a simple expression; it could be any number of statements, and the return value would be used. So you could do this (using do/end instead of curly braces):

      user_ids.map do |user_id|
      result = webservice.lookup(user_id)
      if result.success
      return result
      else
      return nil
      end
      end

      That's a pretty stupid example, but you get the idea.

      It's not controversial, I think, that Python's bigger userbase and greater number of libraries give it an edge over Ruby for many real-world projects. But Ruby is suitable for a surprisingly large number of situations, and some people feel strongly that the elegance of the language makes it worth using whenever possible.

    3. Re:Someone please tell me what I gain over Python? by Anonymous Coward · · Score: 0

      The difference between the languages is not too huge. Just have a quick look at both and pick the one that seems to suit you more. Good reasons to go for Ruby are blocks and the slightly deeper OOP roots. Reasons for Python seem to be a bigger community (though that can also be a downside) and more available libraries.

      I think the difference keeps decreasing and if Parrot turns out to be a success (who knows) all this will be pretty irrelevant anyway.

    4. Re:Someone please tell me what I gain over Python? by dana_virtual · · Score: 1

      I tend to agree with the writer's comments, even though they may draw some flames. As an extremely satisfied Python user, I find daily delight in using the robust, efficient O-O featues of Python, and still feel that syntactically Ruby is a bit ugly. I find some new treasure in the Python trove almost daily as well. In fact , the Python cornucopia runneth over so much that there's even a daily newspaper of the Python universe : http://www.pythonware.com/daily/ (usual disclaimer: I am not assocated in any way with ...)

      In touting Ruby, a respondent will invariably trot out list comprehension in Python and then suggest that blocks in Ruby are more asthetically pleasing, never mentioned that:

      1. List comprehension is sort of philosophically deprecated in Python and
      2. Generators serve the same function in Python as blocks do in Ruby, albeit with even more transparency/clarity/asthetic beauty in Python than in Ruby.

      One of the acid tests for a language (certainly not the only one, but a really big one for journeyman developers) is the number of ready to roll third party libraries available to enable the language to create sophisticated and ready to deploy applications using only the language itself . Here, IMO, Python is unequalled by almost anything else.

      Every time I look longingly at some other language (Groovy, Judoscript, ECMAScript, Ruby) I find it deficient aong some important dimension. (e.g., Groovy has a heavy dependency on Java, Ruby is immature and has a weak GUI story and a lot of roll-your-own aspects, and so on)

    5. Re:Someone please tell me what I gain over Python? by davegaramond · · Score: 1

      In touting Python, a respondent will invariably trot out generator in Python and then suggest that generators are more transparent/clear/aesthetically pleasing thatn Ruby blocks, never mentioned that:

      1. Ruby does not *need* generators. Generators are Python solution to a Python problem.

      2. Ruby can *easily* implement generators, and the resulting syntax is as "beautiful"/aesthetically pleasing as in Python.

      Search the Web or Slashdot for past discussions on this.

      However, since you're very comfortable in Python, it's very likely that you will find Ruby too Perl-like or too cryptic, as 95% of all Python users.

    6. Re:Someone please tell me what I gain over Python? by davegaramond · · Score: 1

      One of the acid tests for a language (certainly not the only one, but a really big one for journeyman developers) is the number of ready to roll third party libraries available to enable the language to create sophisticated and ready to deploy applications using only the language itself .

      I wouldn't call it an acid test for a language as much as for the _popularity_ of that language.

      Here, IMO, Python is unequalled by almost anything else.

      Umm, have you heard about CPAN?

    7. Re:Someone please tell me what I gain over Python? by Anonymous Coward · · Score: 0

      However, since you're very comfortable in Python, it's very likely that you will find Ruby too Perl-like or too cryptic, as 95% of all Python users.

      When I look into Ruby sources, that's what I see. Now most of Pyhton source I have seen are examples of good craftmanship. And you can see how language developed over years.

    8. Re:Someone please tell me what I gain over Python? by dana_virtual · · Score: 1
      Dave, of course I have heard of CPAN. Have you seen RubyGems -- an attempt at doing it one better. GVR's response, when asked why no "CPAN for Python" says (perhaps tongue-in-cheek?) that it's because Python is already batteries included (i.e., more complete out of the box ) and doesn't really need a CPAN equivalent. That may or may not be true, but don't shoot the messenger for delivering the comment.

      As far as the acid test comment, yeah, you're probably right. The number of third party libs is only a measure of popularity. Perhaps I could make the case to you that popularity is a classical weak measure of other important atributes of a language, such as useability, programmer productivity, joy of programming, ease of refactoring, code clarity, etc. Thanks for the insightful comment

    9. Re:Someone please tell me what I gain over Python? by dana_virtual · · Score: 1
      I am not uncomfortable in Ruby. In fact I am associate tech director of a large DARPA project whose test and evaluation environment is completely implemented in Ruby.

      My concerns are indeed that overloads and other cryptic symbology (access levels for attibutes, PERL-esque conventions) make Ruby somewhat less readable than Python, especially at a first read. I would contend that fewer symbological transform required by the reader mean less to be forgotten or misunderstood.

      My real concerns (from my 4 year involvement in one of the largest practical deployments done completely in Ruby), are more that Ruby is less mature and stable in many cases (the Ruby thread model and lack of a free, useful GUI lib come to mind).

      Many time, when I am racing toward a solution, I don't want to be bothered with inventing for the first time (or re-inventing) an algorithm or a library. Perhaps that is just the Pragmatic Programmer in me (apologies to Mssrs Thomas and Hunt). Perhaps as you suggest, it's just a matter for personal preference.

      At ant rate Dave, I found you barbed comments enjoyable; both witty and insightful. As an aside, I believe that we in the agile languages community have more things tht unite us than divide us. My personal crusade is to open more people up to agile languages in general (see my JavaOne presentations on Scripting Languages and Java, in both 2002 and 2004).

  26. There is only one guide to Ruby... by Copley · · Score: 5, Informative

    You have to read this. It's more than an intro to Ruby... It's a mini adventure!

    Why's Poignant Guide to Ruby

    Those foxes! That cat! The crazy goat!

    --
    I am bald
    1. Re:There is only one guide to Ruby... by Lerxst+Pratt · · Score: 1

      Mod parent up! This is the best place to start for someone who has never tried Ruby. Learning any programming language has never been so much fun or easy!

      Ummm, watch out for the Chunky Bacon too!

  27. It's not free.... by Anonymous Coward · · Score: 0

    ...or at least the 2nd edition of the programming manual is not free. Of, course there is no reason why it should be free. However, this might explain why the post was entered.

    Hey, it's not easy to sell books these days.

  28. Ruby thread scheduler uses gettime.. DANGER!!! by Groth · · Score: 2, Informative

    I like both ruby and python. In a recent project were we tried to use ruby for linux OS control I came across a dangerous problem.

    The Ruby thread scheduler relies on gettime to schedule threads. What's the problem with this? Just change our clock back in time will running a threaded ruby application. You'll notice that your thread stalls and will stay that way until time catches up with it.

    For this reason alone I can never recommend Ruby until it gets a proper thread scheduler that employs a more reliable scheduling method or uses pthreads.

    1. Re:Ruby thread scheduler uses gettime.. DANGER!!! by davegaramond · · Score: 1

      Agrees. But this is the limitation of the implementation. In the future Ruby will most probably have OS threads. Currently it implements its own threads. Don't overlook a nice language because of the implementation.

  29. What about Lush? by Anonymous Coward · · Score: 0

    Another cool scripting language is Lush.

    Python and Ruby have too many anachronistic features for my taste. Also, Lush is good with numerical stuff, which is what I need.

    Ruby distinguishes variables from constants by the fact that the identifiers of constants start with a capital letter. Python relies on indentation for semantics

    I can say only one thing: WTF?

    Ever since FORTRAN came out people realized that typing variables with tricks on the name and using indentation to mean stuff were very, very st00pid. ideas.

  30. Ruby is wonderful by neoneye · · Score: 1

    I love Ruby.

  31. Why not? by willCode4Beer.com · · Score: 3, Insightful

    I discovered Ruby a while back after reading Dave Thomas' "The Pragmatic Programmer". One of his suggestions was to learn a new programming language each year. I psuedo-randomly picked Ruby. It has some interesting and unique features, that have helped me later on with C++ and Java programs.

    One of the advantages of learning new languages, even though they may not get used professionally, is the ideas and metaphors that come with the language. Each language was designed to solve a problem, and almost every programming language excels in the problem space for which it was designed. Each also leads to a new way of thinking and approaching a problem (flow, lists, objects, aspects).

    By learning from the experiences of others, we can become better programmers and build better programs. We always here why YAPL? or YASL? I say why not? You don't have to use every little language that pops up at work. But, if you learn about the thought processes behind it, you can apply the solutions in other languages.

    The article discusses doing RAD in KDevelop. This isn't for enterprise apps but, for getting proof of concepts or prototypes together quickly. I seem to remember a while back an article about doing KDE RAD with JavaScript and DCOM. That was some cool stuff. I played with it and was able to get an app together in a matter of minutes.

    Can't we all drop the negative attitudes for a bit and remeber why we got into programming?

    --
    ----- If communism is a system where the government owns business, what do you call a system where business owns govern
  32. Good for enterprise, fat-client apps? (RAD) by Phatmanotoo · · Score: 1

    If you are looking for a good programming tool for quickly developing a professional one off application

    Yes, I'm still looking for something like this, and I want it to be cross-platform. Of course it should be RAD-like, that is, it should have some kind of GUI builder which is truly effective. But most importantly, it should be definitely focused on building forms and reports. On the other hand, I could care less if the underlying language is Python, Ruby, Pascal, or even some sanitized version of Visual Basic.

    What I'm describing is the cross-platform equivalent of VB, PowerBuilder, or Delphi. Kylix was a great hope, then Borland let it die. Rekall might be it, but is probably lacking in certain areas.

    In my opinion, something like Python with WxWidgets, coupled with some decent GUI builder (which?), some decent forms builder (which?) and some Reports builder (ReportLab maybe?) could be pretty close to this ideal.

    1. Re:Good for enterprise, fat-client apps? (RAD) by TrancePhreak · · Score: 1

      In my experience python on Windows with WxWidgets works rather dreadfully. 100% CPU with large amounts of RAM required. Sometimes it had trouble with locking up. All of these issues may have been resolved as I haven't really checked, but they were never fixed in the apps I tried to use. The issues were also evident in a large number of users, so my setup was not to blame.

      --

      -]Phreak Out[-
  33. Where's [where is] by soloport · · Score: 2, Insightful

    However, for spelling's sake, you should use plural

    No, actually, he's correct. However, for grammar's sake, you should go back to school.

    (e.g. "I know, my friend. They've been quite rare, these days.")

    1. Re:Where's [where is] by nihilogos · · Score: 2, Informative

      "Where is the thought provoking stories ... " how is that correct? It's "Where are the thought provoking stories ... "

      --
      :wq
  34. Re:Python by Eric+Moss · · Score: 1

    Oy! There's an easier way. I wrote 110 lines of Common Lisp code that interprets strings like "cat /etc/passwd | sort > foo" and captures any results that sh would normally print to stdout.

    Thus, you can be inside Common Lisp (a script or a listener), call (capture "cat /etc/passwd | sort") and then manipulate the results inside Lisp. If all you need is the side-effect, that's ok too: (capture "cat /etc/passwd | sort > foo").

    Eventually I might add the option of declaring aliases that can call a mix of sh and Lisp code; who knows, maybe even a way to let you put in a BNF to declare your own preferred mini-language.

    So anyway, you can now use Lisp syntax where it's best, and revert to sh syntax when you have to. This lets you leverage existing scripts and files.

    Plus... this interpreter doesn't invoke sh to run the Unix commands, thus reducing that overhead.

    Plus... by using Lisp, you can load other Lisp code into the current image. That saves excess spawning of processes, lets you use the Lisp debugger's full power, and gives you more global knowledge about what's happening.

  35. Upcoming Python Support? by nurb432 · · Score: 1

    I know its rumored.. anyone have any facts?

    --
    ---- Booth was a patriot ----
  36. Re:Good morning by Mooncaller · · Score: 1

    If you do not have anything to say, look for a grammerical/spelling error and post accordingly. Do this even if the error has all ready been pointed out. Do not concider the fact that not everyone is a native english speaker. Just do it. It is the right thing to do.

  37. Re:Python by voodoo1man · · Score: 1
    I wrote 110 lines of Common Lisp code that interprets strings like "cat /etc/passwd | sort > foo" and captures any results that sh would normally print to stdout.
    Care to share? Or is this an exercise left for the readers? :) (I think something like this that runs on a bunch of Unix Lisp implementations would be pretty useful, and your code could be a good starting point).
    --

    In the great CONS chain of life, you can either be the CAR or be in the CDR.

  38. Re:Good morning by Anonymous Coward · · Score: 0

    T'es qu'un gros bouffon.
    Tes subtilités, tu peux te les carer ou je pense.

  39. Re:Python by Eric+Moss · · Score: 2, Funny

    Sure. But get this. I tried to post my code as "Code" and the spam filter on slashdot tells me I have too many "junk" characters. That's anti-Lisp bigotry! ;P

    Email me at ericmoss@inebraska.com and I'll send it to you. Maybe you can get it to post correctly. ;)

  40. Re:Python by putko · · Score: 1

    Use "ECODE" instead of "PRE" or "CODE".

    --
    http://www.thebricktestament.com/the_law/when_to_s tone_your_children/dt21_18a.html
  41. Are you sure about KDE? by leonbrooks · · Score: 1
    --
    Got time? Spend some of it coding or testing