Slashdot Mirror


Ruby 2.3.0 Released (ruby-lang.org)

An anonymous reader writes: Ruby developers have announced the official release of Ruby 2.3.0. This release introduces a frozen string literal pragma, which is "a new magic comment and command line option to freeze all string literals in the source files." It also adds a safe navigation operator &. similar to what exists in C#, Groovy, and Swift. Ruby 2.3.0 also has many performance improvements. For more details, see the news file and the full changelog.

14 of 45 comments (clear)

  1. Mangled title bar by Anonymous Coward · · Score: 1

    Anybody else seeing a weird mangled title bar on this submission?

    1. Re:Mangled title bar by Anonymous Coward · · Score: 1

      Confirmed - there appears to be an unnecessary line break or line wrapping going on.

  2. Re:A frozen string literal pragma by istartedi · · Score: 3, Informative

    If some twit has code like "hello"[5]=0 and you wonder why all your code is going to hell, maybe this will prevent it.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  3. Re: Real rockstars use Erlang aka OTP by Billly+Gates · · Score: 2

    Outlaw Psycho Bitch is the shit man! You will have women watch you code at alternative coffee shops and groupies guaranteed!!

  4. Oh great! by Gravis+Zero · · Score: 1

    similar to what exists in C#, Groovy, and Swift

    So now it's more like the other languages that I don't like! ;)

    Ruby: consolidate your hate!

    --
    Anons need not reply. Questions end with a question mark.
    1. Re: Oh great! by Billly+Gates · · Score: 1

      Yeah why can't it be cool and hip like Erlang!

  5. 1st there was perl by Anonymous Coward · · Score: 1

    And it was awesome at the time. I still have a pile of one liners. But time matched on.
    Along came ruby. Chef, puppet, and cli but then came Rails to confuse most people into thinking ruby == rails. F*ck!
    Syntactically, ruby is the best language ever. It sucks to see it de-meaned.
    Its influence on c++/Python specially, where I spent years messing with template types, wishing for closures/Procs, is greatly appreciated. Now we have auto,decl,closures. So I take a deep bow to a Ruby.
    Wow, golang but wait c++ can do that shit now, so what's the point. So wait, now we have golang--> ru kidding me?! Somebody please...

    1. Re:1st there was perl by Shados · · Score: 1

      It's too bad Rails gave it such a bad wrap

      Rails is terrible, but the Rails -community- is what is making me keep my distance from Ruby. I've worked at countless companies, in pretty much all mainstream programming languages and got involved in a lot of communities, but none made me step back so much as the Rails community. Freagin viruses taking every best practices and flipping them upside down then looking at you like you're an idiot for challenging them.

      Then when that falls apart they spread to other communities and try to push their Rails bullshit in every other language so everything can be Rails-like.

      The Ruby language takes the brunt of it.

    2. Re:1st there was perl by Jane+Q.+Public · · Score: 2
      Ruby's syntax is actually considerably more consistent that Python's.

      You may be confused because Ruby has a plethora of alternate ways to do things. But they are not required and the underlying syntax is extremely consistent.

      The most inconsistent part of it was added to the language relatively recently. That is the "alternate" hash syntax. The standard syntax for a hash with symbols as keys is

      {:key1 => value1, :key2 => value2}

      and so on. But the alternate syntax is

      {key1: value1, key2: value2}

      much like JSON. I seldom use this alternate syntax precisely because while it can be simpler, it is inconsistent. Outside of the hash, you still have to use the standard notation :key1 and :key2for the symbols. So I prefer to put the colon at the beginning of all my symbols and maintain the original consistency.

    3. Re:1st there was perl by Jane+Q.+Public · · Score: 1

      I didn't say it was an "exception". I said it is an alternate way to do things. The old, 100% consistent way to do it is still part of the language.

    4. Re:1st there was perl by Jane+Q.+Public · · Score: 1

      I won't try to argue with that. However, I think it is a rare use-case, and one can get around it by merely using the do- block syntax.

  6. Re:A frozen string literal pragma by HiThere · · Score: 2

    Frozen strings are extremely useful when doing multi-threaded code. I take this as a sign that Ruby is getting ready for actual use of multi-core execution. (Ruby has an equivalent to Python's GIL which currently prevents multiple simultaneous execution in the same interpeter/virtual machine.)

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  7. Haters gonna hate by BlackPignouf · · Score: 1

    Haters gonna hate.
    I work with Ruby everyday, and it feels fun everyday.
    Thanks for the hard work!

  8. Re:A frozen string literal pragma by HiThere · · Score: 1

    I understand. Also, I believe, Rubinius. But that's not the Ruby we're talking about. We're talking about the one that just released a new version.

    Frozen strings are not required for multi-core execution, but they facilitate it.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.