Rubinius X

A8e44ce1b57c2689d5a7172d15df42b5?s=47 brixen
September 04, 2014

Rubinius X

Presented at WindyCityRails 2014

A8e44ce1b57c2689d5a7172d15df42b5?s=128

brixen

September 04, 2014
Tweet

Transcript

  1. Rubinius X @brixen

  2. Good morning!

  3. None
  4. None
  5. None
  6. None
  7. None
  8. "You can't have your cake and eat it, too"

  9. Professional possibility finders

  10. improveffect.com

  11. Yes, and...

  12. We <3 Ruby

  13. None
  14. None
  15. I'd rather be...

  16. None
  17. What is the biggest risk to Ruby?

  18. Ruby is stuck in the past

  19. Why isn't Ruby the right tool?

  20. Rubinius is Ruby

  21. Rubinius is Ruby ~2.1 and 1.8.7

  22. Rubinius X is Ruby 10

  23. Ruby 2.1 is really

  24. Ruby 2.1 is really, really

  25. Ruby 2.1 is really, really, really

  26. Ruby 2.1 is really, really, really, really

  27. Ruby 2.1 is really, really, really, really legacy Ruby

  28. Rubinius X is Rubinius

  29. Network 1

  30. Network 1 Performance 2

  31. Network 1 Performance 2 Experience 3

  32. Network 1 Performance 2 Experience 3 Context 4

  33. Network 1 Socket • Concurrency • String

  34. None
  35. None
  36. None
  37. None
  38. None
  39. None
  40. None
  41. ! require "socket"!

  42. None
  43. bit.ly/RubyHTTPClients

  44. Go Node.js Elixir

  45. Can we have networks?

  46. Yes, and we can have one that just works

  47. Rubinius has no global interpreter lock

  48. Threads are fine

  49. Locks are the problem

  50. Shared mutable state

  51. HAMT Hash Array Mapped Trie

  52. HAMT ReTrieval

  53. 1 2 3 #hash value 12

  54. 1 ... 3 #hash value 14 4 5

  55. Can we have simple data structures?

  56. Yes, and we can have useful concurrent ones

  57. String and Symbol

  58. ! irb> obj.method "to_s"! => #<Method: Object(Kernel)#to_s>!

  59. ! irb> obj.method :to_s! => #<Method: Object(Kernel)#to_s>!

  60. irb> "to_s" == :to_s ! => false

  61. irb> :to_s == "to_s"! => false

  62. None
  63. HashWithIndifferentAccess

  64. Erb • HAML • Slim • Moustache

  65. JSON • YAML • XML/HTML

  66. Strings are immutable

  67. HashWithIndifferentAccess

  68. Hash

  69. Performance 2

  70. Fences make good neighbors

  71. Fences make poor friends

  72. Compilation is usually lossy

  73. def add(a, b)! c = a + b! end

  74. push_local 0! # a! push_local 1 ! # b! send

    :+, 1! set_local 2! ! # c
  75. add r1, r2, r3! # ^a ^b ^c! set_local r3,

    2
  76. Can we have stack bytecode?

  77. Yes, and we can have register bytecode

  78. assert_gte r1, r2, 0! add r1, r2, r3! # ^a

    ^b ^c! set_local r3, 2
  79. and we can have assertion bytecode

  80. record r1, r2! add r1, r2, r3! # ^a ^b

    ^c! set_local r3, 2
  81. and we can have instrumentation bytecode

  82. PEG

  83. LPEG

  84. and we can have parser bytecode

  85. and we can have system bytecode

  86. Experience 3

  87. Run coverage in production

  88. Smalltalk

  89. def add(a, b)! a + b! end

  90. Can we have file system support?

  91. Yes, and we can have a dynamic code database

  92. Rubinius::Console

  93. Context 4

  94. ! puts "Hello, Chicago!"!

  95. ! "Hello, Chicago!".puts!

  96. module Kernel! def puts(*args)! # ...! end! ! module_function :puts!

    end
  97. ! puts "Hello, Chicago!"!

  98. fun puts(*args)! # ...! end

  99. module Kernel! def puts(*args)! # ...! end! ! module_function :puts!

    end
  100. fun puts(*args)! # ...! end

  101. Can we have objects?

  102. Yes, and we can have functions

  103. destroyallsoftware.com

  104. None
  105. fun add(a, b)! a + b! end

  106. fun add(a: int, b: int)! a + b! end

  107. load_int 0, r1! load_int 1, r2! add r1, r2, r3!

    # ^a ^b ^c! store_int r3, 2
  108. Can we have dynamic types?

  109. Yes, and we can have static types

  110. (gradually)

  111. Clay vs concrete

  112. CLIs

  113. parsers JSON • YAML • XML/HTML

  114. HTTP parsers

  115. Garbage collectors

  116. Rubinius X is Rubinius

  117. Rubinius X

  118. Rubinius X 2.1

  119. Source-to-source compiler

  120. Try Rubinius github.com/rubinius/rubinius

  121. # Gemfile! platforms :mri do! gem "ruby-debug"! end!

  122. $ bundle update

  123. $ bundle exec puma

  124. @brixen

  125. Thank you!

  126. • http://scienceblogs.com/startswithabang/2011/11/18/the-new-opera- faster-than-ligh/ • http://www.todayinsci.com/Books/MechApp/chap23/page36.htm • http://www.urgentevoke.com/profiles/blogs/a-new-ecosystem-of- information • https://www.destroyallsoftware.com/talks/boundaries

    • http://www.cleanposts.com/index.php/Win311file • https://bit.ly/RubyHTTPClients • http://www.amusingplanet.com/2009/03/impossible-illusions-made- possible.html Credits