Fork me on GitHub

So I wanna make a desktop app, but I don't really wanna use something java based as wayland support is non-existent. Intellij idea won't work on sway. How difficult would it be to have Clojure somehow interface with GTK?

Joshua Suskalo01:03:02

or if you want a clojure-based wrapper, you could use coffi

Benjamin C03:03:44

Probably too young at this point, but I am looking at for this type of thing.

Benjamin C03:03:22

(It's not using GTK, but it does? (will) support Wayland).


Glfw claims to support wayland. The various libraries that use glfw might be an option: • (my library) For better or worse, it's a very different beast than GTK. There's also the cljs route with something like electron.


The only reason I ask, is because I'm trying to avoid Electron. Neutralino seemed promising, but unfortunately I can't get passed a simple bug within it.


I've also used cljfx, and seesaw with some success, but that was on MacOS. I'm also concerned about wayland support for two reasons. 1. It's what I live in on a daily basis 2. It has great HiDPI and MultiDPI support, unlike X will ever have.


I'm gonna test out these things for sure @U7RJTCH6J.

👍 1

Maybe it's possible to use libpythonclj to interface with GTK or Qt.

Joshua Suskalo14:03:28

oooh, skija seems pretty cool


Maybe Graalvm can help as well, not sure though.


Is there a binary version of .edn? What I'm looking for is more performance and less disk space usage, but keep it schema-free. What are you using for that? As a compromise I thought I'll use .edn but ZIP it before/after, but I guess there is something more high tech than that 🙂


transit and fressian are options

👍 1

nippy has excellent performance & compression

👍 1

Is there some good resource to learn about the new stuff in clojure 1.11 ? I mean something more elaborate than the official release announcement


There was a video recently linked in, I think, #news-and-articles

👍 1

I think I saw some video (maybe the same) in the latest deref

👍 1

I remember there was some -slim jar distribution in which clojure was not directly linked / AOT-ed, but I don't see that on mvn. Tangentially related, is there also a jar that includes the Java sources and how could one discover these alternative jars?

Alex Miller (Clojure team)14:03:52

there is a "slim" classifier out there

Alex Miller (Clojure team)14:03:20

you'd use it with org.clojure/clojure$slim {:mvn/version "1.11.0"} for example


Are classifiers a maven thing? It’s weird that you cannot see these at all on

Alex Miller (Clojure team)14:03:31

classifiers are a maven thing, yes

Alex Miller (Clojure team)14:03:03

classifier artifacts are weird in that they all share the same pom. they were originally intended for "variants" of an artifact (specific to a jdk or architecture) but are also somewhat abused for more metadata like things (source, javadoc)

Alex Miller (Clojure team)14:03:18

I don't think the designers of Maven understood the problem space enough at the time of design and things in this area are complected


Thanks! Ah, so there is a -sources classifier. But would that also contain the compiled classes, or is that an extra dep to pull in?


(I assume the latter, since the dep name makes it a different dep?)

Alex Miller (Clojure team)14:03:21

sources is not intended to be a runnable thing, it's original intent was for providing Java source for Java artifacts

Alex Miller (Clojure team)14:03:00

if I understand what you want, it's the slim classifier, which is intended to be non-AOT Clojure artifact


well, I was looking actually for $sources, since Eric and I are adding Java class navigation to kondo/lsp. So if people would include that extra artifact, they would be able to navigate to the source (rather than decompiling the .class)

Alex Miller (Clojure team)14:03:22

ah, so then you do probably want sources, although I don't recall if that has the Java source in it


oh I see :)

Alex Miller (Clojure team)14:03:20

yeah, sources has clojure and java source in it

🎉 2


$ clojure -M:clj-kondo/dev --lint $(clojure -Spath -Sdeps '{:deps {org.clojure/clojure$sources {:mvn/version "1.11.0"}}}') --config '{:output {:format :edn :analysis {:java-class-definitions true}}}' | jet -f '(fn [out] (take 10 (filter #(str/ends-with? (:uri %) ".java") (:java-class-definitions (:analysis out)))))' --pretty
({:class "clojure.asm.SymbolTable",
  :uri "jar:file:file:/Users/borkdude/.m2/repository/org/clojure/clojure/1.11.0/clojure-1.11.0-sources.jar!/clojure/asm/",
  :filename "/Users/borkdude/.m2/repository/org/clojure/clojure/1.11.0/clojure-1.11.0-sources.jar:clojure/asm/"}
 {:class "clojure.asm.Label",
  :uri "jar:file:file:/Users/borkdude/.m2/repository/org/clojure/clojure/1.11.0/clojure-1.11.0-sources.jar!/clojure/asm/",
  :filename "/Users/borkdude/.m2/repository/org/clojure/clojure/1.11.0/clojure-1.11.0-sources.jar:clojure/asm/"}
 {:class "clojure.asm.Attribute",
  :uri "jar:file:file:/Users/borkdude/.m2/repository/org/clojure/clojure/1.11.0/clojure-1.11.0-sources.jar!/clojure/asm/",
  :filename "/Users/borkdude/.m2/repository/org/clojure/clojure/1.11.0/clojure-1.11.0-sources.jar:clojure/asm/"}
 {:class "clojure.asm.TypePath",

Asko Nōmm16:03:35

Am I imagining it or is flattenv no longer a function in Clojure? I can’t seem to find anything on Google, but I could swear that I’ve used it before.


According to git, it has never been a part of Clojure itself. Maybe you've seen it in some library.

Asko Nōmm16:03:40

Yea could be I suppose. Thanks for checking!

Noah Bogart17:03:25

There’s mapv and filterv. Maybe you've conflated the two?

Asko Nōmm18:03:55

Now that I think about it yeah it could be I’m confusing it to filterv.


What's the best way to read an untrusted edn string with line and column numbers attached as metadata? It appears that both clojure.edn and will track line numbers when given the right kind of input stream, and will use those line numbers in exceptions, but neither attaches them as metadata like clojure.core/read does.


Perhaps will help you here, it's quite configurable so it's likely that you can tweak it to your likings


By default it aggressively attaches metadata to any value that it can


which can also be selectively tweaked


Looks perfect, @U04V15CAJ. Thanks!!


Good to hear! Let me know if you have any questions. This library is used as the parsing library in SCI (babashka, nbb, etc), clerk, etc. and has seen quite a lot of exposure, so it should be fairly battle tested.


Is this possible with case:

(case [:a :b]
  [:a :b] "a b combo"
  [_ :b] "at least b" 
Or does it not work like that?


user=> (let [[x y] [:a :b]] (if (= [x y] [:a :b]) "a b combo" (if (= y :b) "at least b"))) "a b combo" user=> (let [[x y] [:c :b]] (if (= [x y] [:a :b]) "a b combo" (if (= y :b) "at least b"))) "at least b"


@U8WFYMFRU - without using core.match, you could probably get something similar, but a little more verbose, with cond. BUT, you may be interested why exactly this isn't possible with case: the clauses are compiled into a tableswitch on the JVM that provides constant lookup (instead of linear, like cond). That's why they must be literals (need to be known at compile time) and they can't be ambiguous like in your example (because they are not compared at in order - they either exist in the lookup table, or not).


Right, compile time literals. That's how I understood it but wanted to ask to see other options. For practical purposes, I just went with cond as I don't want to add core.match just for one function


OK :) I was surprised the first time I learned how case actually works, so I thought I'd point it out. e.g. prep-hashes does a lot of work to convert Clojure structures into integers that avoid hash-collisions and are densely packed:


Ah cool, thanks for breaking down the implementation, that part I definitely did not know


it does not work like that

potetm19:03:09 is what you’re looking for, I think

Martin Půda19:03:24

(clojure.core.match/match [:a :b]
  [:a :b] "a b combo"
  [_ :b] "at least b")


Good to know, thanks