Summer of Code 2006: Ruby Type Inference & Code Completion for RDT
Upcoming SlideShare
Loading in...5
×
 

Summer of Code 2006: Ruby Type Inference & Code Completion for RDT

on

  • 2,752 views

A discussion of my contributions to the Ruby Development Tool regarding type inference for the purpose of code completion. Given at RubyConf 2006, work done for Google Summer of Code 2006.

A discussion of my contributions to the Ruby Development Tool regarding type inference for the purpose of code completion. Given at RubyConf 2006, work done for Google Summer of Code 2006.

Statistics

Views

Total Views
2,752
Views on SlideShare
2,716
Embed Views
36

Actions

Likes
0
Downloads
16
Comments
0

4 Embeds 36

http://jayunit.net 32
http://www.slideshare.net 2
http://localhost 1
http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Summer of Code 2006: Ruby Type Inference & Code Completion for RDT Summer of Code 2006: Ruby Type Inference & Code Completion for RDT Presentation Transcript

  • Ruby Type Inference & Code Completion for RDT Google Summer of Code Jason Morrison
  • Overview
    • Project Goals
    • Why Eclipse and Java?
    • Completion Features
    • Type Inference Algorithm
    • Issues
    • The Future
  • Project Goals
  • Project Goals
    • Code completion for RDT
      • I’m lazy; Ruby is great and succinct, but…
      • And, it helps other developers!
  • Project Goals
    • Ruby type inference
      • It’s fun! (Read: I knew very little about it)
      • Alternative implementation performance
        • Priming the cache for polymorphic dispatch
  • Why Eclipse and Java?
  •  
  •  
  •  
  •  
  •  
  • “ Eclipse is too big!”
  •  
  • “ It’s bloated! :P”
  •  
  • Not targeting that guy
  • Convert the natives!
  • Completion Features
  • Completion Features
    • Scoped object completion
    • Method completion
  • Scoped Object Completion
    • Locals, Block Locals
    • @, @@, $
    • Pre-defined variables
      • $_, $:, $”, $0 and friends
    • Available classes
  • Scoped Object Completion
    • Tricky spots:
      • Open classes
      • No explicit declaration
      • set_instance_var and friends
  • Method Completion
    • Invocations are message passing
    • Type is a bag of possible methods
      • Selector
      • [Args]
      • [Confidence]
  • Method Completion
    • Many scoping and definition syntaxes:
      • class Foo;def method;…
      • instance_eval…
      • class_eval…
      • define_method…
      • include FooModule
      • Object#extend(module)
      • class << self; def method;…
      • method_missing…
  • Type Inference Algorithm
  • What is Type Inference?
    • Determine the type of an expression
    • Static analysis
    • Type versus Class
    • Not always definitive
  • Type Inference Algorithm
    • Inspired by DDP by Lex Spoon:
      • Demand-Driven Analysis with Goal Pruning
    • Type flow analysis
    • Unions types over contours
  • DDP Structure
    • Posts goals
    • Goals have sub-goals
    • Answered by judgements
    • Prunes low value goals
      • High cost
      • Low impact on high level goals
  • DDP Goals
    • 1. Type goal
      • What is the type of x?
    • 2. Transitive flow
      • Where can objects flow from x?
    • 3. Simple flow
      • Where can objects flow from x in one step?
    • 4. Sender
      • What statements invoke FooClass#bar?
    • 5. Responder
      • What methods are invoked by &quot;foo.bar&quot;?
  • DataFlowTypeInferrer
    • infer(String source, int offset)
    • findSenders(String scope, String selector)
    • findMethodDef(String scope, String selector)
  • DataFlowTypeInferrer
  • Issues
    • Eval
    • Data-bound flow control
      • return ( rand() > 0.5 ) ? String.new : Array.new
    • Metaprogramming
    • Collections
    • Builtins
  • The Future
    • Statistical type inference
    • Type metadata (collections)
    • Rails tie-in
      • AR querying for magic find
      • Instance vars in View templates
    • TI for implementation optimizations
  • Thanks!
    • Chris Williams, project mentor!
    • Google Summer of Code
    • Everyone on the RDT and JRuby teams
    • All the folks at RubyCentral
  • Q&A
    • Jason Morrison
    • [email_address]
    • http://soc.jayunit.net