Fork me on GitHub
Ingy döt Net16:08:43

I've minimally ported YAMLScript to Clojure enough to try to take it to the next step of using GraalVM to compile it (combined with SCI) into a shared library, that in turn will be bound as module to python and shipped to PyPI as (a yaml loader to load dynamic (scripted with ys clojure)). The ported code is here: I'm looking for advice on using graalvm and also bundling sci...


> I'm looking for advice on using graalvm and also bundling sci. For a general impression of GraalVM + Clojure you can look here: For using SCI + GraalVM: This is a simple example:


but you can also look at which is a pretty simple project that uses SCI + GraalVM


There's #C015LCR9MHD and #CAJN79WNT channels too

Ingy döt Net16:08:52

(I'm in those channels too)

Ingy döt Net17:08:51

Is there a preferred FFI library for clojure. I want to swap out the snakeyaml usage for libfyaml. The result would need to work with graalvm.


I have used SWIG before, and it is annoying to use except for C/C++ libraries with a small API


In general, you are stuck with JNI until Java 21 releases, which in case you can use #C02EEAUHSJJ


note that the moment you use native libraries in clojure it becomes annoying to even just make an uberjar, since you would have to bundle a shared library for every [os architecture] tuple you intend to support


e.g. using sqlite jdbc driver in clojure already bloats a jar by some 20 MB because of all the ways [windows mac linux freebsd solaris] and [x86 amd64 arm32 arm64 ppc ppc64 s390x mips ...] can mix together. you can cleverly exclude some of these libraries from your uberjar (but know it comes at the cost of dropping support for some platform out there)