This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-06
Channels
- # aleph (43)
- # announcements (11)
- # babashka (35)
- # beginners (70)
- # calva (4)
- # cider (8)
- # clerk (15)
- # clojure (192)
- # clojure-dev (7)
- # clojure-europe (44)
- # clojure-nl (2)
- # clojure-norway (65)
- # clojure-uk (4)
- # code-reviews (4)
- # conjure (1)
- # cursive (41)
- # data-science (1)
- # datomic (8)
- # emacs (7)
- # fulcro (13)
- # humbleui (17)
- # hyperfiddle (53)
- # kaocha (4)
- # malli (7)
- # missionary (17)
- # music (1)
- # obb (1)
- # off-topic (8)
- # polylith (1)
- # portal (3)
- # releases (11)
- # shadow-cljs (36)
- # squint (4)
- # tools-deps (4)
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/
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)
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
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).
very true... it was just a thought I had, nothing more. and great work on your library. 👍
there are crates to call rust libs from java - https://docs.rs/jni/latest/jni/ it is totaly possible to use from clojure
here's an example of rust jni crate with clojure https://github.com/borkdude/clojure-rust-graalvm
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.
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.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.