Demonstrates how to link Rust code in Crystal (on MacOS).
See the Makefile; the Rust crate is built as a dylib
, and the Crystal code
then uses the linked library. Fairly simple.
Following both Rust and Crystal conventions, lib.rs
and foo.cr
need to be in a
src/
directory; everything else is in the root.