Fork me on GitHub
#yamlscript
<
2023-08-22
>
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 libyamlscript.so shared library, that in turn will be bound as module to python and shipped to PyPI as yamlscript.py (a yaml loader to load dynamic (scripted with ys clojure)). The ported code is here: https://github.com/yaml/yamlscript/tree/clojure/clojure I'm looking for advice on using graalvm and also bundling sci...

borkdude16:08:17

> I'm looking for advice on using graalvm and also bundling sci. For a general impression of GraalVM + Clojure you can look here: https://github.com/clj-easy/graal-docs For using SCI + GraalVM: This is a simple example: https://github.com/borkdude/jayfu

borkdude16:08:43

but you can also look at https://github.com/borkdude/jet which is a pretty simple project that uses SCI + GraalVM

borkdude16:08:08

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.

hifumi12320:08:47

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

hifumi12320:08:03

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

hifumi12320:08:55

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

hifumi12320:08:06

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)