Fork me on GitHub
#graalvm
<
2020-03-11
>
borkdude16:03:34

compiled the Small Clojure Interpreter as a shared lib (.so, .dylib) and called it from c++! https://twitter.com/borkdude/status/1237774773813481474

👏 28
aw_yeah 24
jeroenvandijk17:03:36

For those interested I’m using this code to do AWS requests in Graal https://github.com/adgoji/aws-api/blob/master/src/adgoji/cognitect/aws/signers.cljc#L150 It needs some examples, but if you really want to this could be a start. I’ve also used it from Clojurescript (not tested lately). It has been tested with AWS STS requests (more to come)

sogaiu23:03:00

works on linux too :thumbsup: (with tweaks as described in the write-up)

sogaiu23:03:28

$ time ./libsci/target/from_cpp "
> (println :foo)
> (require '[cheshire.core :as cheshire])
> (cheshire/generate-string {:a 1})"
:foo
{"a":1}

real	0m0.018s
user	0m0.004s
sys	0m0.014s