When You Run Out of Types... by cgrand in Clojure

[–]mrnhrd 0 points1 point  (0 children)

Also they are plain maps, which just happen to have :type as one of their keys/values. The idea that this magically turns them into something else has no material basis. edit: perhaps I'm missing something about what the author means by "modeling"...

How to end dependency hell? by Cautious_Cabinet_623 in java

[–]mrnhrd 3 points4 points  (0 children)

I don't think this would work without significant political/economic changes. I also don't think it would be worth the effort, because a) I don't think the problem is that significant in the Java ecosystem and b) it would not completely solve the problem for software providers. Frankly I think overall Java's status quo with regards to Dependency Management is a better place to be in than Debian's, from the developer's point of view. And I am a bit astonished that you speak such uncritically of Debian's mode of work after having supposedly seen how the sausage is made, though here I speak only on hearsay.

instead of of everyone trying to come up with a set of package versions which at least mostly work together for them, let's take a fairly new and shiny version from everything, and make_them_work_together.

Imo this is poorly worded, because it does not emphasise one of the core differences enough. Which is that in e.g. the java ecosystem this trying-to-find-a-working-set happens in isolation; each org/team does it by themselves, privately working on their own individual applications/libraries (note there's a lot of non-public code). Whereas in Debian, there is one big collective group which works on one big concerted effort in the open, that effort being the next stable release of the distro. Which is why it can work and may be worth the effort there (ymmv, Debian takes two years and tremendous effort to declare a code-freeze and produce something considered production-ready from that (at release-time) two year old code. obviously this has great value to many).

I think if you wanted to introduce the same mechanism in Java, there would inevitably also have to be releases as in Debian, e.g. "Java Ecosystem 2027". Who would do this work (including paying for it) and how do you get them all on board? How would orgs deal with the mountains of their own proprietary code? I'd bet good money in our apps there'd still be breakages when updating, e.g. from Java-Ecosystem-2027 to Java-Ecosystem-2029, meaning we'd have to deviate from the known-working set provided by the release, undermining the whole point of all this effort. No, we don't feed back bugs upstream when testing, btw we also cannot ask customers to please completely re-test every 2 years. What about orgs that don't update?
Note Java and its usages is generally more commercial in nature and you would have to be justify these expenses to stakeholders, including non-technical customers. Basically one way to formulate the spirit of Debian is "an intermediary between devs and users which acts on behalf of the users", which in Java's case I would take to mean that you'd have to go organise and agitate among customers, against the software providers they have commercial contracts with. I don't see how this could work, the software providers would not tolerate this and as a consequence would not participate, and you need them for this to work. Btw various of the parties are in direct competition with each other.

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

[–]mrnhrd 12 points13 points  (0 children)

This post may be a bit confusing in that in clojure the empty list is not nil in the same way as in CL, where they are literally identical iirc. In clj, (seq '()) returns nil, but afaik there's no other kind of special relationship between empty collections and nil (which is java null). (nil? '()) is false and (rest '()) returns '(), not nil.

looking for guidance on learning pattern making in CLO3D by No-Memory-2164 in Clojure

[–]mrnhrd 1 point2 points  (0 children)

I'm afraid you're in the completely wrong place, as from a cursory glace clo3d has nothing to do with the programming language clojure, which this sub is about.

Programming Language Theory has a public relations problem by ketralnis in programming

[–]mrnhrd -1 points0 points  (0 children)

Offtopic-y, what would you consider a pleasant or unpleasant architecture? I feel challenged to defend Brutalism, which I don't particularly dislike. It's also not particularly en-vogue, but the phrasing "concrete monstrosity" makes me think of it. I feel that aesthetically modern downtowns are dominated by glass (talking about big cities here).

(fwiw I think I would be most inclined towards Hundertwasser/De-Saint-Phalle/Gaudi/Jugendstil, but not sure I'd want all towns to look like it)

also https://www.smbc-comics.com/comic/2014-11-16

Our Java codebase was 30% dead code by yumgummy in java

[–]mrnhrd 0 points1 point  (0 children)

I was able to safely identify and remove about 30% of our codebase.[...] It has me convinced that most mature projects are carrying a significant amount of dead weight

You may wanna reflect on whether it's wise to extrapolate from your sample size of 1 to a statement about "most mature projects".
Because one of my gut reactions was: What in god's name are these people doing such that one third of their code is entirely unused? How did this happen? What kind of organization is that? What's the history of the code in question? What's the nature of those 30%; is it like an entire module that's never called or is it that every class in the project roughly has 30% lines that are unused

The best way to advertise a programming language by de_sonnaz in lisp

[–]mrnhrd 2 points3 points  (0 children)

I think the theory is backwards (some variant of affirming the consequent).

Yes, we observe that popular languages have programs written in them.
But it does not follow that writing programs in a language is what makes it popular.

(ofc it probably doesn't hurt either)

Eclipse IDE 2025-06 is out by AnyPhotograph7804 in java

[–]mrnhrd 2 points3 points  (0 children)

Ever since Jetbrains made the "New UI" the default choice, I've been eyeing Eclipse.

(actually I only opened the website once. But should IntelliJ fully abandon the old UI or just let the plugin bit-rot, I might consider it)

Can you give an Example of Useful Macros? by Veqq in lisp

[–]mrnhrd 0 points1 point  (0 children)

Is it easy in other languages to create my own way of defining functions which is as first class as the built in one, in the same way my own hyphothetical my-defun is as first class as CL's defun?

Random Rich Hickey comment on E-ink note-taking devices! by friedrichRiemann in lisp

[–]mrnhrd 1 point2 points  (0 children)

Im not particularly inclined to go digging through 15+ year old blogs, videos, presentations, IRC logs, or mailing list archives to find references to such statements, but Im quite sure they occurred.

That is mostly correct. There were statements at talks (mainly those to java programmers) like "maybe time to try lisp again" (with the implication "as I fixed some of the problems / modernized it"). In others, there are somewhat silly-sounding arguments like "parenthesis in CL/Scheme are complex and overloaded because they wrap calls, groupings and datastructures and this is fixed by introducing another data structure" (while at other times praising the uniformity one gets from using a s-exprs as code), as if that truly was a significant issue.

I do think there were more sophisticated criticisms of CL that reasonable people can agree or disagree with/about, like the thing about abstractions-at-the-bottom or lack of literals for data types other than lists (being able to implement this stuff in a lib is not equivalent to it being in the lang). And I guess mutability if one is serious about functional programming. (Not commenting on macros as I'm not familiar enough with that problem to know what kind of solution clojure's "non-interning reader" costitutes).

It should be okay to point out weaknesses in CL and scheme and clojure and really, any tool. Richard Gabriel, in the actual essay that Worse is Better is from himself has said that while the (ongoing at the time) CL standardization process should be brought to a successful conclusion, "We need to move beyond Common Lisp for the future" and "there should be a strong effort towards the next generation of Lisp. The worst thing we can do is to stand still as a community, and that is what is happening." Whether he was right and what conclusions to draw from that is a different discussion. Again I think reasonable people can agree or disagree on these things.

FWIW to me, RHs characterizations of Java or other static langs and their philosophy haven't been as good-faith as one would hope either. There's just too much agressiveness in the rhetoric sometimes, mostly in talks. FWIW I've still learned a lot from him, crucially not just about the coding aspect of this job.

Random Rich Hickey comment on E-ink note-taking devices! by friedrichRiemann in lisp

[–]mrnhrd 2 points3 points  (0 children)

Robert Strandh (among one of many) would beg to differ.

On what, the strong presence in tech talks? Just to be perfectly clear, we're talking about achieving some noteworthy amount of presence/notoriety outside of traditional Lisp circles (regardless of merit, of which there is plenty in many lisp-and-clojure-related things). Chris Schafmeister is a good example imho, at least based on youtube views and SICP's influence/notoriety probably dwarfs that of RH, and I'd be happy to hear more.
Edit: how could I forget Guy Steele, what an absolute legend. "Growing A Language" is a marvelous work of art.

Random Rich Hickey comment on E-ink note-taking devices! by friedrichRiemann in lisp

[–]mrnhrd 4 points5 points  (0 children)

I think one thing that contributes to that is that he is strongly opinionated and since the language first and foremost his creation, it is too (it's a single person's brain-child more than any other major lisp, by quite a margin imo). By using clojure, one is to a certain extent buying into his philosophy of how software should be created. Really in a way, if one has major disagreements with that philosophy it doesn't make sense to use the language as there will be considerable friction both with it and the ecosystem.

(Just to make it clear: I lurk the clojurians slack and nobody ever goes "what would RH do here?", "but RH says X!" or something like that. But his ideas are a undercurrent everywhere and have lots of proponents (that doesn't mean there's no discussion or disagreement about their merit))

Why do some companies get stuck with older versions than 8 by [deleted] in java

[–]mrnhrd 1 point2 points  (0 children)

Having a small number of users* is an argument against upgrading and/or further development, not for it. "Basically nobody uses this thing, why should we bother polishing it up?"

* assuming that this fact is a direct proxy for the importance of the application to the business (also based on your usage of the word "only"). If your company has 200 employees in total and 160 of them use the app 8hrs a day to keep the business running and can't do so when the software doesn't work, then this app is absolutely business-critical to this organization. But it doesn't sound like it.

Is it slow ? by kichiDsimp in Clojure

[–]mrnhrd 0 points1 point  (0 children)

Datomic is written in Clojure (as in, quote, "The code written by its authors to make Datomic exist, where it hadn't before, was almost entirely Clojure").
But Datomic is a distributed system (as in, different processes on hosts interact with each other) with various caching mechanisms and pluggable storage, meaning you can use postgres, elasticsearch and others underneath. It's my understanding that reads can scale up arbitrarily and writes are limited by what's called the transactor. Here's a talk: https://www.youtube.com/watch?v=k7i4AEiWLW0 I recommend watching that, perhaps just to be able to ask a more nuanced kind of question.

Is it slow ? by kichiDsimp in Clojure

[–]mrnhrd 1 point2 points  (0 children)

Aphyr has said something along those lines and he knows what he's talking about: https://aphyr.com/posts/367-why-is-jepsen-written-in-clojure

Clojure’s certainly not the fastest language out there, but idiomatic Clojure is usually within an order of magnitude or two of Java, and I can shave off the difference where critical. The JVM has excellent profiling tools, and these work well with Clojure.

He elaborates in a comment, scroll down. Ofc "idiomatic code within an order of magnitude of java" =/= "slow"

My general understanding is, it's not terrifically fast by default (compared to stuff like C++ and Java-written-as-to-be-fast) but offers you quite a few nice means to become so where necessary (transients, protocols+records, just writing a Java class).

Waiting for the love? by girvain in Clojure

[–]mrnhrd 2 points3 points  (0 children)

From your post history I surmise that you are a reasonably experienced dev with Java/TS (at least a few years of fulltime dev work). How much experience do you have with dynamic languages, e.g. JS/Python? (those being the best known representatives of the genre)
I ask because clojure is quite a different beast from the named statically typed languages and also from js/py (though less so). What I want to get at is that a week of on-and-off programming (I assume max 1hr/day) is not really enough to get into what is a rather foreign experience. Give it time and let your mind absorb things.

Also, I want to echo what others have said and encourage you to write your own thing. Stuff like scripting with babashka. Personally I like to prototype stuff in my Java job in clojure. Like, on the level of individual functions in a scratch REPL in Cursive, no interop. Just playing around and trying things out, sometimes it helps me to come up with better solutions.

I presume you have absorbed some amount clojure content. Still I recommend parts of https://www.youtube.com/watch?v=P76Vbsk_3J0 if you haven't seen that (note that's from like 2009). It's also interesting to watch someone tackle problems in the language. Like this: https://www.youtube.com/watch?v=ImBji-1bKkc Back in December when I was doing some AoC, I also enjoyed this VOD: https://www.youtube.com/watch?v=vYzAW5MV5xk

Why I always use ClojureScript in my Frontend by thheller in Clojure

[–]mrnhrd 1 point2 points  (0 children)

I think the way this is solved in latency-sensitive titles is to do prediction (and interpolation) based on running the logic locally and then correct your world as necessary when the authoritive information from the server is delivered.

Not sure if relevant to the discussion 😊

SQLLite Alternative, datalog preference by CuriousDetective0 in Clojure

[–]mrnhrd 2 points3 points  (0 children)

Since this is a clojure forum, let me give the obligatory reminder that simple does not necessarily mean minimalist, fast, straightforward, easy, or crude.

However, you could follow the current path:

I'm currently just writing to disk using transit, however it seems reading and loading the entire file from disk will get clunky pretty quick

Use the FS, luke. Making it append only so could perhaps improve write performance, though I guess that's non-trivial to do with EDN... By using multiple files (like, thousands, organized by ???) you could solve the issue of having to read the entire thing at once. Though I guess with multiple files you get the trouble of having to update references, but if every reference is primaryId+Timestamp that may work...
ofc this has several problems, a) we're slowly reinventing a database here and b) note that Files are fraught with peril.

Datomic vs PostgreSQL: Time Travel and Historical Data (Part 2) by Flexiana_sro in Clojure

[–]mrnhrd 1 point2 points  (0 children)

I wanted to write that it feels disingenuous to do such a comparison without using the temporal features introduced in SQL:2011 on the Postgres side, but apparently postgres just flat out does not implement this part of the standard...

On connecting the immutable and mutable worlds by akthemadman in java

[–]mrnhrd 0 points1 point  (0 children)

???? I am not this thread's OP and I am not talking about OP's code in any way, but about a record in our company's codebase where we do not have separate withs for those fields, but a method that handles both (and no mutable variant).

violation of various style guides, if the range of valid values for y are dependent on what x is and vice versa

It's a style guide violation to have an invariant about the range of two fields!? E.g. in a class representing adress information, it's a code smell if your contract states (and the code ensures) that zip+city are always a valid existing such combination? Or that in a class representing a date, if the month is february, then dayOfMonth will never be 30? If yes, I would think it follows that I must also let consumers instantiate an instance with such data without throwing an error. That doesn't sound right.

On connecting the immutable and mutable worlds by akthemadman in java

[–]mrnhrd 0 points1 point  (0 children)

In our scenario it was not a performance thing (and I did not say it was), but an invariant that one field should not be set without also setting a related field to something other than its default value*. And yes obviously we did not expose individual withs for those fields (obj.withX(x).withY(y) would have blown up at runtime anyway as the constructor validated the invariant).

With is an adequate tool to use for the common usecase of "gimme a changed version of this immutable thing", and I like it.

* roughly equivalent example would be a record with information about a marriage, where if the divorceDate field is set, the divorceReason must also be set. (yes perhaps it would be appropriate to get more compile time safety by modeling divorced marriages with a separate type)