Fork me on GitHub
#announcements
<
2024-02-06
>
blueberry12:02:29

New library release: Clojure C++ , Clojure's gateway to interop with native libraries through JavaCPP and its vast collection of integrations with popular native libraries. https://uncomplicate.org/clojure-cpp/

🍹 24
🚀 2
gratitude-thank-you 1
thomas13:02:10

looks very good and just thinking out loud... wouldn't it be cool if you could use Rust from JVM languages? How would that even look like? Is it even remotely possible? (I don't know TBH)

blueberry13:02:50

I really don't know. I have no experience with Rust...

thomas13:02:34

I used it a bit last year. you have a borrow checker that makes sure that there are no leaks. but no idea what it really doies

blueberry13:02:13

Anyway, the point of Clojure-CPP is to access a vast ecosystem of unavoidable native mega-libraries (such as MKL or CUDA) when writing your own alternative is either not possible or not very viable. I'm not sure how many such Rust libraries are available (and needed from Clojure).

thomas13:02:28

very true... it was just a thought I had, nothing more. and great work on your library. 👍

🎸 1
delaguardo13:02:53

there are crates to call rust libs from java - https://docs.rs/jni/latest/jni/ it is totaly possible to use from clojure

👍 1
borkdude15:02:58

here's an example of rust jni crate with clojure https://github.com/borkdude/clojure-rust-graalvm

phronmophobic18:02:45

If you're just trying to wrap a shared library (built with c, c++, or rust), then IMO https://github.com/phronmophobic/clong is very effective. The cool thing about javacpp is that it handles one of the more annoying parts about working with native libraries which is building and distributing them as maven artifacts.

phronmophobic18:02:25

As long as the native library satisfies the c ABI, you can usually get up and running with:

(def libz
  (com.sun.jna.NativeLibrary/getInstance "z"))

(def api (clong/easy-api "/opt/local/include/zlib.h"))

(gen/def-api libz api)

(zlibVersion) ;; "1.2.11"
You will have to understand and handle memory management.

tony.kay20:02:09

Major new Release of Guardrails Version 1.2.0-2 https://github.com/fulcrologic/guardrails in collaboration with, and special thanks to, @clojurians.net: • Full support for Malli schemas (on par with clojure.spec) • Substantial performance improvements with runtime check throttling and granular namespace/function exclusions for internal application and library code, including the ability for library authors to declare default exclusions for non-public-facing namespaces • Full support for checking such-that predicates on the return value with the ability to reference any input argument in both clojure.spec and Malli • Automatic Malli (m/=>) function schema generation for use with native or third-party tooling • Improvements to output: compressed stacks (optional), GR traces, and more compact messages (opt-in) Guardrails now implements all of clojure.spec, Orchestra and Malli’s combined function call validation functionality, including a number of unique features and a minimal, adjustable runtime performance impact during development. Thanks also go to @ikitommi for looking over the malli implementation for potential improvements and submitting a patch for the registry.

gratitude 2
🤯 1
👀 3
💂‍♂️ 1
clojure-spin 16
💯 18
metal 3
❤️ 1
fulcro 5
🎉 10
🛣️ 1
malli 3