I am not sure the author's solution, removing the said libs, is the right direction. I agree that the stdlib is crufty and slow, but they do 'work', and people certainly use them. I think the better option might be to deprecate and replace.
To me the Stdlib API looks unfixable. So imho there's only one way: * put the existing stdlib into a legacy gem * create a new stdlib with a new, good, (incompatible) API from scratch * deal with the incompatibilities that will happen
The Ruby Stdlib is a Ghetto
21–30 of 49 posts
Re: The Ruby Stdlib is a Ghetto
#22 [0] http://thelincolnshirepoacher.com/pages/standard-librariesRe: The Ruby Stdlib is a Ghetto
#23I got the updated version of the Pickaxe recently and skimmed through all of the 1.9 updates. I was appalled to see REXML is still the blessed XML parser. I liked it when I started using Ruby and I still see it in the wild, but to me that's usually the sign of old code or a developer not tuned in to the latest developments. On the other hand, there has been some progress. It's good to see MiniTest replace Test::Unit…
REXML is kept because many projects that need a pure ruby XML parser rely on it and it works for them. Usually, if you use XML beyond something small, you should use Nokogiri. Actually, 1.9.2 ships with replacements where possible: for example, CSV is now FasterCSV with a compatibility interface, Psych can be used instead of Syck for YAML parsing.
I guess it's a mixed blessing if your library becomes part of stlib. On the one hand, it's gotta feel great to have so many people using your code. But on the other, your release cycle is pegged to Ruby's.
Re: The Ruby Stdlib is a Ghetto
#24IMHO, with a lib sharing system such as rubygems, having a standard set of "external" libs in kind of unnecessary.
Re: The Ruby Stdlib is a Ghetto
#25I am not sure the author's solution, removing the said libs, is the right direction. I agree that the stdlib is crufty and slow, but they do 'work', and people certainly use them. I think the better option might be to deprecate and replace.
I agree, deprecate and replace is the way to go. That's what I'm doing with Psych and with Fiddle. I really like this option because I don't want to break people's code.
There is a downside though. I've tried shoehorning the REXML api on top of Nokogiri. The problem is that doing that work is thankless and not very fun. The API for REXML is just too large, and the deviations between the way it works and how libxml2 works are too many.
I think if we add new libraries, and encourage people to move to the new ones, then start removing the old ones, that would be best.
Re: The Ruby Stdlib is a Ghetto
#26It seems to me the massive "investments" made in mainly web-related frameworks (Rails, Merb, Sinatra + ORMs) didn't help the foundation of the Ruby ecosystem: Take rubygems, take RAA, take the MRI development process. If you got "brainwashed" in the last 5 years about code quality (DRY etc.) + test methods (TDD/BDD) and then look at today's Stdlib, you'll scream and want to put bleach into your eyes… To me it seems t…
RAA has been obsolete since RubyForge (which was subsequently succeeded by Gems and Github), I am not sure why you would even bring it up.
The MRI development process is very conservative, yes, but that is offset by the very dynamic development processes of Rubinius and JRuby (even if in part driven by the conservativeness). There are few things in the language itself that need change, and those are to be resolved for 2.0. The main development cost is in actually setting forth the changes, not in implementing them.
The Stdlib sucks, sure, even if some of the libraries are better-maintained than others. Better alternates can be installed via Gems in almost all cases. There is an ongoing proposal to gemify the rest of the Stdlib (some parts are needed just to support Gems itself) mainly to reduce the distribution size and there are some arguments back and forth. By and large, however, it is pretty irrelevant to day-to-day life with Ruby.
In the meanwhile, if you are serious about the problem: spend your own resources to adopt one of the stdlibs and update it as necessary. This is open source, and that is how problems get solved.
Edit: removed tautology in 4th paragraph.
Re: The Ruby Stdlib is a Ghetto
#27Hate to sound preachy, but compare to Python developers, who very carefully maintain and update their stdlib. I feel like it is risky to commit to using Ruby for the long-term.
If you like Python, I don't know why you'd even think about "committing to Ruby for the long term"; you're a Python dev. They're practically the same language. Stop trying to pick fights.
Re: The Ruby Stdlib is a Ghetto
#28Re: The Ruby Stdlib is a Ghetto
#29I got the updated version of the Pickaxe recently and skimmed through all of the 1.9 updates. I was appalled to see REXML is still the blessed XML parser. I liked it when I started using Ruby and I still see it in the wild, but to me that's usually the sign of old code or a developer not tuned in to the latest developments. On the other hand, there has been some progress. It's good to see MiniTest replace Test::Unit…
REXML is kept because many projects that need a pure ruby XML parser rely on it and it works for them. Usually, if you use XML beyond something small, you should use Nokogiri. Actually, 1.9.2 ships with replacements where possible: for example, CSV is now FasterCSV with a compatibility interface, Psych can be used instead of Syck for YAML parsing.
Re: The Ruby Stdlib is a Ghetto
#30Hate to sound preachy, but compare to Python developers, who very carefully maintain and update their stdlib. I feel like it is risky to commit to using Ruby for the long-term.
Is that a joke? How many different interfaces are there to popen(3)? How many different ways to get the current time? If Ruby's standard library is a ghetto, Python's is a jungle. If you like Python, I don't know why you'd even think about "committing to Ruby for the long term"; you're a Python dev. They're practically the same language. Stop trying to pick fights.