Friday, March 28, 2008

MountainWest RubyConf: Notes On Presentations

Downloadable here.

ev phx rubinius

no task is too small
(goes to clay shirky/cheap failure thing)
very low barriers to contribution
one-line doc patch => commit rights
no bottom in terms of task size
every contributor has worth
forgiveness > permission
debate is healthy
you are not your project
"I'm talking to you Mr. Ego!"
You're not always right, and it's important to be wrong in public
project not about you
core contributors
the community chooses them
no keys to the castle
foster experimentation
with a large group, you get this for free
(also relevant to shirky failure is cheap thing)

"hackers and painters"-esque: citing high levels of experimentation in painting

git makes forking a non-issue - therefore you can encourage MUCH more experimentation
with no cost to the overall project

every hacker needs to read "here comes everybody"
not Ev's thing, mine; to understand why the things he said are guaranteed to be true every time

ez merb

prefer simplicity over magic as much as possible
no need to have monuments to personal cleverness in your code

"you don't need a foundation that is crazy" - Ezra on Rails meta-magic

you're always going to be wrong about what the benchmark might be
benchmark and profile
know your runtime and how it acts
"Ruby is a complex animal"

define_method 3x slower than def

"this looks so elegant" vs. "this runs so elegant"

"No code is faster than no code." - Merb's motto

Why another Ruby Web framework?
"Because I wanted to. Why not?"
Started as a hack, fun experiment

"Rails is so pioneering, so many awesome ideas, things I love, things I loathe,
awesome platform, fully support it"
opinionated software - "differences of opinion"

"Developer time is expensive, servers are cheap - therefore who cares - Rails definitely
does scale, just not efficiently"

"Postmature optimization is the root of all hosting bills"

12mb of RAM
tiny fast web services
start with tiny core, add componentized bits as needed
similar to jQuery that way actually

Rack replaced Mongrel in Merb stack
Rack turns requests into Proc calls with env hashes
returns array with headers, content
Web app turns into Proc
dude wtf that's crazy cool
adapters for every other commonly-used hosting/deployment setup

"say you're Twitter and an API is doing 80% of your traffic" - holy shit, really?

ApiHandler allows you to short-circuit entire request cycle when it's an API call
wicked clean design
obviously based on Mongrel handlers
but works across any Web server you might happen to be using
you can pass in an array of Merb apps and have the first one that returns a non-404
be the one to render to the Web
Rack FTW
make app == define class with call method which returns array
WICKED clean design

Merb has a very powerful router

Rails routing plus "much more powerful features"
auto-deferring routes on regex match against request
(reminds me of Python Twisted but not sure if that's accurate)
easily look up subdomain from DB, for instance
either return hash of controllers, actions, params, or nil, to cascade down to next deferred routes
(auto-deferring routes officially called deferred routes)

loved respond_to idea, hated syntax
provides :json, :yaml, :xml # keyword version of respond_to, roughly
Merb.add_mime_type correlates keywords to methods on objects
so fresh so clean
(except you in most cases can assume :format will call :to_format)

working on canvas-style renderer (obviously Seaside-inspired)

Merb actions much more like Ruby methods than Rails actions
no auto-rendering
return value of method is what goes to client

Abstract controller type knows nothing about the Web

merb-core / merb-more
code generators!
parts - "components done right" - ?
not callable from Web, callable from other controllers and views
Seaside/Iowa/WebObjects steelo
mailer just another type of controller
Rails mailers: "what are they? why do they live in the models directory? who knows?"
Merb compiles your templates into methods on load and calls them
somebody read the Google paper

Merb is like Rails for programmers
(that was me not Ezra)

plugin architecture for ORMs
also other plugins of course
most ActiveRecord plugins work fine in Merb (ActionPack more iffy)

Merb on github
git fosters experimentation - again, it's all what Shirky said. I'll have to blog that.
svn branching nasty, not conducive to experimentation
60 to 70 forks on github right now
encourages experimentation much much more than svn does
forks can be easily maintained, easily kept consistent to main repo's new features
without losing individuality

Yehuda: "It's definitely our mission to make Merb as easy to set up as Rails."

Rails moving to git
core team won't be monolithic thing any more
promotes survival of the fittest
"it's an open source project to begin with, distributed version control is a
much better way of working with the community"

Performance question on Rack stuff
Merb architecture allows you to separate which actions go to which servers

Quite a few large clients using Merb, usually in conjunction with Web services
startup I worked with resisted this, I have to say in retrospect I think they
were (very probably) utterly wrong about that
(Ez didn't name names, I can't either)

profiling question
ruby-prof ftw
for Matz' Ruby

Rubinius has nice built-in profiler with no performance side effects
ruby-debug ftw
Merb has built-in profiling options (of course)
Bleak House ftw

Parameter passing for Merb actions?
method definition tells controller what elements in the params hash to find
controller automatically maps that to a variable
I wonder how the hell they did that - they must use magic too, like Rails, but more judiciously
ParseTree, Ruby2Ruby
fucking MIGHTY
sexp heh heh heh heh heh.

Dev mode, like Rails, skips DB access solution during dev
maybe they didn't read the Google paper; maybe they just discovered it independently
the feature is opt-in
they made Windows binaries for ParseTree and Ruby2Ruby so Windows devs could deal

Jim Weirich: "action args really cool, but seems like magic - where draw line?"
Ez: usefulness
that's why it's in -more rather than -core
"probably most magic part of Merb"

(me: I don't see why they call it magic. I really don't get why everybody calls this stuff magic.)

EY => mostly 99% Mongrel, but maybe 20 clients on Thin
Ebb hella fast (for short requests)
very young, wouldn't recommend in prod yet
neither Ebb nor Thin handles long requests well compared to Mongrel

"almost all apps I see in the wild have 2 to 10 second requests"
not sure context for that tho
specific to particular server implementation stuff

throughput of event-driven servers drops like crazy in long-running actions

Merb 0.9.2 recently went to RubyForge
1.0 "still a little ways out"
aiming for very polished and feature-complete @ 1.0
thereafter seeking to be community of modular features
platform, ecosystem, rather than perpetually ongoing project

this reminds me of when he was doing the Yakima Herald stuff. smart as hell.

continuations / deferrables
damn sure that's something to do with Python Twisted
I think they were called Deferreds
wish network wasn't so FAIL

Merb Manning book coming soon
hell yeah

"if anybody wants to write some documentation that would be great"
doc/api standards
public api different from private apis
private specs, public specs
public API: contract with users
private API: completely changeable as long as public contract remains intact


couldn't take notes during Yehuda Katz's presentation because finding a seat after my own
was basically impossible. standing room only. long story short: DataMapper awesome.


Jay Phillips identified stuff in my Rubinius code which could actually be done in Ruby
as well.


jon younger amazon w-s
rightscale SQS plugin
discrepancy between requested SQS instances and actual (?!)
kato - pool manager
based on Lifeguard (Java)
Kato Ruby port of Lifeguard
RightScale gems
Amazon charge full hour for any hour within which an EC2 instance runs; Kato config
therefore takes definitions for minimum runtime required to justify new instance
Amazon AWS imperfect

chunky bacon workflow

Amazon reliability / responsiveness imperfect, but still effective / useful

teh criterion: requires elasticity, dynamic scaling

farm scaling component to AWS, keep gateway box on 24/7 somewhere in colo

scalable CI on Amazon AWS
commits go into S3
filename plus metadata into SQS
CI process runs on EC2
really wiggy!
ec2/sqs emulation: merb apps with god
wonder how he did the UI, that was awesome
rightscale plugin monkey-patched to hit local DB(s)


Tom Mornini interested in tying Merb/DataMapper/jQuery back to Rails, to avoid fragmenting the
community, but I think it's a pretty kick-ass entirely-alternative stack. I think more
probably Rails will adopt some of this stack's fixes to achieve better performance but still
have its own specific goals which are different enough from Merb/DM/jQ approach that the
two can very peacefully coexist.


guessmethod - levenstein distance method-guessing - kicks ass
Clss.nw.clas.should == Class # => true
grake - method-guessing rake


active_scaffold -> Ajax scaffolding
one-click PDF translation, kick-ass
Ed (Borasky?) also maintains localization plugin, so localization built in


Josh Susser's migration concordance plugin
up on github
checksum migrations to see if they've changed
(I still say only ever use rake:auto:migrate, but that's a good idea)


Jeremy McAnally: domain-specific frameworks on top of Rack
I'm not sure if that actually is Jeremy, his hair looks different


language parser
resource abstraction

think I saw this demo-ed at FOSCON

except for package mgmt, no real evolution of sysadmin tools compared to dev tools

sophisticated automated systems as collections of components???
services restart on changes to files they've subscribed to

highly portable

lots of people using it, incl. Google, Wesabe, Geni

"manage services, not servers"

Puppet language, not valid Ruby
Luke - yes I did see this demo-ed @ FOSCON
tried in Perl, failed, it worked in Ruby


solution for uploading many images, not just one
PHP, .NET, Ruby
hidden flash movie file looks like OS
realtime upload indicator
Rails thinks it's getting one image at a time, looks as if doing bulk upload
JS for styling, everything standards
just stubs out a browser weakness, runs it in Flash
small hacking required to make JS work with Rails (in new SWFUpload)
Ajaxy stuff too, not totally sure what he's saying but it's obviously a useful technique


RubyAmp(ed?) TextMate bundle
Eclipse-y magic nav in TextMate
looks as if it might become highly recommended for TextMate dev
part of this just replicates stuff I already did in Utility Belt, though.
I need to work on my marketing. :-p


JRuby -> Swing
monkeybars! I've heard of this thing before
people were talking about it on ruby-talk I think
building a GUI in a GUI builder in NetBeans.
rake generate - that's a good idea. Rails (script/generate foo)s should probably all be (rake generate)s.
auto-gens jars


PJ Hyett


Joe O'B from EdgeCase

85% of software cost maintenance
quick dev attacks 15% of the problem
readability is why Merb matters (me not Joe)
Rails maintenance too polarized: either power-user or total n00b
maintenance and minor changes easier with DM than AR
modifying existing app with new stuff easier with more flexible app dev (Merb)
Eric Raymond "Art of Unix Programming"
Fowler's external/internal DSLs distinction
forgot to mention in my own pres, "Code Gen In Action" talks about DSLs using different name
"full-domain languages"

OK my brain is fried.