Fork me on GitHub
#announcements
<
2024-04-13
>
eunmin08:04:44

Hello, I’ve created a library to make https://milvus.io/, a popular vector database, easier to use in clojure. Although it’s a wrapper around the Milvus Java SDK, it should be easy to use from clojure. It doesn’t support all of Milvus’ APIs yet, but I’ve created all the important ones. https://github.com/constacts/milvus-clj

clojure 12
🎉 6
Jared Michael Dobson17:04:42

I saw an alternative to milvus on that's an open source vectordb extension for postgres and just thought i post it here for fun: https://lantern.dev/

👍 1
stefanvstein13:04:49

Hello all. A small tool, brand new Avoid the hassle of restructuring comments into functions. Testify turns selected comments into automatically evaluated scripts, while remaining as comments embedded within the code. Evaluate these comments directly from within a test, or in any other way preferred. Rename the (comment) to (test-comment) and evaluate with (eval-in-ns 'your-namespace). Testify will find the test-comment and evaluate its content for you. The test-comment is an empty macro ignoring its body, just like comment, that Testify recognizes. Testify can easily be told to evaluate content of any other top level form, while test-comment is a default. Testify use levels of isolation. While eval-in-ns evaluates expressions in its namespace, like when evaluating comments manually, its sibling eval-as-use evaluates from within a temporary namespace, preventing pollution. This is more suitable for repeatable tests. Testify reads source code, and keeps track of where it is. Code should be highlighted when a test assertion fails, even though the assertion is in a comment. Testify is not a testing framework, but rather a pun on: to witness, reveal comment, display it in the REPL. https://github.com/stefanvstein/testify

🎉 6
chromalchemy17:04:12

Can you use this an RCF at the same time?

stefanvstein18:04:00

Haven't tried, but e.g. (eval-as-use 'your.ns #'hyperfiddle.rcf/tests), would probably work. rcf/tests is special though, so the other way will probably not work. Let me know :-)

stefanvstein18:04:14

As I understand. RCF tests, is a macro that changes behavior depending on state. Testify can evaluate content of any top level form. It's just a preferable choice to evaluate content of a empty macro like e.g. comment, or the default test-comment. Testify reads and evaluates the source code, and RCF tests looks like a comment. My guess is that RCF only knows how to deal with the special tests macro.

👍 1
genekim18:04:43

So clever! I can’t wait to try this — I often write tests below functions, but often out of laziness of not wanting to create another test namespace, copy over the function names, deal with having to re-namespace the functions, I just don’t bother. But I always think, “someday, I’ll do it.” I’ll let you know how it goes, and thank you for publishing it! I feel like you wrote it while reading my mind for the past 5 years!

👍 1
genekim18:04:58

PS: I read about this in the latest Clojure Deref newsletter. TY @U064X3EF3 and @U7ZSXG630!

stefanvstein18:04:48

Oh wow, Thank you. Nice words. Yes, I had the same problem. It's easy to forget tests when you go repl driven. But then regression shows up. Also, I find it easier to write larger tests, when the code is structured as a repl session. I'm eager to hear your thoughts. Cool. You found it for me. Thank you @U6VPZS1EK

genekim16:04:47

@U0D1EU0EL Tried it briefly yesterday and retrofitted some of my “rich comment blocks”— it seems to be working, but I did get sidetracked when I realized that Cursive (maybe erroneously) shows that it can’t resolve the var/function. But oddly, enough, the test-comment shows up as not resolvable, but the eval-in-ns is. Not sure whether this is a Cursive issue, or a testify issue, but wanted to note it while it was fresh in my mind. Is there a good place to continue this discussion? Maybe creating a new channel? PS: my next steps are to is the is macro to string together some of the tests I find, and get them running inside of testify. I think this would be so useful!

genekim16:04:43

Agh. Skitch crashing when I try to annotate. 1) top arrow: not resolving in Cursive. 2) resolving and can be evaluated in the Cursive REPL.

stefanvstein07:04:08

Morning @U6VPZS1EK. That's odd. test-comment is just an empty macro. What happens if you create yet another empty macro in yet another namespace. Will cursive accept that? Like (defmacro unit-test [& _])

stefanvstein16:04:39

Created a channel #C06VCQBQ19Q

genekim20:04:03

See you there! Thanks!!

ilmo21:04:41

New version of https://github.com/metosin/oksa, a library for generating GraphQL queries using Clojure data structures. Version https://github.com/metosin/oksa/blob/main/CHANGELOG.md#010 introduces a programmatic API (still in alpha, but aim to keep it stable) and some fixes. Channel: #oksa

🙌 9
🎉 2
ambrosebs21:04:38

Announcing https://github.com/frenchy64/fully-satisfies 1.10.4. This release has a lot of goodies and ideas and I'm curious to see how they land. https://github.com/frenchy64/fully-satisfies?tab=readme-ov-file#dependencyhttps://frenchy64.github.io/fully-satisfies/latest/io.github.frenchy64.fully-satisfies.leaky-seq-detection.html for detecting memory leaks caused by holding onto the head of sequences. An https://github.com/frenchy64/fully-satisfies/blob/main/test/io/github/frenchy64/fully_satisfies/leaky_seq_detection_test.clj is provided exposing issues with clojure.core functions and verifying fixes to them. • https://frenchy64.github.io/fully-satisfies/latest/io.github.frenchy64.fully-satisfies.safer.html variants of clojure.core functions that improve thread-safety and general robustness when passed mutating collections (e.g., eductions). Includes: butlast, drop-last, every?, last, not-every?, nthrest, partitionv-all, sort, sort-by, split-at, split-with, splitv-at, take-last. Includes a https://github.com/frenchy64/fully-satisfies/blob/main/test/io/github/frenchy64/fully_satisfies/safer_test.clj demonstrating the differences and improvements. • https://frenchy64.github.io/fully-satisfies/latest/io.github.frenchy64.fully-satisfies.lazier.html variants of clojure.core functions that are slightly lazier when processing and/or returning lazy seqs. Includes: bounded-count, cycle, dedupe, iterator-seq, sequence. Includes a https://github.com/frenchy64/fully-satisfies/blob/main/test/io/github/frenchy64/fully_satisfies/lazier_test.clj demonstrating the differences and improvements. • https://frenchy64.github.io/fully-satisfies/latest/io.github.frenchy64.fully-satisfies.uniform.html variants of clojure.core functions such that they work consistently for all values. Includes: dedupe, halt-when, partition-by. Includes a https://github.com/frenchy64/fully-satisfies/blob/main/test/io/github/frenchy64/fully_satisfies/uniform_test.clj demonstrating the differences and improvements. • https://frenchy64.github.io/fully-satisfies/latest/io.github.frenchy64.fully-satisfies.head-releasing.html variants of clojure.core functions that release the head of seqs earlier have thus have improved memory usage characteristics. Includes: every?, keep, keep-indexed, map, map-indexed, mapcat, naive-seq-reduce, not-any?, not-every?, some. Includes a https://github.com/frenchy64/fully-satisfies/blob/main/test/io/github/frenchy64/fully_satisfies/leaky_seq_detection_test.clj demonstrating the differences and improvements, using the https://frenchy64.github.io/fully-satisfies/latest/io.github.frenchy64.fully-satisfies.leaky-seq-detection.html. Thanks to @nbtheduke for collaborating on the new variants and encouraging me to document the leaky-seq detection framework via his questions. Thanks to @mpoffald for the catchier name for the testing framework.

🎉 25
❤️ 4
😲 1
Noah Bogart21:04:01

hey Ambrose, this sounds cool. what exactly is fully-satisfies? 😇

ambrosebs21:04:28

It's both a utility library and a (temporary?) home for some the jira patches I've proposed to Clojure that you can use today without building your own Clojure. 😉

👍 7
🆒 4
1