Fork me on GitHub
#off-topic
<
2023-05-08
>
yuhan08:05:34

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} {}

šŸ˜„ 6
p-himik08:05:09

That's forbidden knowledge.

yuhan08:05:12

Even the Clojure reader refuses to acknowledge the truth

user=> (read-string "^^{:m2 :whoa} {:m1 :ok} {}")
^{:m1 :ok} {}

p-himik08:05:33

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

šŸ 6
šŸ˜ 4
šŸ¤Æ 2
Ben Sless08:05:09

@@@@@@@@@@@@@@@@@@@@@@@@h
#'user/h
Rendered, "AAAAAAAAAAAAAH"

hifumi12308:05:58

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

souenzzo09:05:40

turns out: metadata actually is DATA

šŸ’„ 4
p-himik09:05:29

@U0479UCF48H With just one @ though. #' gets you a var and @ derefs that var to get to the actual value.

hifumi12302:05:38

slipped in an extra @ by accident since I often use it to remove specific functions from the tapset when using a REPL šŸ˜

henrik13:05:23

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.

šŸ˜‚ 11
šŸ‘Œ 2
2
Drew Verlee18:05:56

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. laughcry

p-himik18:05:34

> 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."

sheluchin18:05:50

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.

Drew Verlee18:05:18

I feel what the person is going through in that video. True, maybe I shouldn't edit deps by hand.

p-himik18:05:11

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.

šŸ‘ 2
dorab19:05:28

neil can do the updating for deps.edn.

šŸ‘ 2
eggsyntax21:05:50

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

p-himik21:05:01

@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.

eggsyntax21:05:26

IMHO it is the single funniest thing ever written about programming, and it's funny because it's all true.

eggsyntax21:05:59

> 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.

šŸ˜„ 3
p-himik22:05:19

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).

šŸ˜­ 5
raspasov05:05:38

@U2FRKM4TW a year of no problems is still a pretty good run, in my book šŸ˜

mauricio.szabo02:05:28

@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 crying-laughing-joy-blood

šŸ‘ 2
Benjamin12:07:55

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)

marciol19:05:42

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.

Ī»raulain19:05:45

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.

marciol19:05:21

Yes, exactly the case. I need to know about the general approach to annotations, Java Streams, etc etc

marciol19:05:55

I found that maybe Modern Java in Action could fit these requirements as well, but want to hear more opinions

šŸ‘Œ 2
marciol19:05:21

There is even a reference to Clojure in the Foreword

escherize21:05:31

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/

šŸ™ 2
Daniel Craig21:05:57

Yeah I really like The Well-Grounded Java Developer second edition

Daniel Craig21:05:59

There's an entire chapter for Clojure and Kotlin

Daniel Craig21:05:01

It's very recent

marciol21:05:05

Nice, it should be a entertaining read