Permalink
Browse files

Manually merge notes together.

  • Loading branch information...
1 parent 319fe45 commit de5ca138f275d354295cb53fc69dc35442a818fa @benjaminoakes benjaminoakes committed Sep 20, 2012
@@ -1,79 +0,0 @@
-# Writing a Rails Engine
-## Erik Michael-Ober [@sferik](https://twitter.com/sferik)
-
-### Introduction
-All a rails app is a bootable rails engine
-Engines do not know how to start themselves, but are everything else, MVC
-Engines can plugin to engines
-
-Rails engines are fundamental building block of rails
-
-### History
-James Adam is creator of rails engines
-1st commit to engines plugin was 10/31/2005
-Rails 0.14.2
-Really old concept/feature
-
-DHH was against engines!
-
-James Adam thought it would be "Madness" to have engines in rails
-
-Merb slices introduced on 05/21/2008
-Slice out bits of functionality and use across multiple applications
-
-Rails and Merb merge on 12/23/2008
-Concepts of merb, including engines, were built into rails core
-
-The Russian Doll Pattern by Carl Lerche and Yehuda Katz
-Apps within apps
-
-Ruby Summer of Code 2010
-Piotr Sarnacki used Russian Doll Pattern and implemented it in rails
-Mentored by Carl, Yehuda and Jose Valim
-
-Bogdan Gaza rebuilt MerbAdmin
-
-Rails 3.0 uses engines!
-Pain point was assets which had to be copied via rake task or generator
-
-Rails 3.1 Asset Pipeline, FTW
-Puts every engine in load path for assets
-Looks in all engines to load assets
-Engines became first class citizens!
-
-Rails 3.2 deprecates vendor/plugins
-The way forward is engines
-Rails 4, engines are the only way
-
-### Write a Rails engine
-
-Easy, same as writing a rails app
-`$ rails plugin new my_engine --mountable`
-very similar file system
-
- * Engines are namespaced by modules
- * Engines inherit from Rails::Engine which adds engine to load path
- * Engine is not added to Gemfile, specify via gemspec
- * Can have custom rake tasks in lib/tasks and scoped to engine name
- * Can define generators lib/generators and scoped by engine name
- * Can write migrations db/migrations and scoped by engine name
- * `rake my_engine::install::migrations` only copy in new migrations
- * Routes are defined in engine and engine is mounted in client app
- routes at a certain path
-
-### Testing a Rails engine
-
-Best practice is
- 1. to create a dummy app in test directory
- 2. mount engine in dummy app
- 3. test the dummy app
-
-For more info: http://guides.rubyonrails.org/engines.html
-
-### When should I write an engine?
-
-1. If you are at a point and you have two apps which need to share logic,
-slice out the logic into a gem to be shared.
-2. A base like scaffolding, assets or template which can be mounted
-into multiple apps and reused
-
@@ -1,107 +0,0 @@
-# Sugar-Free Ruby: An Experiment in Object-first Teaching
-## Steven! Ragnarök [@nuclearsandwich](https://twitter.com/nuclearsandwich)
-
-https://speakerdeck.com/u/nuclearsandwich/p/sugar-free-ruby
-
-### Introduction
-
-Sugar-free emphasizes Ruby is Objects
-
-### Teaching Programming
-
-If we don't teach it, its going away
-
-You owe it to your teachers to continue the tradition
-
-Teaching programming is very hard!!
- * Its really hard to learn to program
- * Your assumptions aren't natural
- * Takes a lot of empathy
- * Its hard to share something valuable
- * We always want to gain value out of an interaction
- * You will be rewarded for your knowledge and sharing!
-
-It takes a lot of self reflection to teach well
-Just like getting better at programming, you must always be a student
-
-### CoderDojo
-
-Dedicated to setting up kids coding projects
-In small groups, children learn to program
-Kids learn that **Programming Is Fun!**
- * Encourages children to continue to program
- * Its best way to engage kids, is to make an activity fun
-
-### Rails Bridge
-
-For anyone in this world, programming is hard but attainable
-Focus on fun parts like Rails instead of installing language and dependencies
-
-### Challenge with Teaching Ruby
-
-You have to know why the student is trying to learn
-You have to ask, "Why do you want to learn Ruby?"
- * I hate my job and programmers make bank
- * I know how to program but not Ruby, the Ruby community is awesome!
- * I'm curious about programming
-
-### How are we teaching Ruby right now?
-
- * Data types
- * True and false
- * Collection structures
- * Expressions
- * Console
- * Variables
- * Conditionals
- * Loops
- * If we are lucky, we might talk about `foo.upcase` aka objects
-
-Where are students' minds blown? Information overload.
-
-Whats wrong with this picture?
-Too many concepts before discussing methods or even mentioning classes.
-
-Ruby is not a computer a language!
-Ruby doesn't care its on a computer.
-
-### Teach Ruby as Objects!
-
-Reservation: students head will explode, but it already does with first way to teach via data types through loops.
-
-Give the students an idea of Objects and let them explore via irb
-
-Use `#send` to emphasize message passing
-Be explicit to really reveal the fact that messages are being passed
-
-**Objects and classes are one in the same!**
-
-### Now we can talk about a narrative
-
-Gives student a thread to follow
-
-`Object.new`
- * A message called new
- * Can be sent to any class
- * Gives you back and instance of that class
- * We give a name to the object
-
-Helps student link in their minds exactly what is happening!
-
-Kernal.puts is better than puts since mixins are _too complicated_ for now
-Keep the student on the narrative instead of going down a tangent
-
-### What have we introduced at this point?
-
-Objects have methods which accept and send messages
-Introduce Classes except Class is a Class which creates new Classes
-
-### Wrap up
-
-**Teach objects with Ruby instead of teach Ruby with objects**
-Better foundation because Ruby cares about Objects and how they interact
-
-Details on better foundation:
- * https://speakerdeck.com/u/nuclearsandwich/p/sugar-free-ruby?slide=61
- * https://speakerdeck.com/u/nuclearsandwich/p/sugar-free-ruby?slide=62
- * https://speakerdeck.com/u/nuclearsandwich/p/sugar-free-ruby?slide=63
View
@@ -1,156 +0,0 @@
-# High Performance Ruby
-## Charles Nutter [@headius](https://twitter.com/headius)
-
-http://www.slideshare.net/CharlesNutter/high-performance-ruby-golden-gate-rubyconf-2012
-
-### Introduction
-
-JRuby
-How do we make Ruby fast?
-
-### What does performance mean?
-Man hours vs. CPU
-Straightline, time
-
-### High Performance?
-which ruby implementation
-ruby faster than other runtimes?
-
-### Fast Enough?
-1.9.3 fast enough and 1.8.7 is slow
-
-### Performance Wall
-Can't get done what you want to get done
-You're bound by your architecture
-Move to different runtime
-
-*If you're not writing performance sensitive code in Ruby, you're giving up too easily!!!*
-
-### Native Extensions
-Not universally bad, but bad in MRI
-What is bad is the way their implemented within CRuby
-Unless you're in MRI, you're limited when writing native extensions
-
-### What We Want
-Faster execution
-Better GC, non-blocking
-Parallel Execution via threads or actors within a process
-Big data by continuous scans
-
-*Can't have any of these with current C extension implementations!*
-
-### Different Approach
-Don't fallback to C, so lets improve Ruby to make it faster.
-
-1. Build your own runtime like YARV, Rubinius or MacRuby
-2. Use an existing runtime like JRuby
-
-### Build or Buy
-Making a new VM is easy (early rubinuius was simple)
-Making a new VM competitive is *really really hard*
-
-### JRuby choose JVM
-15 years of open source experience and super quick
-Best GCs available
-Full parallel threading
-Broad platform support so wide adoption
-
-### But Java Is Slow?
-
-Rumor is dying because Java is now C fast
-Java is terrible for application development because too many abstractions
-Simple algorithms can compile to same bytecode as C
-*The way you write code is much more important than what you write it in*
-
-### JRuby
-Java implementation of Ruby on JVM
-1 to 1 compatible with MRI
-JRuby JITs to JVM bytecode
-
-### Can Still Be Faster
-Still things about Ruby which defy optimization such as interpreter optimization
-
-(see slides for great timeline of commits)
-
-### Goal is to Align Ruby with JVM
-Ruby local variables are JVM local variables
-Avoid inter-call goo
-*Eliminate unnecessary work*
-
-### Unnecessary Work
-Everything is a map such as modules, instance variables
-
-### Method Lookup
-Method lookups go up-hierarchy
-Lookup target caches result (child caches method defined in parent)
-Modification cascades down
-
-### Bottom Line of Optimizing Ruby
-Make calls fast
-Make constants free
-
-### Invokedynamics
-
-### JVM 101
-Opcodes / Data endpoints
- * Invocation
- * Field access getting data out of object
- * Array access
- *
-All Java code revolves around these endpoints
-
-If you every stray outside of opcodes, you are stuck!
-We need millions of operations!
-
-With invokedynamic, we can get around this problem
- 1. invokedynamic bytecode
- 2. bootstrap method
- 3. method handles
- 4. find target method on JVM (see diagram on slides)
-
-Now the path is cached and optimized!
-
-*InvokeDynamic lets JRuby teach the JVM how Ruby works, so the JVM can optimize like any other language on the JVM*
-
-### How do we know JRuby is fast?
-
-**Benchmarking is really hard**
-
-### JVM opto 101
-JITs code bodies after 10k calls
-Inlines up to two targets
-Optimistic by making very aggressive decisions
- * Makes optimistic decisions for a small system, but those decisions
- * Will have to be reversed for large systems
-Inlining optimizes and writes bytecode for a chunk of code instead of pieces
-
-Benchmarking is not always enough, you have to read the assembly generated by JVM
-
-### Moral
-Benchmarks are synthetic
-Every system is different
-Figure out what is slow in your system, and benchmark this part of your system
-
-### Rails?
-Significant gains for some folks
-
-### What is next?
-Expand where JRuby optimizes such as super
-
-### Wacky stuff?
-Optimize things like `respond_to?` or `method_missing`
-
-_Ruby flip-flops_
-http://stackoverflow.com/questions/1111286/when-would-a-ruby-flip-flop-be-useful
-
-### The Future
-JRuby will get faster!
-InvokeDynamic will get faster!
-
-
-
-
-
-
-
-
Oops, something went wrong.

0 comments on commit de5ca13

Please sign in to comment.