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

2,329
-1

Published on

RubyKaigi2009のRejectKaigiで発表した資料.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

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

No notes for slide

拡張ライブラリを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 …
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×