This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-08
Channels
- # announcements (1)
- # babashka (28)
- # beginners (13)
- # calva (10)
- # clerk (18)
- # clj-on-windows (39)
- # clj-otel (1)
- # cljdoc (17)
- # clojars (12)
- # clojure (40)
- # clojure-austin (11)
- # clojure-brasil (1)
- # clojure-europe (23)
- # clojure-nl (3)
- # clojure-norway (16)
- # clojure-uk (2)
- # clojurescript (28)
- # clr (4)
- # conjure (1)
- # emacs (14)
- # hoplon (6)
- # hyperfiddle (59)
- # interop (2)
- # leiningen (1)
- # off-topic (37)
- # pathom (1)
- # polylith (5)
- # portal (7)
- # reagent (9)
- # releases (3)
- # shadow-cljs (22)
- # spacemacs (6)
- # tools-build (12)
- # tools-deps (51)
- # web-security (6)
- # xtdb (7)
It never occured to me that metadata could have metadata š¤Æ
user=> (set! *print-meta* true)
true
user=> (with-meta {} {:m1 :ok})
^{:m1 :ok} {}
user=> (vary-meta *1 with-meta {:m2 :whoa})
^^{:m2 :whoa} {:m1 :ok} {}
Even the Clojure reader refuses to acknowledge the truth
user=> (read-string "^^{:m2 :whoa} {:m1 :ok} {}")
^{:m1 :ok} {}
Another piece of forbidden knowledge for you - the World Serpent:
Clojure 1.11.1
user=> (def x (intern *ns* 'x))
#'user/x
user=> @x
#'user/x
user=> @@x
#'user/x
user=> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@x
#'user/x
not sure how forbidden this is: but if there is a private var, like some.ns/foobar
, you can access it anyway via @@#'some.ns/foobar
@U0479UCF48H With just one @
though. #'
gets you a var and @
derefs that var to get to the actual value.
slipped in an extra @ by accident since I often use it to remove specific functions from the tapset when using a REPL š
To resolve the issue definitively, I had ChatGPT impersonate Hegel and Nietzche debating REPL- vs. test-driven development: System Assume the role of an excellent creative writer. User Write an imaginary discussion between Hegel and Nietzsche, debating the merits of REPL-driven development vs test-driven development while they anachronistically make use of modern internet memes and tropes. Allow the dialogue to showcase an astounding clarity of thought and creativity as well as illustrating the respective philosophies of these great thinkers. Assistant Hegel: Nietzsche, my friend, have you heard of this revolutionary software development approach called REPL-driven development? It promises to bring dialectical progress to the coding world, much like my Phenomenology of Spirit! Nietzsche: Ah, Hegel, you and your dialectics! But of course, I have heard of it. I must say, I find the concept rather appealing. It allows one to experiment and iterate quickly, much like my concept of eternal recurrence. However, I must admit that Iām partial to test-driven development, as it allows the Ćbermensch to impose his will upon the code by asserting what it should and shouldnāt do. Hegel: Well, Nietzsche, while your admiration for the Ćbermensch is commendable, REPL-driven development allows a synthesis of thought and action, thesis and antithesis! Imagine the meme: āWhy not both? insert girl shruggingā. It brings the programmer closer to the code, enabling a continuous exploration of the problem space. Nietzsche: You make a compelling case, dear Hegel. But allow me to invoke the āThis is fineā meme, with the dog surrounded by fire. Test-driven development forces one to confront the chaos of the unknown, and in doing so, one imposes order upon it. It encourages resilience and discipline, much like my concept of amor fati. Hegel: Nietzsche, your points are well-taken, but REPL-driven development is like the āDistracted Boyfriendā meme. The programmer focuses on the code, but the REPL is always there, offering immediate feedback and luring the developer to explore new ideasāa constant reminder of the dialectical process that underlies all things. Nietzsche: Still, Hegel, I must insist that test-driven development is the path of the Ćbermensch. The programmer, much like the āTwo Buttonsā meme, must choose between the easy path of REPL-driven development and the more challenging path of test-driven development, which forces one to confront the void and create meaning in the face of uncertainty. Hegel: Nietzsche, I sense we may never agree on this matter. Yet, perhaps our disagreement is merely another dialectical moment in the grand unfolding of human understanding. Let us embrace this tension and see what new insights emerge. Nietzsche: Indeed, Hegel. As I have always said, āThat which does not kill us makes us stronger.ā Perhaps the true wisdom lies in the recognition that there is no single approach that can encompass the entirety of human creativity and potential. Let us remain open to the possibility that both REPL-driven and test-driven development have their merits, and that the path to greatness may lie in embracing both. Hegel: Well said, my friend. Let us continue our journey, ever striving to bring forth the best within ourselves and the world. And so, the dialectic continues... Nietzsche: Indeed, it does, Hegel. Indeed, it does.
Warning what follows is a rant. I have a confession, I'm constantly confused. Let me break down an average moment in my life. I want to update shadow-cljs for all the usual reasons. So I open the package.json in emacs. Because i have lsp installed, but not the json "server" i'm prompted to install it. Naturally, I do so, then i'm told it's starting (all well and good), then i'm told it exited, and it asks if I want to restart it. Optimistically I say "yes". It tries, and fails again, then prompts to restart it again. At which point i have to hit "n" for "no" at least 3 times before it goes away. For those still playing along, here is my message buffer:
LSP :: Error from the Language Server: Internal error (Internal Error) [3 times]
evil-line-move: Beginning of buffer
LSP :: Error from the Language Server: Internal error (Internal Error) [2 times]
Configuring package json-snatcher...done
Configuring package json-mode...done
LSP :: Download json-ls started.
Comint finished
LSP :: Server json-ls downloaded, auto-starting in 1 buffers.
LSP :: Connected to [json-ls:903741/starting /home/drewverlee/centriq/centriq-immobile].
LSP :: json-ls has exited (exited abnormally with code 1)
Server json-ls:903741/starting exited (check corresponding stderr buffer for details). Do you want to restart it? (y or n) y
evil-line-move: Beginning of buffer
LSP :: Connected to [json-ls:903750/starting /home/drewverlee/centriq/centriq-immobile].
LSP :: json-ls has exited (exited abnormally with code 1)
Server json-ls:903750/starting exited (check corresponding stderr buffer for details). Do you want to restart it? (y or n) n
At this point I want I'm confused. I want lsp to be working, but honestly, for this task, it's not worth my time to go fix it. I'm triply confused about how this isn't constantly annoying such a huge population that it wouldn't be immediately fixed. Thirdly, and this is my favorite part, it causes me a deep sense of dread as I wonder if I, alone, constantly run into an endless current of broken software.
I need a #therapy channel some days. 
This is my daily life: https://m.youtube.com/watch?v=AbSehcT19u0&pp=ygUlbWFsY29sbSBtaWRkbGUgaGFsIGZpeGluZyBsaWdodCBidWxiIA%3D%3D

> So I open the package.json in emacs.
This is the first mistake - don't edit the dependencies by hand. :)
Instead, just enter npm i -E shadow-cljs@\*
in your terminal in the project's directory.
It should install the latest and greatest and pin the version (the -E
flag).
> Naturally, I do so
After lots of similar experiences, I have learned to spend at least 2 seconds before agreeing to installing new stuff to think about whether it's something really need.
Given that it seems to be the first time you saw the prompt, I'd wager you won't need a JSON LSP any time soon.
> I wonder if I, alone, constantly run into an endless current of broken software.
Of course not. :) Plenty of rants about it. Nikitonsky has an article on that as well, I think.
"Embrace the jank."
Sometimes I wonder if there will come a day when I decide I've learned enough that I can stop figuring out how to fix random workflow things when building things and just build things using what I have and know. I guess not in the world of situated software where third parties and dependencies are always evolving.
I feel what the person is going through in that video. True, maybe I shouldn't edit deps by hand.
Correction - the dependencies in package.json
, and only because npm
already does that for you.
I think there's also something similar for deps.edn
that would update the current version of a dep to whatever you need. But I haven't used it myself yet.
On days when I feel like that, I like to reread the 'Programming Sucks' rant essay and be reminded that I'm not alone.
https://www.stilldrinking.org/programming-sucks
@U077BEWNQ Oh, I'm a fan of that blog. :) But not sure I've seen that article before given how old it is - will definitely give it a read.
IMHO it is the single funniest thing ever written about programming, and it's funny because it's all true.
> Websites that are glorified shopping carts with maybe three dynamic pages are maintained by teams of people around the clock, because the truth is everything is breaking all the time, everywhere, for everyone. Right now someone who works for Facebook is getting tens of thousands of error messages and frantically trying to find the problem before the whole charade collapses. Thereās a team at a Google office that hasnāt slept in three days. Somewhere thereās a database programmer surrounded by empty Mountain Dew bottles whose husband thinks sheās dead. And if these people stop, the world burns. Most people donāt even know what sysadmins do, but trust me, if they all took a lunch break at the same time they wouldnāt make it to the deli before you ran out of bullets protecting your canned goods from roving bands of mutants.
To add to the rant. About a year ago or so I switched HTTP client in one of my projects from clj-http
to the one built into Aleph, which is a wrapper on top of Netty.
Everything went well, but a few hours ago I discovered that I can't create Trello cards with attachments larger than ~6 kB using code that I haven't changed since the switch.
Spent those few hours trying to figure out why - initially I blamed my own code, then Trello API changes (their documentation is terrible), then everything else.
Lo and behold, it's a https://github.com/netty/netty/issues/1376 (its anniversary is in just 10 days) in Netty. And here I was, thinking that the days when such issues had been biting me have ended with me stopping using Python (bloody Django, I hope it rots).
@U2FRKM4TW a year of no problems is still a pretty good run, in my book š
@U0DJ4T5U1 I'm not sure what programming language you use in your day-to-day job, but I imagine it's not Javascript. I'm saying that because, as someone needing to work with JS ecosystem both on my work and on personal projects, I feel I learnt to accept that everything I use will be horribly broken, but sufficiently useful to make me avoid writing even worse code
I know without knowing some of the struggles you have. Imo I instantly get a certain flair of what kind of software is the emacs lsp mode. So I stayed a from it because I want to stay smooth. (not to shit on the clojure lsp mode which I am sure is a great piece of software and a good thing for the community)
Hey all, what is the best up to date Java book to experienced developers (no beginner stuff)? I think that this is a good channel to off-topic subjects, as this one, but please let me know if it isn't.
Do you mean experienced developers who already know some java? In that case i recommend Effective Java by Joshua Bloch. Its a bit old but covers intermediate to advanced concepts.
Yes, exactly the case. I need to know about the general approach to annotations, Java Streams, etc etc
I found that maybe Modern Java in Action could fit these requirements as well, but want to hear more opinions
This seems to be another good one: https://www.manning.com/books/the-well-grounded-java-developer-second-edition?utm_source=social_media&utm_medium=int_influencer&utm_campaign=book_evans2_wellgrounded_12_8_20
Thereās this reddit thread Iām saving.. for a friend ā¦ https://old.reddit.com/r/Clojure/comments/106md8r/suggested_resources_for_learning_the_jvm_well/
Yeah I really like The Well-Grounded Java Developer second edition
There's an entire chapter for Clojure and Kotlin
It's very recent