Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

拡張ライブラリをD言語で作るとリア充

2,713 views

Published on

RubyKaigi2009のRejectKaigiで発表した資料.

Published in: Technology
  • Be the first to comment

拡張ライブラリをD言語で作るとリア充

  1. 1. D RejectKaigi@RubyKaigi2009
  2. 2. • tama (id:repeatedly) • from • • DT LLVM
  3. 3. C by Vincent Isambart Haml/Sass (ry
  4. 4. D • • The Case for D • •C
  5. 5. #!/usr/bin/env dmd -run import std.stdio; void main() { auto arr = array([0,1,2,3,4,5,6,7,8,9]); arr.each!q{ |i| writeln(i+5); }; } ... from D
  6. 6. % ./foo.d
  7. 7. Rudy •D • Euruku 2009 • PyD • http://github.com/tomash/rudy/tree/master/
  8. 8. • import bcd.ruby, rudy.rudy; • d_type : Ruby D • to_ruby_value :D Ruby • def : Ruby • RudyObject : VALUE
  9. 9. extern (C) VALUE foo(VALUE self, VALUE obj) { bool b = d_type!(bool)(obj); return to_ruby_value(b); } TestModule = rb_define_module("TestModule"); rb_define_module_function(TestModule, "foo", &foo, 0); def!("TestClass", test);
  10. 10. Demo Web (´ ω `)
  11. 11. ToDo • gdc + Ruby 1.8 • dmd Ruby 1.9 • • GC
  12. 12. Ruby @ Shikoku.rb Ruby 01 …

×