Fork me on GitHub
#announcements
<
2023-05-25
>
quoll03:05:23

https://github.com/quoll/tiara: A tiny library for data structures. This first public release contains ordered maps and ordered sets. This are immutable hashmaps and hashsets that record the insertion order, similarly to Java’s LinkedHashMap and LinkedHashSet.

👑 52
🎉 28
👏 14
tomd05:05:25

How do these differ from those implemented here: https://github.com/clj-commons/ordered and here: https://github.com/frankiesardo/linked ?

2
quoll14:05:51

There are 2 parts to my answer. First, I was pretty sure that such functionality already existed, but given the scope of this project (very small!) I saw no harm in reimplementing this functionality. I learned something, which was my intent. When I was done, I figured it couldn’t hurt to put it out in the public domain. Also, I’m not great at finding other people’s projects, but I knew I could have just asked. Second, I’ll address the technical differences. “Linked” implements both cljs and clj. I want to get to a cljs for Tiara, because it’s just rude when you find something useful only to learn that it won’t work on ClojureScript. Also: • Tiara uses ⅓ of the MapEntry objects that Linked uses. • Linked has O(1) removals (`dissoc` for maps and disj for sets). Tiara has O(n) removals. • Linked has sparse data after multiple removals, and has introduced an extra compact operation to repack the data. This is a single O(n) operation that makes up for Tiara’s O(n) removals. Tiara is always compact. There are fewer steps in the most common Tiara operations (`assoc` and get), so they may be a little quicker, though I will need to use Criterium to check. However, Tiara is using a proxy which could be slower. I could have used records or a proxy, but decided to try proxies, because I hadn’t ever made anything larger with a proxy before. If proxies turn out to be slower (I suspect they are), then I should change it back to a record, which is what I usually use anyway. Most of the code won’t change.

tomd01:05:49

@U051N6TTC that's an excellent answer, thank you. If you'd like to add any of that to Tiara's readme, I'm sure many would appreciate it. I love libs that explain how they compare to similar. 🙏

quoll01:05:14

Thanks for the comment. 🙂 I will consider a copy/paste when I’m back on the project again (I am working on SO MANY other things right now)

quoll03:05:54

Just looking now…

quoll04:05:52

I ran a simple criterium test, inserting 10000 key/values (number to number), then looking up all the keys to add the values. (into (l/map) (map (fn [n] [n n]) (range 10000)) Then I reduced over the range to lookup and add the value. Tiara right now takes nearly 5 times as long. So I tried changing out the proxy for a deftype. It took a little work, but the functions were basically the same. Now it’s more than twice as fast! Lesson learned… don’t use proxies 😄

quoll04:05:21

I’ve only updated the map for now, but I’ll do the set as well and push a new release

🎉 2
xificurC07:05:04

https://github.com/redplanetlabs/proxy-plus has some explanation why clojure's proxy is slow

quoll13:05:37

I recall something about it from a long time back, but thought it would be an interesting exercise to use it, given that I don’t think I’ve touched it in 10 years.

quoll13:05:12

One nice feature is that it lets you inherit from an abstract class, which deftype won’t allow. AbstractSet does almost everything for you, which is means that an proxy or genclass approach is only a few lines

sansarip13:05:30

🎉 🦉 🐻 First official release of https://marketplace.visualstudio.com/items?itemName=sansarip.owlbear, a VS Code extension to support paredit-like structural editing for HTML, TSX, TS, JSX, JS -largely built with ClojureScript!

🙌 50
2
👍 8
parens 14
2
💡 2
2
🎉 2
sansarip13:05:34

Unfortunately, two of my previous jobs moved away from ClojureScript to TypeScript, and I don’t even work with CLJS at my current job anymore 😢 Anyway, I was getting really tired of wrangling HTML and JSX tags, so I thought I’d do my best to port over some paredit goodness. Owlbear doesn’t provide any sort of integrated REPL experience, but I hope the extension at least alleviates some of the pain of working in mainstream web development. I haven’t advertised Owlbear to the greater web dev community yet, but my pie-in-the-sky goal with this extension/experiment is to hopefully bring more folks onboard to this style of editing. I’m not aiming for Owlbear to be the perfect implementation of paredit outside of LISPs, but rather just helpful enough to inspire folks to build similar tooling for other languages/editors (or an even better extension for the same languages haha). VS Code has a pretty massive community of JS web devs, which is why I’m focusing on that editor first. This extension was heavily inspired by Calva :heart_hands:

sansarip13:05:05

Ah darn, rookie mistake, should’ve tested Owlbear on other OS’s/architectures facepalm sorry folks, gonna have to cook up some fixes later.

Tomas Brejla14:05:18

Don't worry. Judging from the videos, It's looking great. Looking forward to test working linux version 🤞 Btw does the extension kick in also on .json files? (extension description mentions HTML, TypeScript, TypeScript-React, JavaScript, and JavaScript-React , not sure if that includes json

pez14:05:10

Taking this for a spin R I G H T N O W ! Been needing it for so long.

clojure-spin 2
❤️ 2
truestory 2
sansarip14:05:30

@U01LFP3LA6P JSON is not officially supported; have to think through what that would look like a bit -def doable! For the time being, you may have limited success by changing the language mode in a JSON file to JavaScript (`cmd+shift+p` then search Change Language Mode).

🤞 2
flowthing16:05:33

https://github.com/eerohele/pipehat 1.0.0: a (zero-dependency) Clojure library for reading and writing HL7v2 messages encoded using vertical bar encoding.

👀 8
👍 12
🎉 2
dharrigan18:05:19

That is pretty apt since I work with hl7 messages too!

flowthing05:05:17

Cool! Happy to hear any feedback you might have if you decide to give it a spin. 🙂

nnichols23:05:02

The https://github.com/nnichols/clojure-dependency-update-action is now released at https://github.com/nnichols/clojure-dependency-update-action/releases/tag/v5. The largest user facing change were some improvements to log grouping that should make diagnosing temporal/artifact-specific errors easier. With that said, https://github.com/renovatebot/renovates clojure support is really solid at this point- and I've begun transitioning my personal projects, and the projects in the Wall Brew org, to use the Renovate GitHub App. I will keep the lights on for this action, but as I won't be using it day-to-day, new features are unlikely. Also, https://github.com/nnichols/clojure-dependency-update-action: The https://github.com/nnichols/leiningen-dependency-update-action is now fully deprecated and archived. I was unable to find any active repositories which had not already transitioned to the clojure- action or another tool. For posterity, the clojure- action works on all major clojure dependency management tools.

🎉 6