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

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

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

    1. Ruby Type Inference & Code Completion for RDT Google Summer of Code Jason Morrison
    2. Overview
      • Project Goals
      • Why Eclipse and Java?
      • Completion Features
      • Type Inference Algorithm
      • Issues
      • The Future
    3. Project Goals
    4. Project Goals
      • Code completion for RDT
        • I’m lazy; Ruby is great and succinct, but…
        • And, it helps other developers!
    5. Project Goals
      • Ruby type inference
        • It’s fun! (Read: I knew very little about it)
        • Alternative implementation performance
          • Priming the cache for polymorphic dispatch
    6. Why Eclipse and Java?
    7.  
    8.  
    9.  
    10.  
    11.  
    12. “ Eclipse is too big!”
    13.  
    14. “ It’s bloated! :P”
    15.  
    16. Not targeting that guy
    17. Convert the natives!
    18. Completion Features
    19. Completion Features
      • Scoped object completion
      • Method completion
    20. Scoped Object Completion
      • Locals, Block Locals
      • @, @@, $
      • Pre-defined variables
        • $_, $:, $”, $0 and friends
      • Available classes
    21. Scoped Object Completion
      • Tricky spots:
        • Open classes
        • No explicit declaration
        • set_instance_var and friends
    22. Method Completion
      • Invocations are message passing
      • Type is a bag of possible methods
        • Selector
        • [Args]
        • [Confidence]
    23. 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…
    24. Type Inference Algorithm
    25. What is Type Inference?
      • Determine the type of an expression
      • Static analysis
      • Type versus Class
      • Not always definitive
    26. Type Inference Algorithm
      • Inspired by DDP by Lex Spoon:
        • Demand-Driven Analysis with Goal Pruning
      • Type flow analysis
      • Unions types over contours
    27. DDP Structure
      • Posts goals
      • Goals have sub-goals
      • Answered by judgements
      • Prunes low value goals
        • High cost
        • Low impact on high level goals
    28. 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;?
    29. DataFlowTypeInferrer
      • infer(String source, int offset)
      • findSenders(String scope, String selector)
      • findMethodDef(String scope, String selector)
    30. DataFlowTypeInferrer
    31. Issues
      • Eval
      • Data-bound flow control
        • return ( rand() > 0.5 ) ? String.new : Array.new
      • Metaprogramming
      • Collections
      • Builtins
    32. 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
    33. Thanks!
      • Chris Williams, project mentor!
      • Google Summer of Code
      • Everyone on the RDT and JRuby teams
      • All the folks at RubyCentral
    34. Q&A
      • Jason Morrison
      • [email_address]
      • http://soc.jayunit.net

    + Jason MorrisonJason Morrison, 2 years ago

    custom

    1467 views, 0 favs, 1 embeds more stats

    A discussion of my contributions to the Ruby Develo more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1467
      • 1455 on SlideShare
      • 12 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 14
    Most viewed embeds
    • 12 views on http://jayunit.net

    more

    All embeds
    • 12 views on http://jayunit.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories