Your SlideShare is downloading. ×
Mirah Talk for Boulder Ruby Group
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Mirah Talk for Boulder Ruby Group

1,027
views

Published on

In which I talk about what Mirah is and some of it's fine features.

In which I talk about what Mirah is and some of it's fine features.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,027
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. Mirah
    • 2. What’s Mirah?
    • 3. It’s a small, fast,JVM language that uses Ruby syntax.
    • 4. How’d it come about?
    • 5. Charles Oliver Nutter, JRuby guy
    • 6. Wanted to writeJava code in Ruby
    • 7. Wanted to writeJava code in Ruby
    • 8. Wanted to write Javacode in a language as expressive as Ruby.
    • 9. Expressive as Ruby?
    • 10. http://www.flickr.com/photos/caroslines/513429518/
    • 11. Syntactic Sugar• Optional Arguments• Internal Iteration(each, map, etc)• Closures• Literals• String Interpretation
    • 12. Mirahs got the sugar.
    • 13. How Mirah Differs from Ruby
    • 14. 1. It’s statically typed and compiled
    • 15. Basically,No RuntimeObject/ClassModification
    • 16. 2. It uses Java’s type system
    • 17. It has slightly differentsemantics than Rubys
    • 18. e.g.,Mirah has interfaces
    • 19. So, what’s it look like?
    • 20. FibonacciExample
    • 21. Rubydef fib(a)  if a < 2    a  else    fib(a - 1) + fib(a - 2)  endend
    • 22. Mirahgithub.com/mirah/mirah/examples/fib.mirahdef fib(a:int):int  if a < 2    a  else    fib(a - 1) + fib(a - 2)  endend
    • 23. See what I did there?
    • 24. def fib(a:int):int
    • 25. def fib(a:int):int
    • 26. Ruby Syntax+ Java Types- Runtime Modification
    • 27. Other Super Powers
    • 28. Type Inference & Macros
    • 29. Type Inference?
    • 30. Javaclass Foo { private int bar; Foo() { bar = 1; } public int bar() { return bar; }}
    • 31. Rubyclass Foo def initialize @bar = 1 end def bar @bar endend
    • 32. Mirahclass Foo def initialize @bar = 1 end def bar @bar endend
    • 33. @bar is inferred to be an Integer
    • 34. Mirahclass Foo def initialize @bar = 1 end def bar @bar endend
    • 35. Javaclass Foo { private int bar; Foo() { bar = 1; } public int bar() { return bar; }}
    • 36. Mirah Java// Generated from foo.mirahpublic class Foo extends java.lang.Object private int bar; public Foo() { this.bar = 1; } public int bar() { return this.bar; }}
    • 37. Ruby Syntax+ Java Types- Runtime Modification+ Type Inference
    • 38. Macros
    • 39. For Convenience & Awesomeness.
    • 40. Used by the compiler
    • 41. For example,
    • 42. puts =>System.out.println();
    • 43. Macros:How each, map, ==, etc are implemented
    • 44. Macro Basics
    • 45. say you have code like:logger.debug( "this #{takes_too_much_time}")
    • 46. runtakes_too_much_time in production?
    • 47. No,it takes too much time.
    • 48. Macros to the rescue
    • 49. macro def debug debug_input quote do if logger.debugEnabled logger.debug `debug_input` end endend
    • 50. macro def debug debug_input quote do if logger.debugEnabled logger.debug `debug_input` end endend
    • 51. macro def debug debug_input quote do if logger.debugEnabled logger.debug `debug_input` end endend
    • 52. macro def debug debug_input quote do if logger.debugEnabled logger.debug `debug_input` end endend
    • 53. macro def debug debug_input quote do if logger.debugEnabled logger.debug `debug_input` end endend
    • 54. debug( "this #{takes_too_much_time}")
    • 55. if logger.debugEnabled logger.debug("this #takes_too_much_time}" )end
    • 56. debug( "this #{takes_too_much_time}")
    • 57. So, Macros are nifty
    • 58. Ruby Syntax+ Java Types- Runtime Modification+ Type Inference+ Macros
    • 59. Oh, theres another thing.
    • 60. No Runtime Library
    • 61. You can do this:$ mirahc -e "puts hello BRG"$ java -classpath . DashE.class
    • 62. No Runtime ==Small compiled footprint
    • 63. Small Footprint ==good for mobile
    • 64. For example, see Pindah
    • 65. Ruby Syntax+ Java Types- Runtime Modification+ Type Inference+ Macros- Runtime Library
    • 66. Get Started$ rvm jruby$ gem install mirah$ mirah -e "puts hello world
    • 67. Mirah projects to check out: • Dubious - Rails-like web framework for Google App Engine • Pindah - Android App framework
    • 68. Im Nick@baroquebobcat
    • 69. I work at
    • 70. Were Hiring.gnip.com/jobs
    • 71. A couple links mirah.orggithub.com/mirah
    • 72. Questions?

    ×