I figured maybe someone on the list here might find this interesting, though crystalshards should pick it up.
http://github.com/bmmcginty/crjsc
links Crystal with the JavaScriptCore library used by WebKit (Safari) to connect Crystal and Javascript.
You can write code that accesses Crystal classes and functions, and that code can call out to Javascript as well.
The functions on the crystal side do have to be written in a certain way, unpacking a single array of arguments, but everything else should be pretty transparent.
If anyone finds a use(s) for this, I'd love to hear about it.
I'm going to try and work on a shim to give js access to a node like environment provided by Crystal.
That way, existing npm packages can be run and accessed from Crystal.
Thanks to @bcardiff and the creator of
duktape.cr (Jesse Doyle) for inspirations and pointers to code, and to everyone on the IRC channel and this list for assistance and ideas.
Crystal and it's community are awesome.
(As a side note, I know the language has hooked me permanently. I've started trying to type crystal while working on python projects.)
Thanks,
Brandon McGinty-Carroll