jimmy hacking (at) Microsoft

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

    1 Favorite

    jimmy hacking (at) Microsoft - Presentation Transcript

    1. jimmy hacking (at) microsoft wpi | flaud | 2008-11-24 open source programming languages
    2. I'm back!
    3. Jimmy Schementi http://blog.jimmy.schementi.com
    4.  
    5. 2002-2007
    6.  
    7.  
    8.  
    9.  
    10.  
    11.  
    12.  
    13.  
    14.  
    15.  
    16.  
    17.  
    18. Jimmy, show Logo Demo!
    19.  
    20.  
    21.  
    22.  
    23.  
    24. .testing
    25. Terminology Java Language  C# Java Platform  .NET Platform (CLR) Flash + Java applets + JavaFX  Silverlight
    26. IronPython 1.0
    27. September 2006
    28. Python 2.4 Compatible
    29. CLR great for dynamic languages But requires a lot of work
    30. DLR Dynamic Language Runtime
    31. Compiler Infrastructure
    32. compiler front-end return Syntax Tree Return def add2(a) { return 2 + a; } Scan 2 + a ; Parse Token stream Add Named(a) Const(2)
    33. compiler back-end on CLR Syntax Tree Return Add Named(a) Const(2) Generate IL ldc.i4.2 // load 2 box [mscorlib]System.Int32 ldarg.0 // load “a” call object LangHelpers::Add(object, object) ret IL public static object Add (object x, object y) { ... } Runtime Library
    34. compiler back-end on DLR Syntax Tree Return Add Named(a) Const(2) Generate DLR Tree DLR Tree Return MethodCall LangHelpers.Add BoundExpression ConstantExpression 2 ConvertTo Object Variable a: Object
    35. two ways to call
      • def yo (name):
      • "hello " + name
      • print yo("jimmy")
      MethodCallExpression Method : {RuntimeMethodInfo {Name: "Print"}} Arguments : [0] ActionExpression ActionExpression yo("jimmy") Action : CallAction Arguments : [0] {BoundExpression {Variable: Local{yo}}} [1] {ConstantExpression {"jimmy"}}
      • public static object Handle (
      • object[] args, DynamicSite<object, object, object> site1,
      • object obj1, object obj2)
      • {
      • if (obj1 != null && obj1.GetType() == typeof(string) &&
      • obj2 != null && obj2.GetType() == typeof(string))
      • {
      • return StringOps.Add(Converter.ConvertToString(obj1),
      • Converter.ConvertToString(obj2));
      • }
      • return site1.UpdateBindingAndInvoke(obj1, obj2);
      • }
      • public static object Handle (
      • object[] args, DynamicSite<object, object, object> site1,
      • object obj1, object obj2)
      • {
      • if (obj1 != null && obj1.GetType() == typeof(int) &&
      • obj2 != null && obj2.GetType() == typeof(int))
      • {
      • return Int32Ops.Add(Converter.ConvertToInt(obj1),
      • Converter.ConvertToInt(obj2));
      • }
      • if (obj1 != null && obj1.GetType() == typeof(string) &&
      • obj2 != null && obj2.GetType() == typeof(string))
      • {
      • return StringOps.Add(Converter.ConvertToString(obj1),
      • Converter.ConvertToString(obj2));
      • }
      • return site1.UpdateBindingAndInvoke(obj1, obj2);
      • }
    36. Hosting &quot;eval&quot; of any language, in any language
    37. Auto Completion Static Language: Easy
    38. Auto Completion Dynamic Language: Holy Crap class Foo def bar end end Foo .class_eval do def baz end end f = Foo.new class << f def bang end end f. WTF?
    39. REPL
    40. Lisp Read Eval Print
    41. r ead e val p rint l oop
    42.  
    43.  
    44.  
    45.  
    46.  
    47. Jimmy, show Ruby Demo!
    48. Jimmy, show DLRConsole Demo!
    49.  
    50. Jimmy, show console=true Demo!
    51. Jimmy, show embedding Demo!
    52.  
    53.  
    54. rails + silverlight demo
    55. http://www.flickr.com/photos/marchange/444184871/
    56.  
      • http://silverlight.net
      • http://codeplex.com/sdlsdk
      • http://github.com/jschementi/agdlr
      • http://codeplex.com/ironpython
      • http://ironruby.net
      • http://codeplex.com/dlr
    57. Recap Silverlight lets you do crazy things with Ruby/Python REPLs are awesome Ruby is crazy DLR: Write a language without the compiler Open source rocks
    58. http://peaceplusone.com/img/hippie.jpg
    59.  

    + Jimmy SchementiJimmy Schementi, 2 years ago

    custom

    765 views, 1 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 765
      • 765 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 13
    Most viewed embeds

    more

    All embeds

    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