r/programming • • Feb 24 '13

Ruby 2.0.0

http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/
600 Upvotes

193 comments sorted by

View all comments

Show parent comments

6

u/pnwf Feb 24 '13

This is huge. For so long doing anything that requires concurrency in Ruby was a tradeoff between using threads and suffering through weird hard-to-reproduce threading bugs and taking the performance hit of the GIL/GVL, or fork()ing and taking the memory hit when all your child processes' GCs force them to each have their own copy of memory that should be shared since it is never modified.

1

u/Amadan Feb 24 '13

I'm not very good at low-level, so... Does this mean GIL is gone? Or at least soon-to-be-gone?

6

u/cartola Feb 24 '13

The GIL isn't gone and there isn't an end in sight. It has been "renamed" to GVL (Global VM Lock), but as Aaron Patterson said in one talk it's the same thing. VMs are hard and Matz prefers Ruby's VM to be simple and easy to understand to being extremely fast and optimized at the cost of maintenance.

Taking out a GIL isn't easy and the CPython guys apparently did it some ancient time ago and experienced performance degradation (or it wasn't as great as once thought). The best VM without one is the JVM, so JRuby is the best bet. It'll probably never leave MRI.

-5

u/KagakuNinja Feb 25 '13

In other words, Matz would prefer that Ruby remain a toy language, because writing a VM is hard.

4

u/AngelLeliel Feb 25 '13

I dont think "toy language" is a good term to refer languages not put the performance as the first priority.

0

u/KagakuNinja Feb 25 '13

Today, even cell phones have multi core processors in them. Moore's law continues on, meaning the number of cores will be doubling every 3 years. A global VM lock is simply no longer acceptable for serious programming, especially for server applications.

1

u/brodock Feb 28 '13

Thread is only one way of doing multi-processing. It´s more like vertical scalling vs horizontal scalling problem. Both can do the job with they're advantages/disadvantages.

1

u/mogrim Feb 25 '13

s/hard/expensive/g