Skip to content

Instantly share code, notes, and snippets.

@yogthos
Created August 27, 2017 07:39
Show Gist options
  • Save yogthos/cf4bdb31d9188656bd9c0aa94c103902 to your computer and use it in GitHub Desktop.
Save yogthos/cf4bdb31d9188656bd9c0aa94c103902 to your computer and use it in GitHub Desktop.
ClojureScript Planck FFI example
(ns ffi.core
(:require
[planck.c-linkage.alpha
:refer [dlopn dlsym]]))
(def libnative (dlopen "libnative.so"))
(def funky (dlsym libnative "funky"))
(println (funky 3.2))
#include <math.h>
double funky(double x) {
return sinh(1.0 / tgamma(x));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment