The Next ruby 1.9 – Bruce Williams

Bruce (based in Austin) – Language Tourist

Blog: codefluency.com

work: fiveruns.com   (TuneUp, Manage, etc.)

Why Ruby 1.9?

(almost no one in the room had started using Ruby 1.9)

In a nutshell:

Many new syntax and language features…

Not strictly backwards compatible to 1.8..

Don’t get 1.9 just yet…. (www.ruby-lang.org/en/downloads/)

 

Standar library changes: rubygems, rake, json, ripper, probeprofiler, securerandom, HMAC digests… csv replaced by fasterCSV implementaiton

 

soap, sdle, base64 and some others were removed…

 

Migration Risk Factors

You need to have tests!  That is one of the quickest ways to find out what will break with the new version…

 

Risk: Text Processing – Anything relying on $KCODE, String#[], or String internals… Parsers especially at risk…different encodings for source files.. 

upack(‘c*’)

Risk: Block Var Scope

“clever is a synonym for stupid”

Risk:  Hash#select (now returns hashes)

Risk: Hash Enumerations

Risk: Gems

The biggest obstacle to Ruby 1.9’s adoption is the sheer number of mostly working but essentially unmaintained gems that virtually everybody in the Ruy community depends on

–Sam Ruby

New features

multilingualization (m17n)

Enumerable – has index… can call next.. etc…  take, group_by, drop, min_by, max_by, count,and others…

Hash changes… (track insertion order)

Object: – tap…

New Proc Literal

(proc and lambda interchangeably)

Threads – native threading model from a user model…

Fibers – “semi-coroutines.”  Think of them as lightweight user threads with manual sceheduling…  some projects that use it Revactor  & NeverBlock…

question and answers

Why is Tap called tap?

(matz will probably talk more about this in his talk)

Are there ways to change the order?

Reverse, sort, index?  – not sure if there is a way…

Leave a Reply

Your email address will not be published. Required fields are marked *