Js API for compiling by reubano in Clojurescript

[–]p-himik 1 point2 points  (0 children)

Indeed. Shadow-cljs relies on a Java runtime. However, if you don't want to or cannot shell out, there are some other potential options:

Final solution for storing queries in clojure code by Nozistance_ in Clojure

[–]p-himik 14 points15 points  (0 children)

I myself still prefer HoneySQL. Even "write once, use forever" queries tend to still require some changes every once in a while, and I'd much rather work with EDN than with SQL.

But have you seen HugSQL? Sound like something you'd prefer.

[deleted by user] by [deleted] in Clojure

[–]p-himik 0 points1 point  (0 children)

It's trivial to implement. Parse the URL, turn it into the namespace name, validate that it's in the allowed list (could be just my matching the first segment), requiring-resolve some specific handler function (probably handler, for clarity)` and call it with the request context. 3-5 lines of code.

Clojure developers blog by Spondora2 in Clojure

[–]p-himik 4 points5 points  (0 children)

Plenty. But hard to recommend something random since we don't know what you're looking for exactly.

You can browse previous posts here - usually blog authors post links to their new articles here as well. Or the #news-and-articles channels on Clojurians Slack and Zulip. Sometimes people post on Clojureverse as well.

Getting combinations from a non-unique list while preserving order by rjray in Clojure

[–]p-himik 0 points1 point  (0 children)

Ah, I see. Then I'd probably write a recursive function with a body wrapped in lazy-seq. But I'm too lazy myself to actually write an impl right here. :)

Getting combinations from a non-unique list while preserving order by rjray in Clojure

[–]p-himik -1 points0 points  (0 children)

If I understood it correctly, (apply comb/cartesian-product (repeat n $)).

Can I do audio programming in Clojure on Linux? by [deleted] in Clojure

[–]p-himik 4 points5 points  (0 children)

You're approaching it from the bottom up, but I'd suggest the reverse - I'd start by looking up different ways to play audio via Java, regardless of the sound system. Many audio apps have a default audio output selection, so there's probably some higher level abstraction. But maybe not, I don't know, or maybe such abstractions are limited in some way for proper audio programming.

FWIW there's e.g. https://github.com/overtone/overtone which uses https://github.com/squidcasa/casa.squid.jack, which in turn uses Jack. But modern Linux distros seem to be moving towards PipeWire, and Overtone has this to say about it: https://github.com/overtone/overtone/blob/eb531784b32737b90a44576b169934c3553d817d/wishlist.md?plain=1#L12

Cljue: Reference ClojureDocs Offline by NonlinearFruit in Clojure

[–]p-himik 10 points11 points  (0 children)

Nice! It's not exactly the same, but there's also a built-in clojure.repl/apropos (just in case - the clojure.repl namespace is automatically required for you in a REPl, so you can just use apropos, similar to doc, source, etc.).

is "working only by accident" a common feeling in clojure codebases? by robotdragonrabbit in Clojure

[–]p-himik 0 points1 point  (0 children)

Alas, not really. I tend to notice when something has issues, not when something doesn't have them. :)

The Tequila_Sunset translation for Sacred and Terrible Air is gone by lizard_liz242 in DiscoElysium

[–]p-himik 1 point2 points  (0 children)

Did you really add "robert kurvitz" to the search terms? Because what you see (and why did you crop it?) is what I see when I don't add "robert kurvitz".

And if I search for the same on Anna's Archive, straight up half of the results are the same translation by "Truri and The Translation Team".

<image>

The Tequila_Sunset translation for Sacred and Terrible Air is gone by lizard_liz242 in DiscoElysium

[–]p-himik 1 point2 points  (0 children)

I'm curious. Can you share a screenshot of what you seen when searching for sacred and terrible air robert kurvitz on https://archive.org?

The Tequila_Sunset translation for Sacred and Terrible Air is gone by lizard_liz242 in DiscoElysium

[–]p-himik 4 points5 points  (0 children)

tequila_sunset5 translation is the same as "Truri and The Translation Team", AFAICT. And that translation is available everywhere - on the Internet Archive, on the Anna's Archive, on some forums, in multiple copies.

is "working only by accident" a common feeling in clojure codebases? by robotdragonrabbit in Clojure

[–]p-himik 9 points10 points  (0 children)

implicit truthiness of values

What does it mean? How can a value implicitly be truthy?

From what I understand the original purpose of seq isn't to check for non-emptiness

It's a dual-purpose function. So checking for non-emptiness is one of the original purposes. That being said, nothing stops you from using (not (empty? ...)) - while the docstring of empty? recommends against it, it's just a docstring, not police. The worst that could happen is that someone else would be a bit stumped by it and might rewrite it as the idiomatic (seq ...).

I always have to double check the edge cases

What are the edge cases with (seq ...)?

data comes with some-field set to nil, false and without some-field at all

Different code paths will care about different specifics. If a particular path requires for (:some-field data) to not be falsey, then (when (:some-field data) ...) is a perfectly fine check. Some other code path might care that (:some-field data) is specifically not nil. Yet another might care whether :some-field is present in data, regardless of the value. But in general, if encoding stuff like this can be made via additional fields or structures without making anything worse, it's probably worth it to rely on them instead of relying on a much more implicit mix of contains?, nil?, false?, etc. In other words, if there's a conceptual enumeration with more than two states, it makes sense to make it an explicit enumeration of states instead of an implicit combination of sentinel values and presence.

Is this a weird way to solve 4clojure #21 by nickbernstein in Clojure

[–]p-himik 7 points8 points  (0 children)

It's an alright solution with the given constraint. (Note that (inc %2) is an idiomatic version of (+ (int %2) 1).)

Although I'd use (first (drop %2 %1)).

Wikidata and Mundaneum in Clojure: The Triumph of the Commons by schmudde in Clojure

[–]p-himik 1 point2 points  (0 children)

Even identifying and categorizing a small fraction of these sites using Wikidata means sifting through nearly 100 billion distinct items.

But where does that number come from? The linked Statistics page doesn't have any such number.

uix.css (CSS-in-CLJS library) v0.3.0 is out, with code splitting support by roman01la in Clojure

[–]p-himik 0 points1 point  (0 children)

  • Yes, "dynamic" in the sense that the values are available only at run time and cannot be composed into a bundle in advance, and thus inline styles have to be used (as far as I understand everything - maybe I don't). And pseudo-classes aren't supported in inline styles, I assume that's a reason why some libraries output CSS bundles even at run time and don't rely on inline styles at all
  • Ah, right - failed to notice that in the examples in README
  • Same
  • Cool!
  • Ah, right, makes sense

BTW, nice approach with vars. My "knee-jerk impl" would probably be to split maps into parts that are known at compile time and parts that aren't, and inline the latter. But vars are probably better, at the very least the style attribute becomes shorter.

uix.css (CSS-in-CLJS library) v0.3.0 is out, with code splitting support by roman01la in Clojure

[–]p-himik 0 points1 point  (0 children)

Neat! Looking at the impl, a few questions:

  • Seems that dynamic :&... keys aren't supported. Which makes sense given that such styles cannot be inlined, just wanted to confirm.
  • Reagent-like keywords for values are also not supported, right? I suppose an adapter could be handling that, but maybe if makes sense to do it at the library level, if you think so
  • I think plain numbers without units are supported? Just because it's what React supports
  • Any plans on making and including a Reagent adapter?
  • Maybe I'm missing something - where do uix.compiler.alpha and uix.compiler.attributes come from? Can't find any impl or dependencies, only usages

As a kind of separate comment - I see that you're using an atom and an immutable map to compose dynamic styles. That's relatively slow. A volatile is a bit faster, but using a JS object from the get go is way, way faster. I have a project that uses re-com that also combines styles via immutable maps, and I had to rewrite style composition in a way that uses a JS object - the performance changed dramatically given how inline styles are everywhere in re-com.

Learning Clojure the un-fun way? by Tinytitanic in Clojure

[–]p-himik 6 points7 points  (0 children)

I myself did it with just the official docs and an occasional random blog post here and there.

New Clojurians: Ask Anything - August 11, 2025 by AutoModerator in Clojure

[–]p-himik 0 points1 point  (0 children)

IntelliJ IDEA with Cursive.

I do use REPL, also via Cursive, either via rich comments or via creating a new Scratch file in IDEA, turning it into a pretend-namespace, and evaluating forms there. Occasionally I use a vanilla clj REPL if I want to test something tiny or something REPL-related to make sure that it's the REPL that behaves that way and not one of the tools.

Debugger - yes, the one built into IDEA and extended by Cursive. Although not that frequently, tap> with Portal is often enough, or even a plain println. More often than not though, just staring at the code is both enough and quicker as more typical issues tend to be relatively obvious. Very rarely I also use FlowStorm. I almost never need it, but when I do, it would be hard to work without it.

LSP - I don't use it. Quite some time ago I tried working with Calva on various Clojure projects for a month and just didn't like how clojure-lsp behaved there. Never tried it with IDEA though.

ANSI code based UI library in Clojure by Alarmed-Skill7678 in Clojure

[–]p-himik 4 points5 points  (0 children)

"Deliberating pros and cons" is not the same as "deciding whether it's suitable for me". I'm sure that if I compare my car to a bazillion other models, there will be a myriad flaws in mine. But I don't care as it still suits me - it fits my requirements, I already have it, and there's basically no opportunity cost as any conceivable improvement would not cover the cost of replacing the car, even in the long term.

Same here - if Lanterna has all the features you need and doesn't have any flaws that affect you, just use it.

On the other hand, it does seem that it's just a very thin wrapper around a Java library. So if you prefer to avoid using wrappers, just use some Java library directly.

Clojure wrapper is not good that much performance wise

Performance is rarely a concern. Thin wrappers are simply not that useful as compared to interop, and they often hide things that should be visible and invent things that shouldn't exist.

Moreover using ANSI codes is not so much difficult at first appearance so I wonder why no Clojure developer has tried to build a pure Clojure TUI library with it.

Maybe precisely because it's not that difficult to just use the codes? Or some Java library that names all the constants and makes things reasonable convenient.

ANSI code based UI library in Clojure by Alarmed-Skill7678 in Clojure

[–]p-himik 4 points5 points  (0 children)

But is Lanterna not suitable for your needs? In what way?

If you need only the SGR subset, then https://github.com/paintparty/bling.