Your SlideShare is downloading. ×
0
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
Why we use mruby with Perl5?
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

Why we use mruby with Perl5?

86

Published on

Kichijoji.pm #4

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
86
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
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

Transcript

  1. 1. Why we use mruby with Perl5? Kichijoji.pm #5 id:karupanerura
  2. 2. Who am I? • id:karupanerura (twitter/github/hatena/etc..) • Perl/Swift/C/Java/JavaScript/etc… • Web/iOS/Android Engineer • Mobile Factory, Inc. • Lead Engineer
  3. 3. mruby
  4. 4. What is mruby? • Lightweight implementation of the Ruby language. • mRuby has a high compatibility with Ruby. • Used for embedded. • Binary size: 766.6[kb] (mruby-1.1.0)
  5. 5. mRuby.pm
  6. 6. What is mRuby.pm? • mruby binding for Perl5. • Using XS • tokuhirom++ • Embed mruby into Perl5. • We can call mruby code from Perl5 code.
  7. 7. mRuby.pm • 0.07 - 2015-06-21 • upgrade mruby to version 1.1.0 • 0.08 - 2015-06-22 • Added high-level API. • Added `funcall` API.
  8. 8. Example: low-level API use mRuby; my $mrb = mRuby::State->new(); my $st = $mrb->parse_string('1 + 2 + 3 + 4 + 5'); my $proc = $mrb->generate_code($st); my $ret = $mrb->run($proc); say $ret; # => 15
  9. 9. Example: high-level API use mRuby; my $mruby = mRuby->new(src => '1 + 2 + 3 + 4 + 5'); my $ret = $mruby->run(); say $ret; # => 15
  10. 10. Example: funcall API use mRuby; my $mruby = mRuby->new(src => q{ def add(l, r) l + r end }); my $ret = $mruby->funcall(add => 1, 2); say $ret; # => 3 my $ret2 = $mruby->funcall(add => 3, 4); say $ret2; # => 7
  11. 11. We get mruby!
  12. 12. But, why?
  13. 13. Why we want to use mruby from Perl5?
  14. 14. We are making a social game • Enviroment: • iOS - Swift • Android - Java • Web (API Server) - Perl
  15. 15. We have MANY logics • Parameter calculate • Score calculate • Battle emulation • etc..
  16. 16. We need to share business logics and configs in ALL ENVIROMENT.
  17. 17. It’s too difficult…
  18. 18. But, we gets mruby!
  19. 19. BEFORE • iOS - Swift • Android - Java • Web (API Server) - Perl
  20. 20. AFTER • iOS - Swift + mruby • Android - Java + (JNI+mruby) • Web (API Server) - Perl + (XS+mruby)
  21. 21. CONCLUSION
  22. 22. CONCLUSION • We can share codes and configs by mruby. • Perl & Swift & Java • Perl5 gets mruby!!
  23. 23. END
  24. 24. Any questions?

×