Live data from Hacker News

Ruby 2.2.0 Released

ruby-lang.org

51–60 of 82 posts

Re: Ruby 2.2.0 Released

#51
post #19

Earlier quoted context omitted.

Sounds about right. Coming from a Python background to Ruby, I think there's more to it though. For example, Ruby version managers such as rvm and rbenv help a lot with keeping the community moving forward. Python has virtualenv but it always felt awkward to me compared to what Ruby has.

Interesting, I haven't worked in python, but I was always jealous of python having a single 'official' solution in virtualenv, instead of ruby, where it's confusing for newcomers to figure out which one they should be using (rvm? rbenv? chruby?), and each solution has it's annoyances and problems. I always thought it would be better if the community unified it's efforts behind one solution and made sure it was bug-fr…

Since you haven't used it you don't know how awkward it is compared to the Ruby iterations. Let's just say virtualenv and the packaging ecosystem is what drew me away from Python.

Re: Ruby 2.2.0 Released

#52

Earlier quoted context omitted.

> Actually, the "ruby 1.9" solution is having Strings tagged with encoding at all -- prior to ruby 1.9 they were not, they were just bytes. Whoops, you're right... I confused the version, what I had in mind is the "source code as UTF-8 by default", which wasn't introduced in Ruby1.9, but in Ruby2.0 > If ruby ever decides to make things even more strict, I don't think it'll actually be as disruptive as the 1.8 to 1.9…

> I'm under the impression that before ruby1.9, Ruby was simply encoding-oblivious, and for any encoding-sensitive piece of code, people simply relied on things like libuconv. True. > but by reading this blog post, I'm under the impression that most of the breakage that you'd get with the move to Ruby1.9 wouldn't be in exceptions, but in strings corruption. Eh... I don't know. In my experience, the encoding-related p…

> There's actually way more we can say about this, but this is a huge book already, haha.

Yeah, so long for "I'll try to keep this short" :P

> One difference in encoding between python and ruby I think is, in ruby 1.9+, if a string is tagged with an encoding but contains bytes invalid for that encoding (that do not represent a legal sequence of chars), you'll get an exception if you try to concat it to anything else -- even a string of the same encoding. I don't _think_ that happens in python?

True, also strings in python are immutable, so unless there's some weird way to access the underlying char* with the CPython C Api, I don't think that you can have an invalid sequence of bytes inside an unicode string

(obviously you can have codepoint U+FFFD, if you set errors='replace' when decoding)

> Ruby also doesn't have a canonical internal encoding, strings can be in _any_ encoding it recognizes, tagged with that encoding and containing internal bytes in memory that are actually the bytes for that encoding (any one ruby knows about). I am not aware of any other language that made that choice -- I think it came about because of experience in the Japanese context, although at this point, I think anyone would be insane not to keep all of your in-memory strings in UTF-8 and transcode them on I/O, and kind of wish the language actually encouraged/required that. But, hey, I program in a U.S. context.

Yeah, some time ago I looked into the differences of Python/Ruby encoding, and I wrote down these notes that I just uploaded:

https://gist.github.com/berdario/9b6bd24cafe3817e4773

There are indeed some characters/ideograms that cannot be converted to unicode codepoints, but even if we try to obtain them, we westerners are none the wiser, since we cannot print them to our terminals in a utf-8 locale

About the edit you just added:

> I definitely like it better than Java, which did decide all strings had to have a canonical internal encoding (if only it wasn't the pre-unicode-consolidation "UCS-2"!! perhaps that experience, of choosing the in-retrospect wrong canonical internal encoding influended ruby's choice)

Yes, but I think that this issue is made more complex by Java's efforts to keep bytecode compatibility.

In a language like Python/Ruby, the bytecode is only an internal implementation detail, upon which you shouldn't rely (you should rely only on the semantics of the source code). If you keep the actual encoding of your unicode strings an internal implementation detail, this issue could've been avoided (without switching to linear time algorithms for strings handling):

Just migrate to UTF-32 (or to a dynamic fixed width encoding like in Python3.3) as the in-memory representation, when parsing strings from the source code, and everything would've continued to work.

I think that it had more to do with the Han unification, rather than with the fear of picking the "wrong encoding"

Re: Ruby 2.2.0 Released

#53
Guys, I made a very simple pull request regarding auto proxy detection on the standard library of ruby, but it still open after a little while. Someone here have some directions on how to contribute correctly to the project?

Re: Ruby 2.2.0 Released

#54
post #19

Earlier quoted context omitted.

Sounds about right. Coming from a Python background to Ruby, I think there's more to it though. For example, Ruby version managers such as rvm and rbenv help a lot with keeping the community moving forward. Python has virtualenv but it always felt awkward to me compared to what Ruby has.

You have a plethora of similar tools in the python world as well: - Pythonz - Conda - Pew (disclaimer: I'm the author) - Virtualenvwrapper - Pyenv Etc. If you argue that people might not move to the latest and greatest as soon as possible due to the fact that people don't build their own interpreter, I can definitely agree with it: python users seem to truly prefer the python version that already comes pre-installed…

pythonz looks great, thanks

Re: Ruby 2.2.0 Released

#55
post #18
post #15

Earlier quoted context omitted.

I'm not sure, most of my Ruby jobs are puppet and chef nowadays.

I promise that puppet and chef are not how the majority of people first hear of Ruby.

That's changing. I work at a Fortune 500 company that's strictly a Java shop and will probably never use Rails. Hardly anyone there has even heard of it. But we are using Chef to configure Red Hat VMs and deploy app builds.

Re: Ruby 2.2.0 Released

#56
post #34

Earlier quoted context omitted.

That's what happens when you maintain two versions, one of which has fundamental breaking changes. When the Ruby team makes changes the attitude is generally 'deal with it'. Sure they still do point releases on older versions but only for security issues AFAIK. Python moves forward it just does a poor job of dragging everyone with it.

When the Ruby team makes changes the attitude is generally 'deal with it' However they complement this attitude by being a lot better at working with big 3rd party library developers and making sure they are on board. To the best of knowledge there has never been a Ruby release that was incompatible with RoR for any period of time. Compare to Python that jumped to python 3 without either numpy or Django on board.

Well, on the other hand I definitely remember a point release of 1.8.7 that broke Rails :)

Re: Ruby 2.2.0 Released

#57
post #41

To the people who maintain the tools and platforms around these large version updates - thank you. rvm, ruby-build, homebrew, heroku - you're all truly generous for having everything ready for us almost immediately (on Christmas morning no less). You're all wonderful- merry Christmas! <3

Well, I wouldn't say that Heroku does that out of generosity, but their free tier is pure gold.

They certainly didn't have to get the support for 2.2.0 out on Christmas morning, but they (actually, Terence) did.

https://twitter.com/hone02/status/548131759762968576

Although with Matz an employee I'm sure they were well ahead of the curve. ;)

Re: Ruby 2.2.0 Released

#58

Earlier quoted context omitted.

(I'll try to keep this short, since I feel this is quite offtopic, if we want to discuss this further I suppose we could find a better venue... maybe even email?) I assume that with "Ruby 1.9 solution", you refer to the fact that Ruby source code is by default evaluated as UTF-8, right? That's definitely a good thing, but with Python3 that wasn't the only change brought into the language. I said "if Ruby ever decides…

Actually, the "ruby 1.9" solution is having Strings tagged with encoding at all -- prior to ruby 1.9 they were not, they were just bytes. This was a pretty major change, I think I'd call it a 'destructive' change, it was indeed a big pain upgrading apps from ruby 1.8 to 1.9, and character encoding was the major issue generally. I'm not sure I understand what you're saying about python 2 vs 3, or what you think needs…

Excuse my density here, but why not just force all strings to be UTF8 and call it a day? Anything in another encoding would need to get converted. What am I missing that Ruby and Python need these complicated problems but other platforms don't have these issues?

Re: Ruby 2.2.0 Released

#59
post #53

Guys, I made a very simple pull request regarding auto proxy detection on the standard library of ruby, but it still open after a little while. Someone here have some directions on how to contribute correctly to the project?

I contributed a small patch earlier this month, but used their bug tracker to submit patch, turn around time was ~24 hours I think. See bugs.ruby-lang.org/issues/10551

So I think all of their patches need to go through the bug tracker.

Post reply on HN