Meeting links and thanks: 2011-11-01

14 views
Skip to first unread message

Igal Koshevoy

unread,
Nov 2, 2011, 4:48:50 PM11/2/11
to Portland Ruby Brigade
We had a great meeting.  

SURPRISES

LINKS

This is a bunch of links to events, technologies and such that were brought up during the meeting. I still hope Jesse Hallett can post more detailed notes about what we actually discussed.

-igal

Jesse Hallett

unread,
Nov 3, 2011, 2:58:24 AM11/3/11
to pdx...@googlegroups.com
Here are some more notes that I took:

WeWorkInToulouse.net is an example of how to internationalize /
localize a Rails app.

MagLev dropped version 1.0.0 on Halloween! Jesse Cooke makes his 1.0
version of delicious cake to celebrate.

Ok, I've got some cake now. It is pretty great.

MagLev's 1.0 release is a culmination of years of effort and brings a
great new implementation to the world of stable Rubies. The team has
spent a lot of time recently decoupling MagLev from Gemstone - so now
you can compile the whole thing from source.

This version of MagLev is compatible with Ruby 1.8.7. Compatibility
with 1.9.2 is on the agenda.

There is a pull request on rvm, so you should be able to use rvm to
install MagLev soon.

Almost all of the Padrino tests pass in the new version of MagLev.
Jesse explains that Padrino adds discrete features to Sinatra. If you
use all of the features that Padrino provides, you get a framework a
lot like Rails. Or you can use a few of the features available to get
a framework that is a little more sophisticated than bare Sinatra, and
that is much more light-weight than Rails. For reference, Igal says
that each instance of Calagator, which runs on Rails, takes up 150 MB
of RAM.

Markus' new puzzle, now in a new puzzle style, reminds us that when
working with dates and times you should also use a consistent and sane
representation - such as UTC datetime strings or the number of
milliseconds since epoch. A key advantage of those forms is that they
are not affected by DST changes. If you are using a local time zone
that observes DST, without explicitly including a time zone
identifier, there is one hour a year that will occur twice.

Another problem is that if you INSERT a row into a table in MySQL with
a primary key value that already exists in the same table, MySQL will
not complain. Instead it will treat the operation as an UPDATE and
will silently replace the existing row. Many database systems have
features that will protect you from this.

There is a neat tool called Emscripten that will compile LLVM output
to JavaScript. This means that there are a great many things that you
can run in a browser - including Ruby interpreters. Go to repl.it and
you can have a fully-functional Ruby 1.8.7 repl - running in your
browser. Ilya Grigorik showed this off at JSConf.eu.

Chrome provides a feature called NativeClient, which gives webapps an
FFI-like API that lets them run compiled code on the user's computer
in a sandbox.

Igal reminds us of Markus' language, Snooze, the Totally RESTful Language.

Jesse Cooke has been working on ruby.IO, a website to document
practices for implementing concurrent code in Ruby. Jesse wants
ruby.IO to be a one-stop place where Ruby community members can learn
how to work with threads and event loops and so forth. There are also
details on which concurrency features each Ruby implementation
supports. The project needs more content, so please contribute some
articles if you have time. You can check out the wishlist on the site
for ideas.

It turns out that it is possible to suspend a thread in MagLev, store
it in the shared persistence layer, and resume the thread from another
process. You can read an article anout this on blog.bithug.org.

github.com/mperham/girl_friday is background worker that uses threads
that you can use in your web apps.

MagLev uses optimistic concurrency control. So if two processes try
to commit transactions that modify the same object then one will get
an exception. MagLev also provides reduced-conflict data structures.
For example there is a special type of Hash that resolves many
conflicts automatically. There are other RC data structures too, like
an RC Queue. But it turns out that when you try to search for this
stuff you end up with a lot of articles about trains. Look for the
documentation on the GemStone SeaSide site, under "other
documentation". A lot of these structures are shared between GemStone
and MagLev. Search the docs for "reduced conflict". Or try the
blogs.

When simultaneous changes are made to an RC class, MagLev will try to
apply those operations in sequence. For example, adding values to the
same RC Set at the same time from multiple processes is a scenario
that the class can resolve automatically. In the MagLev world, "at
the same time" means that one process tries to commit a transaction at
a point where another process has committed a transaction since the
first process's last `abort_transaction` call.

Igal has a special shell prompt that shows him which Ruby
implementation he is using, via rvm, and which gemset. It is time to
be envious.

There have been a lot of problems with YAML in Ruby 1.9.2. And you
would be surprised at how many gems use YAML internally; for example,
HTTParty. Because of the 1.9.2 problems, many gem authors have been
switching their gems over to JSON.

Need to parse hcard or hcalendar data? Audrey shows us mofo, a ruby
microformat parser <http://mofo.rubyforge.org/>. What is annoying
about mofo though is that does some monkey-patching to classes like
DateTime for its internal use. Actually, it looks like the reason
that Audrey brought up mofo was to point out how awful is. You
probably don't want to use it.

Another microformat library is prism. Beware, the version of the gem
that is published on RubyGems.org, version 0.1.0, is completely
broken. There is a version on Github that works nicely.

RubyGems has also been guilty of monkey-patching. In the past it
mokey-patched RegEx; but that patch has been removed in recent
versions. Rails depends on that patch, as it turns out, if you are
using pathnames in your config file. Igal had to re-implement the old
RegEx patch himself just to make Rails work.

Tyler, one of tonight's first-time attendees, reminds us that Ruby 1.8
included the current working directory in its load path by default,
but that 1.9 does not. This can be another source of problems when
you are upgrading your app. Markus gleefully notes thay you can
monkey-patch `require` to correct this, if you really want to.

Reid says that none of the current releases of Cucumber works with
Rails 2.3.x. If you pull an old version you will find that it does
not specify version numbers for its dependencies. Unfortunately the
latest versions of these gems are not compatible with the old versions
of Cucumber. You will find yourself in depency hell where you are
forced to walk the dependency tree a figure out exactly which version
you need for every single gem. Bryan Stearns points out that a common
reason for installing Cucumber is to bulk up your tests in preparation
for upgrading from Rails 2.3.x to 3.x. :-(

> --
> You received this message because you are subscribed to the Google Groups
> "pdxruby" group.
> To post to this group, send email to pdx...@googlegroups.com.
> To unsubscribe from this group, send email to
> pdxruby+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pdxruby?hl=en.
>

Reply all
Reply to author
Forward
0 new messages