Re:The Crystal Programming Language
by stewbrew on Monday December 19, 2016 @07:41AM
(#13211029)
Can I create a shared library with it? Can it be used to write a ruby extension?
[ Parent
| on HN ]
The answer is technically yes but you probably don't want to. Crystal comes with a managed runtime and gc, which are particularly unsuited for use in a shared library. However you can export c functions (it's a hidden feature) and they do work.
Creating a ruby extension in crystal also works and there are a number of libraries which attempt to allow you to do this (too many in fact). They do the hard work of getting crystal to play nice with the ruby extension api for you.
Re:The Crystal Programming Language
by spalladino2 on Monday December 19, 2016 @09:42AM
(#13211647)
See https://gist.github.com/spalladino/10c829db3191a89a8ba73bb00...
We'll probably build it into a more stable shard eventually, but at least we know it's doable