Re:Meet Crystal language in its birthday. It is compiled and...
by spoiler on Friday September 06, 2013 @11:31PM
(#6343845)
It would be really cool if one could write binary extensions/gems for Ruby with Crystal somewhere down the line... far down the line, probably.
[ Parent
| on HN ]
Re:Meet Crystal language in its birthday. It is compiled and...
by asterite on Saturday September 07, 2013 @02:53PM
(#6346089)
Yes, it's one of our dreams too. Right now you can do:
# In a foo.cr file
fun init_foo = Init_foo : Void
puts "Init foo! :-)"
end
Compiling it: bin/crystal foo.cr -o foo.bundle
Then in Ruby: $ irb
irb(main):001:0> require "./foo"
Init foo! :-)
=> true
But more complex things don't work right now (because of the initial implementation of the GC, which needs to be turned off for this case).So, yes, we are not that far from allow you to write Ruby extensions in Crystal.
We'd also like to write Objective-C code that way, and also Erlang extensions.