I wrote something similar a while ago[0]. Ruby should be the language and everything you "require" should be a Gem. It won't happen with Ruby (and isn't worth the effort). New languages, however, take heed. [0] http://thelincolnshirepoacher.com/pages/standard-libraries
Instead of forcing users to "install file" and "install path," which is bound to cause frustration, you could probably just have an "install stdlib" meta-package. Or at least an "install list stdlib" command that showed people all of the packages to install if they wanted stdlib functionality, which would be completely clear and allow for cherry-picking packages. Or install all packages in stdlib by default and let p…
The Ruby Stdlib is a Ghetto
41–49 of 49 posts
Re: The Ruby Stdlib is a Ghetto
#42I 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
Re: The Ruby Stdlib is a Ghetto
#43Ghetto? How about just "old and crufty"?
It's not 'ghetto' in the slangy adjectival use (e.g., "That coat is so ghetto."), but 'ghetto' in the normal noun use: "The Ruby Stdlib is a Ghetto" (my emphasis). And if you still think that's hyperbole, it's an allusion to Zed Shaw's infamous "Rails Is A Ghetto" post.
Re: The Ruby Stdlib is a Ghetto
#44Earlier quoted context omitted.
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.
Likewise for high performance http libraries.
I'm still searching for a good Net::HTTP replacement that runs on both MRI and JRuby.
Re: The Ruby Stdlib is a Ghetto
#45Earlier quoted context omitted.
The Ruby language specification ( http://www.rubyspec.org/ ), to which all Ruby VMs are written, helps as far as the "number of Ruby interpreters around and their impact" goes. (Assuming I understood your concern correctly.) A new Ruby VM is considered legit if it passes Ruby Spec. That should help in both transparency and compatibility across implementations. Would you agree?
Following your link: "This website is presently being redesigned. We expect to be back soon." But I knew already that "rubyspec" wasn't a spec in the ordinary sense but a test-suit built with MSpec. The thing is that real spec actually fully specifies a language - at least up to syntax. There are real specs for Python and Java for instance. The only real spec for Ruby is still crufty Yacc code for MRI. A test suit do…
Re: The Ruby Stdlib is a Ghetto
#46Earlier quoted context omitted.
Copy: Much of Ruby’s standard library (the set of classes shipped with the Ruby VM itself) is old and crufty. For laughs, go look at the code for some of the classes that you’ve never used. Chances are it’s from 2000-2003 and doesn’t even look like idiomatic Ruby. I’m wondering what classes should be removed from the standard library or deprecated so that higher quality replacements can take their place. The canonica…
Drb is a bit unusual and rarely used, but I wonder what his objection is to the API?
Re: The Ruby Stdlib is a Ghetto
#47Earlier quoted context omitted.
Following your link: "This website is presently being redesigned. We expect to be back soon." But I knew already that "rubyspec" wasn't a spec in the ordinary sense but a test-suit built with MSpec. The thing is that real spec actually fully specifies a language - at least up to syntax. There are real specs for Python and Java for instance. The only real spec for Ruby is still crufty Yacc code for MRI. A test suit do…
Java has a real spec. Python has documentation, but it isn't really sufficient for a spec, and for the most part alternative implementations copy down to the last implementation detail (gc details notwithstanding). A test suite is probably better than what it has.
Maybe Python has lousy spec but as I recall, the documentation does include a BNF breakdown of what Python is.
A test suite can be good for a lot of things BUT it cannot be a specification, it cannot be even sort-of a specification. Test suites only "prove a negative", only prove that an application won't do X. A specification is at least a rough assertion of a positive, that a language does follow this pattern.
Re: The Ruby Stdlib is a Ghetto
#48Earlier quoted context omitted.
Java has a real spec. Python has documentation, but it isn't really sufficient for a spec, and for the most part alternative implementations copy down to the last implementation detail (gc details notwithstanding). A test suite is probably better than what it has.
It depends what you mean by "better". Maybe Python has lousy spec but as I recall, the documentation does include a BNF breakdown of what Python is. A test suite can be good for a lot of things BUT it cannot be a specification, it cannot be even sort-of a specification. Test suites only "prove a negative", only prove that an application won't do X. A specification is at least a rough assertion of a positive, that a l…
Java specifies the semantics of Java and the JVM remarkably fully. Python, not so much.