SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
MacRuby + HotCocoa

 by rICH kILMER
 Golden Gate Ruby Conf
A History of Apple and Ruby
                                 MacRuby


 2002 2003 2004 2005 2006 2007 2008 2009

                             OS X 10.5      OS X 10.x
OS X 10.2      OS X 10.4
                            Ruby 1.8.6     Ruby 1.8.7
Ruby 1.6.7     Ruby 1.8.2
                            RubyGems       RubyGems
                            RubyCocoa      RubyCocoa
                               Rails        Rails 2.2
Apple’s Goals:

   Make Mac OS X the best
platform for Ruby developers
Apple’s Goals:
                           t
                         s
                       e
                     b
                   e
                  h class
                t
   Make Ruby a first
Cocoa programming language
        on Mac OS X
Mac OS X Stack
    User Experience

 Application Frameworks

   Graphics and Media

        Darwin
Mac OS X Stack - Languages
     User Experience       Objective-C

  Application Frameworks

    Graphics and Media

         Darwin                 C
Bridging Ruby & Objective-C
           RubyCocoa
                 by
by FUJIMOTO Hisakuni (2001)
 Bundled with Mac OS X 10.5 (stable)
RubyCocoa Hello World
require 'osx/cocoa'; include OSX

app = NSApplication.sharedApplication

win = NSWindow.alloc.initWithContentRect_styleMask_backing_defer(
    [0, 0, 200, 60],
    NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask,
    NSBackingStoreBuffered,
    false)
win.title = 'Hello World'

button = NSButton.alloc.initWithFrame(NSZeroRect)
win.contentView.addSubview(button)
button.bezelStyle = NSRoundedBezelStyle
button.title = 'Hello!'
button.sizeToFit
button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0),
                                 (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0))

button_controller = Object.new
def button_controller.sayHello(sender)
  puts quot;Hello World!quot;
end
button.target = button_controller
button.action = 'sayHello:'

win.display
win.orderFrontRegardless

app.run
Problems with RubyCocoa:
        It’s a bridge
Messaging syntax is different
  Ruby uses green threads
   Two runtimes, two GCs
Enter MacRuby
                            MacRuby 0.4

      Objective-C 2.0                           Ruby 1.9
   Core      Garbage                                          Standard
                         Runtime     YARV          Parser
Foundation   Collector                                         Library
                                    Garbage       Built-ins
                                    Collector



         Every Ruby class is an Objective-C class
        Every Ruby object is an Objective-C object
       Every Ruby method is an Objective-C method
MacRuby Hello World
framework ‘Cocoa’

app = NSApplication.sharedApplication

win = NSWindow.alloc.initWithContentRect([0, 0, 200, 60],
    styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask,
    backing:NSBackingStoreBuffered,
    defer:false)

win.title = 'Hello World'

button = NSButton.alloc.initWithFrame(NSZeroRect)
win.contentView.addSubview(button)
button.bezelStyle = NSRoundedBezelStyle
button.title = 'Hello!'
button.sizeToFit
button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0),
                                 (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0))

button_controller = Object.new
def button_controller.sayHello(sender)
  puts quot;Hello World!quot;
end
button.target = button_controller
button.action = 'sayHello:'

win.display
win.orderFrontRegardless

app.run
Enter HotCocoa
   HotCocoa is an idiomatic
  Ruby API that simplifies the
   configuration and wiring
together of ObjC/Cocoa classes
MacRuby Hello World
framework ‘Cocoa’

app = NSApplication.sharedApplication

win = NSWindow.alloc.initWithContentRect([0, 0, 200, 60],
    styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask,
    backing:NSBackingStoreBuffered,
    defer:false)

win.title = 'Hello World'

button = NSButton.alloc.initWithFrame(NSZeroRect)
win.contentView.addSubview(button)
button.bezelStyle = NSRoundedBezelStyle
button.title = 'Hello!'
button.sizeToFit
button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0),
                                 (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0))

button_controller = Object.new
def button_controller.sayHello(sender)
  puts quot;Hello World!quot;
end
button.target = button_controller
button.action = 'sayHello:'

win.display
win.orderFrontRegardless

app.run
HotCocoa Hello World
require ‘hotcocoa’; include HotCocoa

app = NSApplication.sharedApplication

win = NSWindow.alloc.initWithContentRect([0, 0, 200, 60],
    styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask,
    backing:NSBackingStoreBuffered,
    defer:false)

win.title = 'Hello World'

button = NSButton.alloc.initWithFrame(NSZeroRect)
win.contentView.addSubview(button)
button.bezelStyle = NSRoundedBezelStyle
button.title = 'Hello!'
button.sizeToFit
button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0),
                                 (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0))

button_controller = Object.new
def button_controller.sayHello(sender)
  puts quot;Hello World!quot;
end
button.target = button_controller
button.action = 'sayHello:'

win.display
win.orderFrontRegardless

app.run
HotCocoa Hello World
require ‘hotcocoa’; include HotCocoa

app = NSApplication.sharedApplication


win = window :title => ‘hello world’, :frame => [0, 0, 200, 60]

button = NSButton.alloc.initWithFrame(NSZeroRect)
win.contentView.addSubview(button)
button.bezelStyle = NSRoundedBezelStyle
button.title = 'Hello!'
button.sizeToFit
button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0),
                                 (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0))

button_controller = Object.new
def button_controller.sayHello(sender)
  puts quot;Hello World!quot;
end
button.target = button_controller
button.action = 'sayHello:'

win.display
win.orderFrontRegardless

app.run
HotCocoa Hello World
require ‘hotcocoa’; include HotCocoa

app = NSApplication.sharedApplication


win = window :title => ‘hello world’, :frame => [0, 0, 200, 60]

b = button :title => ‘Hello!’, :layout => {:align => :center}
win << b

button_controller = Object.new
def button_controller.sayHello(sender)
  puts quot;Hello World!quot;
end
button.target = button_controller
button.action = 'sayHello:'

win.display
win.orderFrontRegardless

app.run
HotCocoa Hello World
require ‘hotcocoa’; include HotCocoa

app = NSApplication.sharedApplication


win = window :title => ‘hello world’, :frame => [0, 0, 200, 60]

b = button :title => ‘Hello!’, :layout => {:align => :center}
win << b

b.on_action { puts “Hello World!” }

win.display
win.orderFrontRegardless

app.run
HotCocoa Hello World
require ‘hotcocoa’; include HotCocoa

application do

  win = window :title => ‘hello world’, :frame => [0, 0, 200, 60]

  b = button :title => ‘Hello!’, :layout => {:align => :center}
  win << b

  b.on_action { puts “Hello World!” }

end
hotcocoa Command
HotCocoa Library
hotcocoa <app>     Rakefile
                      config
                   build.yml
                        lib
                   menu.rb
                        lib
                 application.rb
                     resources
                 HotCocoa.icns
Demo
MacRuby Experimental
                            MacRuby 0.5

LLVM         Objective-C 2.0                         Ruby 1.9
               Garbage                                             Standard
 JIT                         Runtime      YARV          Parser
               Collector                                            Library
              Disk/Socket      Core      Garbage
 AOT                                                   Built-ins
                   IO       Foundation   Collector


              Numerous optimizations (speed!)
       No libffi for external calls, new bridgesupport
             Passing many RubySpecs already!
         Will implement fully concurrent threading
www.macruby.org
   @macruby

by rICH kILMER
Golden Gate Ruby Conf

Más contenido relacionado

La actualidad más candente

Toster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsToster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsFabio Akita
 
Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Halil Kaya
 
TorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyTorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyBruno Oliveira
 
Complex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBoxComplex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBoxbobmcwhirter
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011Lance Ball
 
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)ngotogenome
 
node.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Servernode.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the ServerDavid Ruiz
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerMarcus Lönnberg
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyistsbobmcwhirter
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyNick Sieger
 
Supercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicSupercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicIan Robertson
 
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....Alessandro Cinelli (cirpo)
 
Spring into rails
Spring into railsSpring into rails
Spring into railsHiro Asari
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesCharles Nutter
 
Torquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundosTorquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundosBruno Oliveira
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
A jar-nORM-ous Task
A jar-nORM-ous TaskA jar-nORM-ous Task
A jar-nORM-ous TaskErin Dees
 
MacRuby to The Max
MacRuby to The MaxMacRuby to The Max
MacRuby to The MaxBrendan Lim
 
Mac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. LimMac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. LimThoughtWorks
 

La actualidad más candente (20)

Toster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsToster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability Options
 
Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36
 
TorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyTorqueBox - When Java meets Ruby
TorqueBox - When Java meets Ruby
 
Complex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBoxComplex Made Simple: Sleep Better with TorqueBox
Complex Made Simple: Sleep Better with TorqueBox
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
 
Devignition 2011
Devignition 2011Devignition 2011
Devignition 2011
 
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
 
node.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Servernode.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Server
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with Docker
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
 
Supercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicSupercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamic
 
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
 
Spring into rails
Spring into railsSpring into rails
Spring into rails
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
 
Torquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundosTorquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundos
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
A jar-nORM-ous Task
A jar-nORM-ous TaskA jar-nORM-ous Task
A jar-nORM-ous Task
 
MacRuby to The Max
MacRuby to The MaxMacRuby to The Max
MacRuby to The Max
 
Mac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. LimMac ruby to the max - Brendan G. Lim
Mac ruby to the max - Brendan G. Lim
 

Similar a Macruby& Hotcocoa presentation by Rich Kilmer

MacRuby & RubyMotion - Madridrb May 2012
MacRuby & RubyMotion - Madridrb May 2012MacRuby & RubyMotion - Madridrb May 2012
MacRuby & RubyMotion - Madridrb May 2012Mark Villacampa
 
GUI Programming with MacRuby
GUI Programming with MacRubyGUI Programming with MacRuby
GUI Programming with MacRubyErik Berlin
 
Ruby Meets Cocoa
Ruby Meets CocoaRuby Meets Cocoa
Ruby Meets CocoaRobbert
 
Fast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on OracleFast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on OracleRaimonds Simanovskis
 
JRuby - Enterprise 2.0
JRuby - Enterprise 2.0JRuby - Enterprise 2.0
JRuby - Enterprise 2.0Jan Sifra
 
MacRuby For Ruby Developers
MacRuby For Ruby DevelopersMacRuby For Ruby Developers
MacRuby For Ruby DevelopersRenzo Borgatti
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options.toster
 
MacRuby & HotCocoa
MacRuby & HotCocoaMacRuby & HotCocoa
MacRuby & HotCocoaThilo Utke
 
Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"Sean McCune
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureHabeeb Rahman
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011Nick Sieger
 
RubyMotion Introduction
RubyMotion IntroductionRubyMotion Introduction
RubyMotion IntroductionLori Olson
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.Mike Brevoort
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformniyof97
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)Flowdock
 

Similar a Macruby& Hotcocoa presentation by Rich Kilmer (20)

MacRuby, an introduction
MacRuby, an introductionMacRuby, an introduction
MacRuby, an introduction
 
MacRuby & RubyMotion - Madridrb May 2012
MacRuby & RubyMotion - Madridrb May 2012MacRuby & RubyMotion - Madridrb May 2012
MacRuby & RubyMotion - Madridrb May 2012
 
GUI Programming with MacRuby
GUI Programming with MacRubyGUI Programming with MacRuby
GUI Programming with MacRuby
 
RubyMotion
RubyMotionRubyMotion
RubyMotion
 
Ruby Meets Cocoa
Ruby Meets CocoaRuby Meets Cocoa
Ruby Meets Cocoa
 
Fast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on OracleFast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on Oracle
 
JRuby - Enterprise 2.0
JRuby - Enterprise 2.0JRuby - Enterprise 2.0
JRuby - Enterprise 2.0
 
Macruby intro
Macruby introMacruby intro
Macruby intro
 
MacRuby For Ruby Developers
MacRuby For Ruby DevelopersMacRuby For Ruby Developers
MacRuby For Ruby Developers
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options
 
MacRuby & HotCocoa
MacRuby & HotCocoaMacRuby & HotCocoa
MacRuby & HotCocoa
 
Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"Modified "Why MacRuby Matters"
Modified "Why MacRuby Matters"
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
 
RubyMotion Introduction
RubyMotion IntroductionRubyMotion Introduction
RubyMotion Introduction
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
introduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraformintroduction-infra-as-a-code using terraform
introduction-infra-as-a-code using terraform
 
Ruby on the server
Ruby on the serverRuby on the server
Ruby on the server
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 

Más de Matt Aimonetti

Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Matt Aimonetti
 
2D Video Games with MacRuby
2D Video Games with MacRuby2D Video Games with MacRuby
2D Video Games with MacRubyMatt Aimonetti
 
Future Of Ruby And Rails
Future Of Ruby And RailsFuture Of Ruby And Rails
Future Of Ruby And RailsMatt Aimonetti
 
Rails3: Stepping off of the golden path
Rails3: Stepping off of the golden pathRails3: Stepping off of the golden path
Rails3: Stepping off of the golden pathMatt Aimonetti
 
MacRuby - When objective-c and Ruby meet
MacRuby - When objective-c and Ruby meetMacRuby - When objective-c and Ruby meet
MacRuby - When objective-c and Ruby meetMatt Aimonetti
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The EnterpriseMatt Aimonetti
 
Merb presentation at ORUG
Merb presentation at ORUGMerb presentation at ORUG
Merb presentation at ORUGMatt Aimonetti
 

Más de Matt Aimonetti (9)

Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010
 
2D Video Games with MacRuby
2D Video Games with MacRuby2D Video Games with MacRuby
2D Video Games with MacRuby
 
Future Of Ruby And Rails
Future Of Ruby And RailsFuture Of Ruby And Rails
Future Of Ruby And Rails
 
Rails3: Stepping off of the golden path
Rails3: Stepping off of the golden pathRails3: Stepping off of the golden path
Rails3: Stepping off of the golden path
 
MacRuby - When objective-c and Ruby meet
MacRuby - When objective-c and Ruby meetMacRuby - When objective-c and Ruby meet
MacRuby - When objective-c and Ruby meet
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The Enterprise
 
Merb presentation at ORUG
Merb presentation at ORUGMerb presentation at ORUG
Merb presentation at ORUG
 
Merb Plugins 101
Merb Plugins 101Merb Plugins 101
Merb Plugins 101
 
Lazy Indexing
Lazy IndexingLazy Indexing
Lazy Indexing
 

Último

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 

Último (20)

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 

Macruby& Hotcocoa presentation by Rich Kilmer

  • 1. MacRuby + HotCocoa by rICH kILMER Golden Gate Ruby Conf
  • 2. A History of Apple and Ruby MacRuby 2002 2003 2004 2005 2006 2007 2008 2009 OS X 10.5 OS X 10.x OS X 10.2 OS X 10.4 Ruby 1.8.6 Ruby 1.8.7 Ruby 1.6.7 Ruby 1.8.2 RubyGems RubyGems RubyCocoa RubyCocoa Rails Rails 2.2
  • 3. Apple’s Goals: Make Mac OS X the best platform for Ruby developers
  • 4. Apple’s Goals: t s e b e h class t Make Ruby a first Cocoa programming language on Mac OS X
  • 5. Mac OS X Stack User Experience Application Frameworks Graphics and Media Darwin
  • 6. Mac OS X Stack - Languages User Experience Objective-C Application Frameworks Graphics and Media Darwin C
  • 7. Bridging Ruby & Objective-C RubyCocoa by by FUJIMOTO Hisakuni (2001) Bundled with Mac OS X 10.5 (stable)
  • 8. RubyCocoa Hello World require 'osx/cocoa'; include OSX app = NSApplication.sharedApplication win = NSWindow.alloc.initWithContentRect_styleMask_backing_defer( [0, 0, 200, 60], NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask, NSBackingStoreBuffered, false) win.title = 'Hello World' button = NSButton.alloc.initWithFrame(NSZeroRect) win.contentView.addSubview(button) button.bezelStyle = NSRoundedBezelStyle button.title = 'Hello!' button.sizeToFit button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0), (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0)) button_controller = Object.new def button_controller.sayHello(sender) puts quot;Hello World!quot; end button.target = button_controller button.action = 'sayHello:' win.display win.orderFrontRegardless app.run
  • 9. Problems with RubyCocoa: It’s a bridge Messaging syntax is different Ruby uses green threads Two runtimes, two GCs
  • 10. Enter MacRuby MacRuby 0.4 Objective-C 2.0 Ruby 1.9 Core Garbage Standard Runtime YARV Parser Foundation Collector Library Garbage Built-ins Collector Every Ruby class is an Objective-C class Every Ruby object is an Objective-C object Every Ruby method is an Objective-C method
  • 11. MacRuby Hello World framework ‘Cocoa’ app = NSApplication.sharedApplication win = NSWindow.alloc.initWithContentRect([0, 0, 200, 60], styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask, backing:NSBackingStoreBuffered, defer:false) win.title = 'Hello World' button = NSButton.alloc.initWithFrame(NSZeroRect) win.contentView.addSubview(button) button.bezelStyle = NSRoundedBezelStyle button.title = 'Hello!' button.sizeToFit button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0), (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0)) button_controller = Object.new def button_controller.sayHello(sender) puts quot;Hello World!quot; end button.target = button_controller button.action = 'sayHello:' win.display win.orderFrontRegardless app.run
  • 12. Enter HotCocoa HotCocoa is an idiomatic Ruby API that simplifies the configuration and wiring together of ObjC/Cocoa classes
  • 13. MacRuby Hello World framework ‘Cocoa’ app = NSApplication.sharedApplication win = NSWindow.alloc.initWithContentRect([0, 0, 200, 60], styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask, backing:NSBackingStoreBuffered, defer:false) win.title = 'Hello World' button = NSButton.alloc.initWithFrame(NSZeroRect) win.contentView.addSubview(button) button.bezelStyle = NSRoundedBezelStyle button.title = 'Hello!' button.sizeToFit button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0), (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0)) button_controller = Object.new def button_controller.sayHello(sender) puts quot;Hello World!quot; end button.target = button_controller button.action = 'sayHello:' win.display win.orderFrontRegardless app.run
  • 14. HotCocoa Hello World require ‘hotcocoa’; include HotCocoa app = NSApplication.sharedApplication win = NSWindow.alloc.initWithContentRect([0, 0, 200, 60], styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask, backing:NSBackingStoreBuffered, defer:false) win.title = 'Hello World' button = NSButton.alloc.initWithFrame(NSZeroRect) win.contentView.addSubview(button) button.bezelStyle = NSRoundedBezelStyle button.title = 'Hello!' button.sizeToFit button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0), (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0)) button_controller = Object.new def button_controller.sayHello(sender) puts quot;Hello World!quot; end button.target = button_controller button.action = 'sayHello:' win.display win.orderFrontRegardless app.run
  • 15. HotCocoa Hello World require ‘hotcocoa’; include HotCocoa app = NSApplication.sharedApplication win = window :title => ‘hello world’, :frame => [0, 0, 200, 60] button = NSButton.alloc.initWithFrame(NSZeroRect) win.contentView.addSubview(button) button.bezelStyle = NSRoundedBezelStyle button.title = 'Hello!' button.sizeToFit button.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0), (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0)) button_controller = Object.new def button_controller.sayHello(sender) puts quot;Hello World!quot; end button.target = button_controller button.action = 'sayHello:' win.display win.orderFrontRegardless app.run
  • 16. HotCocoa Hello World require ‘hotcocoa’; include HotCocoa app = NSApplication.sharedApplication win = window :title => ‘hello world’, :frame => [0, 0, 200, 60] b = button :title => ‘Hello!’, :layout => {:align => :center} win << b button_controller = Object.new def button_controller.sayHello(sender) puts quot;Hello World!quot; end button.target = button_controller button.action = 'sayHello:' win.display win.orderFrontRegardless app.run
  • 17. HotCocoa Hello World require ‘hotcocoa’; include HotCocoa app = NSApplication.sharedApplication win = window :title => ‘hello world’, :frame => [0, 0, 200, 60] b = button :title => ‘Hello!’, :layout => {:align => :center} win << b b.on_action { puts “Hello World!” } win.display win.orderFrontRegardless app.run
  • 18. HotCocoa Hello World require ‘hotcocoa’; include HotCocoa application do win = window :title => ‘hello world’, :frame => [0, 0, 200, 60] b = button :title => ‘Hello!’, :layout => {:align => :center} win << b b.on_action { puts “Hello World!” } end
  • 20. hotcocoa <app> Rakefile config build.yml lib menu.rb lib application.rb resources HotCocoa.icns
  • 21. Demo
  • 22. MacRuby Experimental MacRuby 0.5 LLVM Objective-C 2.0 Ruby 1.9 Garbage Standard JIT Runtime YARV Parser Collector Library Disk/Socket Core Garbage AOT Built-ins IO Foundation Collector Numerous optimizations (speed!) No libffi for external calls, new bridgesupport Passing many RubySpecs already! Will implement fully concurrent threading
  • 23. www.macruby.org @macruby by rICH kILMER Golden Gate Ruby Conf