Slashdot Mirror


Rubyx OS - A Testament To The Power Of Ruby

Andrew Walrond writes "Rubyx the OS is created from source by rubyx the ruby script. Got it? The same small ruby script handles all subsequent package management, customised parallel and distributed user-mode package builds, and can create a live CD. For good measure, Rubyx (the os) sports an all new init and rationalised service management system written in ....can you guess?..."

44 of 121 comments (clear)

  1. Article... by Creepy+Crawler · · Score: 4, Funny

    ---For good measure, Rubyx (the os) sports an all new init and rationalised service management system written in ....can you guess?..."

    PERL ?

    --
    1. Re:Article... by JDWTopGuy · · Score: 2, Funny

      RTFA, it's in Malbolge.

      --
      Ron Paul 2012
  2. ROS by davegaramond · · Score: 4, Informative

    FYI, there's another initiative to develop a fully Ruby-based operating system (including the kernel), though one wonder when -- if ever -- this project will deliver something usable.

    1. Re:ROS by jonadab · · Score: 3, Interesting

      > FYI, there's another initiative to develop a fully Ruby-based operating
      > system (including the kernel), though one wonder when -- if ever -- this
      > project will deliver something usable.

      The mere existence of the initiative, as anything other than a joke, increases
      my interest in Ruby a thousandfold. I've been passing on learning Ruby because
      I've been figuring it's Yet Another Language With Perl Envy, but if these
      people understand the importance of writing an operating system in a VHLL
      and throwing out all the legacy C code, then I'm going to have to pay some
      closer attention to the language they want to do it in. Maybe they've got
      something after all.

      --
      Cut that out, or I will ship you to Norilsk in a box.
  3. My thoughts on Rubyx by Anonymous Coward · · Score: 4, Funny

    I am not familiar enough with Rubyx to comment on it one way or another. But I will tell you this - if I am ever in the market for an obscure and potentially very slow object oriented scripted OS - I will certainly consider Rubyx to be in my top 20 picks.

    1. Re:My thoughts on Rubyx by the_womble · · Score: 3, Informative

      If you had actually followed the link you would know that the whole OS is not written in ruby. It is Linux with a ruby installer and package system.

    2. Re:My thoughts on Rubyx by Trejkaz · · Score: 2, Funny

      Interesting. Gentoo is Linux with a Python package system, so why is Rubyx so special? ;-)

      --
      Karma: It's all a bunch of tree-huggin' hippy crap!
  4. Logo by Steven+Reddie · · Score: 4, Funny

    Lets start an OS written entirely in Logo. Drawing buttons and such will be easy enough, but it's the scheduler that is going to take some creativity. All user apps will also be written in Logo and it will be possible to virtualise the entire OS inside a user app. Extra care must be taken to ensure process don't write over the top of each other.

  5. Enhanced Package Management by osewa77 · · Score: 2, Insightful

    If Linux can become more flexible in the areas of package management and system configuration... For example, making it easy to run multiple versions of, say, gcc on the same system and switch between them at will; automatically generating configuration files based on system-wide settings. Seamlessly integrating with the latest source or binary packages of my favorite software ... and letting all these features be available from the bash shell, while making it easy for GUI wrappers to be built for those shell apps ... these are the things that can make Linux a more ideal platform! At the end of the day, I really don't care what language the configuration scripts are written in!

    1. Re:Enhanced Package Management by Jerf · · Score: 2, Informative

      I don't want to be accused of irrational advocacy of any particular distribution, but for the record, everything you mention in your posts already exists in at least one very popular distribution, and probably more.

      Perhaps you should poke around the existing world a bit more. If you've only tried one distro odds are good you haven't found your match. Red Hat(/Fedora), Gentoo, and Debian are probably good ways to sample the major ways of doing distros; each has a fairly different philosophy and is large enough to have good implementations of the philosophy in running code. OK, I'm a Gentoo myself, and that's the distro I was referring to above, but they are all good distros and I've had the opportunity to use them all lately from start to finish, and they are all fine choices.

      (I think Debian meets all your requirements too, but I'm not too sure about the multi-gcc one. I'd expect it is but there might not be a built-in switcher. Gentoo has 'gcc-config', which works as you describe, and also has a pretty clear "configuration files based on system-wide settings", the USE flags. Fedora I'd have to check on; I don't how clean you could make source integration but good package management in it is definately possible if you use yum in addition to rpm; rpm alone kinda sucks but with yum it's OK. I don't think multiple gcc's works well in Fedora, but I could be wrong. If you have a source RPM I believe it's rpmbuild --rebuild [source RPM] but I don't have Fedora handy to look at the man pages; corrections welcome on anything in this paragraph. I've used them all but I wasn't looking for these specific things.)

      "What's your distro?"

    2. Re:Enhanced Package Management by Deagol · · Score: 4, Interesting
      (I apologize for this lengthy off-topic post, but I had to respond to the parent's desire for concurrent multiple versions in a package system. Maybe someone with coding skill -- unlike myself -- could run with it.)

      For example, making it easy to run multiple versions of, say, gcc on the same system and switch between them at will...

      I have a home-brew system like this, and I would die of joy if something like Debian's apt or {Free,Open}BSD's ports system would integrate it.

      I actually can't take credit for it, and I really don't know if it's that unique, but the people I've introduced it to love it. And thanks, Lou, for showing it to me. It's a shame this post won't get a larger audience (then again, maybe it's a conceit to believe anyone would actually care. :)).

      Okay, here goes...

      I have on all of my machines (or "boxen", just to annoy those of you who loathe the term), a directory called /mfs -- "my file system". The philosophy is that of /opt or /usr/local: a place to install custom software without colliding with the main system tree.

      Within /mfs, there's dist, src, obj, & pkg. I place the tarballs in dist, I unpack the source into (you guessed it) src, I (sometimes) build in obj, and I install into pkg.

      My most common use is installing OpenSSH onto various platforms, so I'll use that to illustrate.

      I download the tarballs into my dist dir: tcp_wrappers_7.6.tar.gz, openssl-0.9.6l.tar.gz, zlib-1.2.1.tar.gz, & openssh-3.8p1.tar.gz.

      Next, I unpack them into src, where I usually build them, though sometimes I build them in obj.

      Sometimes, it's a matter of a simple --prefix paramater to the config script. Sometimes it takes modifying Makefiles. But usually without fail, I can shoehorn most any application into it's proper place: /mfs/pkg/package/version.

      The goal is to totally isolate the application within its own directory -- even it's own etc, tmp, var (or whatever) directories. If it's possible (never mind the convenience of making it happen), that program will never collide with another version of that program on the system: .pid files, logs, sockets - nothing.

      So when all's said and done, I now have:

      /mfs/pkg/openssh/3.8p1
      /mfs/pkg/zlib/1.2.1
      /mfs/pkg/openssl/0.9.6l
      /mfs/pkg/tcp_wrappers/7.6

      Each, of course, has all of the etc, bin, lib, include, sbin, var, tmp, and man directories the app needs to run.

      Once this structure is in place, it's pretty obvious where it leads: you can painlessly have concurrent versions of any program and/or library you could ask for. Since apps are linked to a specific library version, installing a new version of that library won't collide with the old one.

      Ever try installing a current SRPM of openssh onto an older Redhat release? It's a nightmare! The RPM requires a current version of openssl, but the KDE libraries all require openssl 0.9.5 (or some such). You just cannot get it to work.

      So you may now be thinking to yourself, "Okay, that's kinda useful. But when you have hundreds (or thousands) of apps, your PATH would be insanely long. This just won't work."

      That's a good point -- but there's a solution. Use the "lndir" command from within /mfs, to link your desired package into the root /mfs directory:

      cd /mfs && lndir pkg/openssh/3.8p1

      Now, thanks to the lndir command, you now have the directories /mfs/{bin,etc,sbin,man} populated with symbolic links to the actual programs. Now you can set your PATH, MANPATH, and even init scripts to point to the "main" /mfs directories.

      But wait, there's more! Let's say we h

    3. Re:Enhanced Package Management by Nevyn · · Score: 2, Interesting
      Maybe someone with coding skill -- unlike myself -- could run with it.

      There is already stow.

      Ever try installing a current SRPM of openssh onto an older Redhat release? It's a nightmare! The RPM requires a current version of openssl, but the KDE libraries all require openssl 0.9.5 (or some such). You just cannot get it to work.

      Without upgrading you mean, ok fair enough. Although I'm not sure why I'd care about what version openssh is (unless it's a security errata -- in which case it's coming from my vendor anyway). But using a better example of evolution or whatever...

      So you may now be thinking to yourself, "Okay, that's kinda useful. But when you have hundreds (or thousands) of apps, your PATH would be insanely long. This just won't work."

      That's a good point -- but there's a solution. Use the "lndir" command from within /mfs, to link your desired package into the root /mfs directory

      Ta-da you've now got the same problem plus a billion symlinks. You could argue that putting a serious amount of crack in the PATH and/or LD_LIBRARY_PATH could save you ... I'd disagree, openssl is pretty notorius of breaking backward compat. on library upgrades. So you are likely to end up with something that installs but doesn't work. And the deps. won't be half as good as any of the major distros, as you are basically doing download tarball type ./configure -- see what fails -- then, eventually, run and see what fails.

      But another great benefit is that you can change the stable version on the fly, on a live system, simply by pointing that stable link to the version you wish it to now point to (yes, sometimes between versions you gain or lose files, so this is not perfect).

      Understatement of the century. Be very affraid of any "package management" system that hand waves away problems like this (and god help you if you are doing anything like "obsoletes" markings ... which again all the major package management solutions have).

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    4. Re:Enhanced Package Management by LittleBigLui · · Score: 2, Funny
      I'm a Gentoo myself


      Don't worry, on the internet nobody knows you're a penguin.
      --
      Free as in mason.
  6. Re:insane by cowens · · Score: 5, Interesting


    I am a Perl user
    </disclaimer>

    It is an installer and package manager written in Ruby not an OS. The website doesn't seem to make this very clear though, so I don't blame you for being confused. It is really a Linux (or GNU/Linux if you prefer) distribution. If we were to follow this logic then Mandrake Linux would be a Perl OS and Fedora/Redhat would be a Python OS.

    When evaluated on that level it looks interesting. It seems to combine the concepts of LFS and Gentoo with stow like package managment.

  7. Um, isn't this just another Linux distro? by ivern76 · · Score: 4, Informative

    I'm not too sure how this isn't 'Rubyx, the Linux distribution with an installer/package manager written in Ruby'. If it had been written in any other language, would it still be cool?

    1. Re:Um, isn't this just another Linux distro? by popeyethesailor · · Score: 4, Funny

      Damn straight. They should have named it GNU/Glibc/XFree(C)TM/QT/KDE/Ruby-Lang/Rubyx .

    2. Re:Um, isn't this just another Linux distro? by FFFish · · Score: 2, Interesting

      If I recall correctly, several of the Linux and BSD distros use Python for their installers.

      So, no, I guess it wouldn't be any big deal. Certainly not Slashdot front-page stuff.

      News for nerds, stuff that matters? Not this time.

      --

      --
      Don't like it? Respond with words, not karma.
    3. Re:Um, isn't this just another Linux distro? by dagbrown · · Score: 3, Informative

      Actually, there are a couple of cool things about Rubyx that make it different from a run-o'-the-mill Linux distro, and the language they're in ain't one of 'em.

      The first is that it's self-bootstrapping--you can just download the Rubyx script and use that to build an install ISO. That's pretty darned cool if you ask me.

      The other cool thing about it is that it completely eschews the entire SysV init system with one of its own, based on dependencies instead of on educated guesses by the sysadmin (read: arbitrary order) as to what order services should start up and shut down in. This lets you speed up booting by starting independent services concurrently instead of waiting for each service to start up individually.

    4. Re:Um, isn't this just another Linux distro? by Colonel+Panic · · Score: 2, Interesting

      No, it's more than just another Linux distro. It's more of a way of creating Linux distros. But if you take it a step further, there's no reason why it couldn't also be used to build *BSD systems as well by specifying a *BSD kernel instead. If that can be done, then Rubyx is something much more than just another Linux distro. It would be a sort of a cafeteria-style system builder: I'll take this Darwin kernel and this GnuStep WM and this MPlayer and... There are lots of possibilities. Is Linux too vulnerable to attacks this week? Ask Rubyx to build you a system with an OpenBSD kernel instead.

  8. Re:insane by Anonymous Coward · · Score: 2, Interesting

    Are there any ruby zealots? Seriously, every Ruby programmer I know is remarkably calm and rational. Must be the Japanese influence, eh? Or maybe all the free time they have after writing programs in Ruby! :-)

  9. Re:So when is PerlOS coming out? by cowens · · Score: 3, Informative

    If Rubyx is an OS then it does: Mandrake. The installer is written in Perl and the package management is done with Perl. That is all Rubyx is.

    But if you want an example of extreme silliness in Perl you can look at http://freshmeat.net/projects/perlbox/ a Desktop Environment written in Perl.

  10. A little too much Fanboy vibe by Jerf · · Score: 4, Interesting

    I wasn't going to say this, but after reading a few of the comments here I've changed my mind.

    The name Ruby x conveys a little too much "Ruby fanboy" vibe. It's a Linux distribution, yet the name doesn't mention it and the website gives only cursory mention of this fact, which borders on the deceptive. I want to emphasize that I mean these things exactly as I say... a little too much fanboy vibe, borders on the deceptive. It's not irredeemably bad, but I do have to say at the moment I'm having a hard time respecting the project.

    In fact this could well hurt even the Ruby advocacy side of the project by scaring people off, thinking they'll need to know Ruby to install, when instead it looks like Yet Another Linux Distribution.

    I mean this as constructive criticism. To the project leaders, I strongly recommend that you more carefully evaluate the goals of the project, more clearly partition the "Ruby" concept from the "Linux Distribution" concept, and determine whether your goals justify the seemingly over-strong focus on Ruby. Yes, I know Ruby lovers have a bit of a persecution complex, I recognize this in myself as I like Python and see the same in the Python community, but in the long run you're going to get more real respect by building a real project on Ruby and discreetly pointing out that it runs on Ruby then by shouting out in the streets that THIS RUBY DISTRIBUTION OF RUBYX IS MADE POSSIBLE BY RUBY, THAT WONDERFUL (RUBY) LANGUAGE! (Yes, this time I'm exaggerating for dramatic effect; again I emphasize I'm not claiming the site actually sounds like this but the tone is definately there.)

    1. Re:A little too much Fanboy vibe by Colonel+Panic · · Score: 2, Interesting

      The name Ruby x conveys a little too much "Ruby fanboy" vibe.

      Perhaps. I suppose I'm a 'Ruby fanboy', but I did wince a bit when I saw the headline for this story which said something like "Rubyx - it shows the power of Ruby". I think there are lots of other things that show the power of Ruby better.

      However, that said, there are zillions of Linux distros out there and they did need a name and since the rather novel init system is written in Ruby (a feature I really like about Rubyx, btw) it sort of makes sense to call it Rubyx, doesn't it?

      It's a Linux distribution, yet the name doesn't mention it and the website gives only cursory mention of this fact, which borders on the deceptive.

      Instead of seeing it as deceptive, I see it as a way to keep their options open. How's that? Well, why couldn't the Rubyx script also be used to build a FreeBSD or Darwin system? It's just a different kernel after all, so why should you be limited to the Linux kernel? Now _that_ would be flexible. I hope they take it to that level, then it will be truely unique and not just another Linux distro.

  11. Re:hmm.. maybe a bit Off Topic.. but by Jerf · · Score: 3, Informative

    Consensus gestalt that I've gotten as a Python user and reading a lot of debates on this topic is that structurally, Ruby is a little more pure OO then Python, but the practical differences seem minimal, especially after the type/class unification in Python. (Ruby advocates are proud of their block syntax but I'm yet to see something I don't immediately know how to write in Python, too; the question is which fits your mind better.)

    Syntactically, Ruby is more like Perl. If you consider sigils an abomination upon the land, as I do (despite working professionally in Perl), then you'll want Python. If you consider them Larry Wall's gift to syntax, then you'll want Ruby.

    The other thing is, if you're expecting to use a library of some kind, check for availability. Python has the edge right now AFAIK but that doesn't matter unless Python has something that Ruby doesn't that you need, or vice versa; for most people my impression is that the necessary modules are there in both languages.

  12. Re:hmm.. maybe a bit Off Topic.. but by Anonymous Coward · · Score: 5, Informative

    I use Python mostly for "work", but I much prefer Ruby and try to use it whenever possible.

    If you are a theoretical guy who loves a conceptually elegant and consistent language like Smalltalk or Scheme, you'll love Ruby. Ruby is so consistent, it's really lovely.

    If you're more practical and need good documentation and extensive libraries, you'll probably be annoyed by it.

    If you like to write programs FAST but not sacrifice readability like Perl, you'll really love Ruby. For instance in Ruby, you don't have to type "self" in method argument lists the way you do in Python. Ruby is 100% object oriented inside and out. Classes are first class objects, subclasses of Module objects. There are no "old style classes" or "new style classes", no cruft held over from previous versions of the language.

    In Python, you have built-ins like "str()" which can call the __str__() method on an object. None of that kind of repetition in Ruby. Just call obj.str (or actually, obj.to_s) directly. You don't need the parens in that case.

    Ruby has "blocks" which are a nice syntactic sugar for a whole class of operations. For instance a database transaction can be implemented as a block:

    transaction { |t|
    do stuff with t
    more stuff
    }

    in Python that would be:

    t = start_transaction()
    try:
    do stuff with t
    more stuff
    finally:
    end_transaction()

    The ruby version is easier to read.

    If you want a large selection of tools and implementations, well, Ruby doesn't have too many like Python.

    Also the Ruby community is still small and friendly. The python community is turning into the Perl community, in my opinion. A little arrogant.

    Python is starting to look more and more like Ruby every revision though.

  13. Re:hmm.. maybe a bit Off Topic.. but by Anonymous Coward · · Score: 2, Informative

    Sigils? You mean punctuation at the front of variables? That's a little misleading, Ruby doesn't *require* them because you can program entirely with method calls:

    class Thing
    attr_accessor :foo, :bar
    def add_me_to_foo_and_bar(me)
    foo + bar + me
    end
    end

    t = Thing.new
    t.foo = 5
    t.bar = 34
    puts "look: #{t.add_me_to_foo_and_bar(4)}"

    And class variables, in my opinion should never be used. You should use instance variables on the class object, which uses similar syntax to the above and feels more consistent.

  14. Re:hmm.. maybe a bit Off Topic.. but by gavri · · Score: 3, Insightful

    If you consider sigils an abomination upon the land, as I do (despite working professionally in Perl), then you'll want Python. If you consider them Larry Wall's gift to syntax, then you'll want Ruby.

    In Ruby, Sigils indicate scope, not type! Whole different thing.

    It doesn't obfuscate the code. Makes it easier to read actually.

  15. Logo OS? Try a Lisp OS by tepples · · Score: 2, Funny

    Given that Seymour Papert designed Logo as Lisp minus parentheses plus turtle graphics, you might look to a Lisp OS for a proof that it could be done. Well, here's your prototype.

    1. Re:Logo OS? Try a Lisp OS by alex_tibbles · · Score: 2, Informative

      you might want to see Movitz a "Common Lisp OS development platform".

    2. Re:Logo OS? Try a Lisp OS by tamills · · Score: 5, Interesting

      It's been done. 20 years ago. My first serious workstation development was on a Symbolics Workstation whose OS was written in LISP. We had a windowing operating system with bit-mapped graphics, source-level debugging, suspend-substitute-and-continue code execution. Just all kinds of cool stuff. And coding in an OO LISP was the best experience. Ruby and Perl have both similar levels of joy in programming, but as LISP was my first, it will always hold a special place.

      Unfortunately it was too expensive. My workstation cost $125000. Alas...

      --

      Be careful what you wish for...

      Where your treasure is there is your heart also...

  16. Re:Who the hell cares? by pyman · · Score: 3, Funny
    99.99% of the code out there is garbage and would be better written in INTERCAL.

    Seriously, where do you get your statistics from? Your arse? Thought so.

    --
    a ^= b; b ^= a; a ^= b;
  17. Re:hmm.. maybe a bit Off Topic.. but by Colonel+Panic · · Score: 4, Interesting

    Can someone explain clearly why someone who works a lot with python, why one might find it worth while to invest into learning about Ruby?

    If Python is doing everything you need it to do and you're happy with it and you're not curious, then maybe there isn't any reason for you to learn Ruby.

    However, if you have at least a little bit of intellectual curiosity, you might find it rewarding to spend an hour learning some Ruby and trying it out. I emphasize the tryinging it out part: sure the two languages have very similar capabilities, however it feels much different programming in Ruby than it does in Python. It's difficult to explain, you have to try it. I tend to think it has something to do with the fact that Ruby's built-in libs made use of iterators from the start (and it also has something to do with Ruby's blocks).

    Also, if you prefer not having syntactically significant pieces of your code be invisible then you'll probably prefer Ruby. Yes, it's that indentation-as-syntax thing in Python that kept me from going with the snake a few years back before I found Ruby. Yes, I've heard all the arguments from the Pythonistas about how your editor will just take care of things for you and how life will be so wonderful. However, I was bit by this twice within the first hour that I tried Python. One person might have his editor set to expand tabs and another might not. I haven't got time to spend several minutes trying to figure out why some code (which looks perfectly fine) doesn't work only to find that it's a tab expansion problem, "gee, the code looks identical to the code in the book?! WTF?!" - Life's too short.

  18. Re:Who the hell cares? by Colonel+Panic · · Score: 4, Insightful

    Why devote so much energy into implementing a mediocre system using ruby, of all languages, when you could spend time improving an existing system?

    How do you know it's mediocre? Have you tried it?
    Do you even understand what it does?

    Total waste of time...99.99% of the code out there is written in C -based languages (java, php, C++) for a reason...

    You could be the one that's totally wasting your time. One should choose the right language for the job at hand.

    I recently inherited a project which took six months to develop in C++. It weighed in at ~4800 lines of C++ code. Since we needed to significantly expand the scope of the project and also add a GUI _and_ since execution speed wasn't an issue, but development time _was_ an issue I decided to rewrite the code in Ruby. It took a week and came to ~1200 lines of Ruby. The resulting Ruby code is much more flexible and easier to modify and add to than the previous C++ codebase (good riddance to it). I'll gain back that week invested to do the conversion several times over as the project progresses and as the requirements (inevitably) change... and I'll keep my sanity.

    Choose the right tool for the job. If speed of execution is an issue then by all means use C/C++ (I do). However, if you need to develop code quickly then use an agile (aka scripting) language - I prefer Ruby for that role.

  19. Re:hmm.. maybe a bit Off Topic.. but by Discordantus · · Score: 3, Informative
    It has some of them. But their use is mostly discouraged... the ugliness of the $s and @@s are supposed to keep people from using them :) Also, there are many excellent constructs built in to replace them. Take Perl's regex match variables, for instance. Here is an example of a Ruby way of using regex matching, where you can collect "MatchData" objects from a match:

    (note that '#' starts a comment, and => (value) in an end-of-line comment is showing the resulting value of an expression.)

    re = /(\d+):(\d+)/ # match a time hh:mm
    md = re.match("Time: 12:34am")
    md.type #=> MatchData
    md[0] # == $& => "12:34"
    md[1] # == $1 => "12"
    md[2] # == $2 => "34"
    md.pre_match # == $` => "Time: "
    md.post_match # == $' => "am"

    You can collect as many matches as you want before you process them. There are no freaky, hard to remember variable names that you need to remember. You can still do it the Perlish way if you want to, but a lot of that stuff has been slowly made less desirable to use. I wouldn't be surprised (or upset) if they disappeared altogether in the future.

    Then again, there may be the exact same thing in Python, and you're wondering why it's special. Since I went to Ruby straight from Perl, I wouldn't know.

    (The code was pulled directly from online docs, so I'm not pretending I wrote it :)

  20. The Slashdot experience - By the Rubyx author by awalrond · · Score: 5, Interesting

    How much can you convey in 1 paragraph? Maybe I did a bad job, but I did at least expect/prime (with "can you guess") the ruby/perl/python flamefest.

    But a few people were intelligent enough to pick out the salient points, or were bothered to read the website. And then downloaded 8Gb of Rubyx overnight. (Hang the cost; It made me smile!)

    For those of you who somehow missed those salient points:

    Rubyx is 'yet another linux distro', that builds from source (like gentoo). It is _not_ an OS written in ruby.

    But it's different because...

    Rubyx can be created, with a single command, using the rubyx script.
    With a second command, you can create a bootable Rubyx CD/DVD.
    The same script handles ALL subsequent package management.

    Reread that last bit. This is one small script we are talking about, written in the ruby language.

    I wrote the new init system inside 2 days. Go figure. A complete init replacement in two days.

    Yes, I'm a fan of ruby. Its the most writable, readable scripting language I have tried. Could Rubyx have been done in another language? Surely. But, I argue, not as quickly, elegantly and maintainably.

    Have a lovely day :)

    Andrew Walrond

    1. Re:The Slashdot experience - By the Rubyx author by awalrond · · Score: 3, Interesting

      The stable version does semi-parallel startups. (Probably enough for most needs - see the script for details)

      I am testing a simple variation of the init scipt which does it properly. I'm pretty happy with it and will probably release it in rubyx version 38.

  21. Japanese by GerritHoll · · Score: 2, Insightful
    Judging from the background image of the RubyX homepage, it's probably advantegeous to learn Japanese in order to get the full potential from it ;-)

    (Anyone caring to translate this character?

    1. Re:Japanese by ladislavb · · Score: 3, Informative

      The character ("li" in Chinese) means "power" or "strength" (in both physical and spiritual senses of the word).

  22. Cleese by GerritHoll · · Score: 4, Informative

    At first glance, I thought this would be similar to Cleese, a Python-based operating system, but it isn't: RubyX is a distro with some stuff written in Ruby, and Cleese is an actual effort to write a kernel in Python. Not that it's progressing a lot, though... the CVS tree can be found here.

  23. So ..... by CoolCat · · Score: 4, Funny

    When will it be self aware?

  24. Re:hmm.. maybe a bit Off Topic.. but by ichimunki · · Score: 2, Interesting

    I'm sure with a little effort a system without any sigils at all could be worked out for Ruby. Indeed, if you set up accessors for all your instance and class variables right off the bat, you needn't ever use the sigils at all outside the initialize method. The only thing the sigils buy you is not having to declare non-local variables to be class or instance variables. In this respect Ruby could stand to learn something from Perl, especially with regards to local(). That said, I much prefer Ruby to Perl in all other respects.

    So, is anyone still reading who is familiar enough with Rubyx to tell me if I can bootstrap this onto an existing system, or will this require me to reinstall from scratch? Am I getting this right that it can create a bootable CD image?

    --
    I do not have a signature
  25. Actually, as a computer science professor... by Anonymous Coward · · Score: 2, Insightful

    I rather dislike Ruby.

    Oh, it's got consistent semantics and a decent object model (a proto model would have been better) and every CS professor's favorite item: true closures. But Ruby has one nasty feature which trumps 'em all. It was designed by an ex-Perl guy, and as such Ruby has approximately five billion different ways of writing the same syntax. As long as it can't be "misinterpreted", you can delete or change all sorts of stuff.

    This is language design which borders on the grotesque. Great. So I can write any way I want. That means that every OTHER programmer can too, including everyone I'm collaborating with. So to understand their code, I have to know not only My Favorite Syntax but I have to know all *their* favorite syntaxes as well. Repeat after me: knowing the syntax of a language should demand as few neurons in your brain as possible. Ruby violates this on a grand scale.

  26. Re:hmm.. maybe a bit Off Topic.. but by Discordantus · · Score: 2, Informative
    You are correct, regexes are full-fledged objects in Ruby. In the Ruby interactive interpreter (">>" is me, "=>" is the interpreter):
    >> /foo|bar/.match("this foo that").to_s # the matched string
    => "foo"
    >> %r(/etc/hosts|/bin/sh).class # returns the object's class
    => Regexp
    >> a = /(foo)bar/m # stores it in a variable
    => /(foo)bar/m
    >> /test#{a}test/i # embed it using #{} (string interpolation)
    => /test(?m-ix:(foo)bar)test/i
    Usually the %r syntax is used to make the regex clearer, like when you don't want to have to escape a bunch of slashes. Similar to Perl, anything can be a delimiter, so you can pick what looks best in the situation.
    >> # an array of regexen!
    >> [ %r(foo/bar), %r:(foo/bar):, %r_(:foo/:bar)_ ]
    => [/foo\/bar/, /(foo\/bar)/, /(:foo\/:bar)/]
    After learning Perl, I went looking for a language with a clearer syntax. At first I looked at Python, and the only reason I didn't stick with it was that I like being able to use regex literals. So I guess it's a matter of taste.

    Ruby is the first programming language I've used where I can actually write an entire script and have it work the first time. Not always, but fairly often. I've heard similar things (about Python) from my Python friends. To me, that is the most important aspect of a language, since debugging bugs me :)

  27. Re:hmm.. maybe a bit Off Topic.. but by xteddy · · Score: 3, Informative

    The |x| is a block parameter list. Blocks are Ruby's way to emulate higher order functions.

    [ 1, 2, 3 ].each { |x| puts x }

    would print "1", "2" and "3" in three different lines.

    The block parameters are very clever, you can also put something else than only variables there. If you want to compute the sum of the products of some pairs, you could do it that way:

    a = [[1, 4], [2, 5], [3, 6]]
    sum = a.inject(0) { |s, (x, y)| s + x * y }

    The block would first be called with s = 0 and (x, y) = [1, 4], that would assign x to 1 and y to 4.

    The inject would compute
    s = 0 + 1 * 4
    s = 4 + 2 * 5
    s = 14 + 3 * 6 = 32
    by calling the block three times once for every pair in the list and adding the results in the s and returning the result s.

    The ||-syntax looks very similar to the Smalltalk syntax for local variables. Ruby is very strongly influenced by Smalltalk. The inject method name stems also from Smalltalk. You can use blocks to make sure something is done after a block of code has been executed instead of using destructors or finalizers. An example would be to close a file after reading it:

    File.open("/etc/passwd") do |f|
    puts f.read.count("\n") # => number of lines
    end # => file f is closed here

    do...end is equivalent to { } and usually used if the block is not an oneliner. Readability is actually very important in Ruby culture.

    Ruby has an exception handling that is very similar to Python's, but the keywords seem to be blatantly stolen from Eiffel's Design By Contract. The transaction example from above could also be coded that way in Ruby:

    t = start_transaction()
    begin
    do stuff with t
    more stuff
    rescue => e
    puts "Caught an exception: #{e}"
    ensure
    t.end_transaction
    end

    I don't think that Ruby has a problem wth "non-alphanumeric" characters - it uses them very wisely, actually. I remember that Python uses lots of __foo__ and """bar""" - that really makes me feel uncomfortable when I have to read Python code!