Ruby 2.0.0 Released
An anonymous reader writes "Today version 2.0.0 of Ruby has been released. This is a stable release, and the Ruby team has done their best to make it compatible with 1.9, making it easier to migrate than it was to switch from 1.8 to 1.9. New core language features include: 'Keyword arguments, which give flexibility to API design; Module#prepend, which is a new way to extend a class; A literal %i, which creates an array of symbols easily; __dir__, which returns the dirname of the file currently being executed; and UTF-8 default encoding, which make many magic comments omissible.' There are also new built-in libraries for lazy stream and for an asynchronous exception handling API. The release includes a number of performance improvements and debug support for DTrace."
But when will it be available in my apt-get?
I started playing around with ruby about a month ago and so far im very impressed with how simple it is .
( somewhat off topic but anyone got any code for a beginner to take a look at ? I've been trying to go thrugh the source but it's proving a bit much for me)
I think its funny that you poo-poo Ruby, but mention the next hipster language in line -- Python.. Welcome to the echo-chamber :)
In the meantime, the rest of the world is using "big boy languages" that people give a damn about like JAVA and C# and Python.
Those "big boy language" cower before the awesome power of TREE-META.
Glad you didn't list PHP
How come I get no rails ?? I want RAILS !! I need to stay on the track !! I do !!
Should have been released on Tuesday. Ruby Twosday. :D
Yes, the uber secure Java, LOL
Could someone offer a comparison of ruby to perl in terms of replacing perl as a command line quickie or short admin or text processing. I use python for writing serious programs. But for getting quick things done like say shredding some text copied off a telephone directory web page to pull out a list of telphone numbers and peoples names, or parsing the text output of some unix right on the command line, perl is the right tool, python is not. If you don't know that that is true then you are not an experienced perl person.
But I've looked at ruby syntax a bit and it looks like it might have the advantage perl has for quick ad hoc text parsing but an overall cleaner syntax.
What I don't care a lot about is fancy pants modules like rails. If I want to do something serious there's python.
two things I like about perl: perl is lightning fast to start from the command line so glue scripts between applications like blast and something else dont' slow things down, and the O'reily nut shell book is the thinest book (even thinner than C++) yet it's a very poerful language. (yes I have looked a Lua)
please respond with a review of ruby for a perl enthusiast.
Some drink at the fountain of knowledge. Others just gargle.
Yes, every Linux distro is hipster.
Ruby can be used for both serious projects as well as providing quick prototyping.
Ruby is probably _the_ best language to refactor code, but with some minimal care, projects will actually rarely need much heavy-lifting because of Ruby's design-choices, powerful flexibility and lack of syntactic bloat.
So if you're into Agile, Ruby will grow on you, indefinitely.
You don't have to use Rails at all. Ruby is ALL INDEPENDENT LIBRARIES, even more so than Perl.
You SHOULD take a look at *ActiveRecord* though. It rocks if you need to roll your own SQL database that much more efficiently, *all* in-code and commandline deployment.
Ruby _can_ be used for simple "one-liners", maybe not to the same extent as Perl, but why would you when you could make a short beautiful script. Like, instead of abusing some mythological undocumented features that might change at any time?
Ruby lacks the UGLINESS of Perl though, so if you require UGLINESS, for Pete's sake: stick with Perl!
And of course, you won't get raw speed with Ruby, but we got C / C++ to provide that when required, probably in similar fashion as Perl. So with good planning, Ruby can actually scale pretty well in big demanding projects.
If Ruby's efficient and beautiful syntax peaked your interest, why not just try it yourself on the next task you desire fulfilled? The language lends itself to be learnt very quickly, and for experienced programmers, those that know what they're doing, Ruby provides an extremely short time to productive results.
I recently tried the other way: A friend recommended Perl (I've been familiar with Perl for over 15 years, however never built something from scratch in it). I made a simple graphical project using Perl docs and googling. The whole ordeal reminded me in so many ways why I prefer Ruby over Perl, or any other language. I was successful in using Perl. It just wasn't a pleasant and enjoyful experience compared to what I'm used to using Ruby.
Since Ruby does not even have a browser plugin, your comment shows that you are just as uninformed as the poster you replied to. The fact of the matter is that security in the browser is hard and all of the solutions that try to run untrusted code in a sandbox have had security problems at one time or another. Java on the server or running standard applications is at least as secure as other languages running at the same privileges. In addition, in the server environment because it inherently protects against buffer overflows it is safer than c, c++ and all of the languages that require substantial c/c++ libraries to gain performance due to slow performance of the their interpreters/JITs.
No, but most of them are.
Can slashdot readers get more childish? Just because it is not their favorite language, they all get butthurt.
Refinements, which allows meta programming to be scoped to a particular namespace. This addresses a lot of concerns about meta programming code having too much global impact if done as a "monkey patch" or module include/prepend (which is just a glorified name for a monkey patch that can subclasses from, and can invooverride arched class'smethods instead of rewriting the method on the patched class).
However, it's released as "experimental" probably because they still haven't figured out how implement this in a performant way (currently it can be slow even by dynamic language standards). Which I think is a big issue - a few months later they may realize there is no way to make it efficient and remove it, by which time many libraries would already use it. I don't think major language constructs should be released as experimental on non-beta releases - either get them stable or don't release them.
In the meantime, the rest of the world is using "big boy languages" that people give a damn about like JAVA and C# and Python.
The same rest of the world isn't throwing away their time making a bunch of posts about how hipster and Apple centric random other languages are either.
Happy birthday to Ruby! Pretty cool the way that numeric coincidence worked out.
2.0 looks like a nice step forwards. I'm not sure where I stand on Refinements yet. I hate the method overriding of base classes that goes on in Ruby land, and Refinements is supposed to minimize the bad affects of that by offering scoped alterations, but from what I've heard there's a lot of side effects. Frankly, I think Ruby needs a 'protected' type; any other solution is just monkeys all the way down. But I could say this about a lot of the popular languages right now.
C'mon folks, it's not about Ruby vs Perl, Python or whatever. It's about what a language allows you to express in an easy or elegant way for the job at hand, within a reasonable timeframe. As a heavy Python and Ruby user, I can say they are definitely very different languages. I like being explicit in Python, and know others won't have to think too much reading my code. But when I write in Ruby I feel like I'm using a beautiful instrument that allows me to express myself in a very pleasing way. Undoubtedly more implicit behaviour, but more concisely. It also has a very elegant object model, unlike Python.
I believe it is this feeling most Ruby programmers are talking about when they describe how much "fun" the language is to use.
It is in the lineage of Lisp and Smalltalk as much as Perl or C.
Since Ruby does not even have a browser plugin, your comment shows that you are just as uninformed as the poster you replied to.
Ruby can be run in the Native Client quite easily, the necessary patches are in the mainline tree.
In addition, in the server environment because it inherently protects against buffer overflows it is safer than c, c++ and all of the languages that require substantial c/c++ libraries to gain performance due to slow performance of the their interpreters/JITs.
Sun Java requires a substantial C++ runtime for precisely the same reason. About the only implementation that comes to my mind that doesn't need it is Jikes RVM.
Skillset momentum aside, why would anyone choose Ruby over Node.JS?
Node is *significantly* faster right out of the box (while Ruby JIT is still in its infancy). With so many well-funded implementations (Google, Mozilla, Opera, Microsoft) competing to be a tiny bit faster in any way possible, JavaScript is very likely to remain the fastest dynamically-typed language. Node is also built with a specific emphasis on scalability / parallel performance.
Node.JS also has the advantage of using the same language on the server that you inevitably have to use on the client end of Web-based applications. This avoids the overlap where you end up writing the same thing in different languages, adding complexity to the project. JavaScript / EcmaScript is also the preferred language of browser extensions, many desktop / mobile widget kits, GNOME apps, QtScript, etc. By focusing on one language instead of several (in a finite amount of time), you'd gain more expertise with that one language and be able to accomplish more things with it.
Of course JS syntax leaves much to be desired, but that will be revised some time in the future. CoffeeScript's syntax is even more intuitive and compact that Ruby's!
--libman
Please Python was a hipster language 17 years ago. Today stuff like Scala, Clojure are the hipster languages. Even Haskell is getting post hipster.