pegarus poison
play

Pegarus & Poison Rubinius VM as a Multilanguage Platform - PowerPoint PPT Presentation

Pegarus & Poison Rubinius VM as a Multilanguage Platform Thursday, July 29, 2010 Brian Ford brixen on {twitter IRC gmail} Thursday, July 29, 2010 Thursday, July 29, 2010 Thursday, July 29, 2010 Thursday, July 29, 2010 discussion rant


  1. Pegarus & Poison Rubinius VM as a Multilanguage Platform Thursday, July 29, 2010

  2. Brian Ford brixen on {twitter IRC gmail} Thursday, July 29, 2010

  3. Thursday, July 29, 2010

  4. Thursday, July 29, 2010

  5. Thursday, July 29, 2010

  6. discussion rant tutorial Q&A interaction Thursday, July 29, 2010

  7. fundamentally, we solve problems Thursday, July 29, 2010

  8. Thursday, July 29, 2010

  9. how? Thursday, July 29, 2010

  10. We spend most of our time talking about “How” dynamic vs static functional vs object-oriented threads vs events Rails vs Django Ruby vs Python vs Perl vs PHP C++ vs Java SQL vs NoSQL Thursday, July 29, 2010

  11. what? Thursday, July 29, 2010

  12. We spend a lot less talking about “What” should we build Facebook? Twitter? Google? Windows? Thursday, July 29, 2010

  13. why? Thursday, July 29, 2010

  14. We spend the least time on the most important question... Why am I doing this? Thursday, July 29, 2010

  15. because Thursday, July 29, 2010

  16. do as I say, not as I do Thursday, July 29, 2010

  17. values morals emotions attachments Thursday, July 29, 2010

  18. right vs wrong Thursday, July 29, 2010

  19. context Thursday, July 29, 2010

  20. $ ruby bt.rb bt.rb:7:in `bar': boo (RuntimeError) from bt.rb:2:in `foo' from bt.rb:7:in `bar' from bt.rb:10 Thursday, July 29, 2010

  21. $ rbx bt.rb An exception occurred running bt.rb boo (RuntimeError) Backtrace: Object#bar {} at bt.rb:7 Object#foo at bt.rb:2 Object#bar at bt.rb:7 main.__script__ at bt.rb:10 Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:67 Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:91 Rubinius::Loader#script at kernel/loader.rb:429 Rubinius::Loader#main at kernel/loader.rb:521 Rubinius::Loader.main at kernel/loader.rb:558 Object#__script__ at kernel/loader.rb:570 Thursday, July 29, 2010

  22. cargo culting is a failure to understand “why?” Thursday, July 29, 2010

  23. we are hard-wired for mimicry Thursday, July 29, 2010

  24. mirror neurons Thursday, July 29, 2010

  25. there is no place in our programming languages for rationale Thursday, July 29, 2010

  26. so, you want to implement a programming language Thursday, July 29, 2010

  27. handful of VMs to choose from... Thursday, July 29, 2010

  28. handful of VMs to choose from... and, they all suck Thursday, July 29, 2010

  29. primary language primary data types Thursday, July 29, 2010

  30. Rubinius An implementation of Ruby github.com/evanphx/rubinius Thursday, July 29, 2010

  31. In ~3.5 years... virtual machine garbage collector bytecode compiler Ruby core library primitives system JIT compiler RubySpecs Thursday, July 29, 2010

  32. In ~3.5 years... 2 virtual machines 1.75 garbage collectors 3 bytecode compilers 1 Ruby core library 2 primitives systems 2 JIT compilers tons of RubySpecs Thursday, July 29, 2010

  33. rewrite lazily Thursday, July 29, 2010

  34. rewrite lazily... but, for everyone’s sake, rewrite! Thursday, July 29, 2010

  35. • C++ virtual machine • generational garbage collector • Ruby bytecode compiler • Ruby core library • native threads (GIL) • Fibers (experimental) • LLVM-base JIT compiler Thursday, July 29, 2010

  36. Pegarus An implementation of LPEG github.com/brixen/pegarus Thursday, July 29, 2010

  37. A Text Pattern-Matching Tool based on Parsing Expression Grammars www.inf.puc-rio.br/~roberto/docs/peg.pdf www.inf.puc-rio.br/~roberto/lpeg/lpeg.html Thursday, July 29, 2010

  38. disadvantages of regexes ad hoc extensions no formal semantics unpredictable complexity difficult optimizations Thursday, July 29, 2010

  39. advantages of a parsing machine fairly simple formal semantics optimizations Thursday, July 29, 2010

  40. Thursday, July 29, 2010

  41. /./ Thursday, July 29, 2010

  42. /a/ Thursday, July 29, 2010

  43. /.a/ Thursday, July 29, 2010

  44. Thursday, July 29, 2010

  45. Thursday, July 29, 2010

  46. Thursday, July 29, 2010

  47. Thursday, July 29, 2010

  48. Thursday, July 29, 2010

  49. Thursday, July 29, 2010

  50. Thursday, July 29, 2010

  51. Thursday, July 29, 2010

  52. Thursday, July 29, 2010

  53. Thursday, July 29, 2010

  54. Thursday, July 29, 2010

  55. Thursday, July 29, 2010

  56. Thursday, July 29, 2010

  57. Thursday, July 29, 2010

  58. Thursday, July 29, 2010

  59. Thursday, July 29, 2010

  60. Thursday, July 29, 2010

  61. Thursday, July 29, 2010

  62. Thursday, July 29, 2010

  63. Poison An interpretation of Potion github.com/brixen/poison Thursday, July 29, 2010

  64. Potion syntax* * examples from _why’s docs Thursday, July 29, 2010

  65. Potion syntax* * examples from _why’s docs Thursday, July 29, 2010

  66. Potion syntax* * examples from _why’s docs Thursday, July 29, 2010

  67. Potion syntax* * examples from _why’s docs Thursday, July 29, 2010

  68. Potion syntax* * examples from _why’s docs Thursday, July 29, 2010

  69. Potion syntax* * examples from _why’s docs Thursday, July 29, 2010

  70. $ cat test.pn "hello" print Thursday, July 29, 2010

  71. $ bin/poison test.pn Script @statements: \ Statements @statements: \ Expression @expression: \ Value @value: \ String @value: "hello" Message @name: "print" Thursday, July 29, 2010

  72. Some missing parts exceptions method arities variadic methods expression grouping singleton methods class methods Thursday, July 29, 2010

  73. Rubinius rbx compile --help Thursday, July 29, 2010

  74. $ rbx compile -S -e 'a = 1' [:script, [:lasgn, :a, [:lit, 1]]] Thursday, July 29, 2010

  75. $ rbx compile -A -e 'a = 1' Script @name: __script__ @file: "(snippet)" @body: \ LocalVariableAssignment @line: 1 @name: a @variable: nil @value: \ FixnumLiteral @line: 1 @value: 1 Thursday, July 29, 2010

  76. $ rbx compile -B -e 'a = 1' ============= :__script__ ============== Arguments: 0 required, 0 total Locals: 1: a Stack size: 2 Lines to IP: 1: 0-5 0000: meta_push_1 0001: set_local 0 # a 0003: pop 0004: push_true 0005: ret ---------------------------------------- Thursday, July 29, 2010

  77. $ rbx compile -B -e 'def foo(a) a + 1 end; foo 5' ============= :__script__ ============== Arguments: 0 required, 0 total Locals: 0 Stack size: 5 Lines to IP: 1: 0-23 0000: push_rubinius 0001: push_literal :foo 0003: push_literal #<Rubinius::CompiledMethod foo file=(snippet)> 0005: push_scope 0006: push_variables 0007: send_stack :method_visibility, 0 0010: send_stack :add_defn_method, 4 0013: pop 0014: push_self 0015: push_int 5 0017: allow_private 0018: send_stack :foo, 1 0021: pop 0022: push_true 0023: ret ---------------------------------------- ================= :foo ================= Arguments: 1 required, 1 total Locals: 1: a Stack size: 3 Lines to IP: 1: 0-5 0000: push_local 0 # a 0002: meta_push_1 0003: meta_send_op_plus :+ 0005: ret ---------------------------------------- Thursday, July 29, 2010

  78. $ rbx compile -B -N foo -e 'def foo(a) a + 1 end; foo 5' ================= :foo ================= Arguments: 1 required, 1 total Locals: 1: a Stack size: 3 Lines to IP: 1: 0-5 0000: push_local 0 # a 0002: meta_push_1 0003: meta_send_op_plus :+ 0005: ret ---------------------------------------- Thursday, July 29, 2010

  79. Thank you Thursday, July 29, 2010

  80. Image Credits [3] lwn.net/images/conf/ks-jls-09/matz2.jpg [7] www.thadguy.com/wp-content/uploads/2007/07/modal-logic-can-solve-all-problems.png [9] blog.tmcnet.com/blog/tom-keating/images/chow-hound-what-no-gravy.jpg [10] www.toothpastefordinner.com/030910/what-did-you-have-for-breakfast.gif [11] spamusement.com/gfx/17.gif [16] pyeuler.wdfiles.com/local--files/start/functional-programming-joke.png [21] student.biology.arizona.edu/honors2007/group11/monkeysee.jpg Thursday, July 29, 2010

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend