Fork me on GitHub
#off-topic
<
2021-09-16
>
seancorfield19:09:11

Just noticed that we hit 22,000 total members signed up here... wow! (sure, only 1,047 are currently considered "active" for Slack accounting purposes, but that's still a pretty impressive milestone)

clojure 36
party-corgi 20
🗺️ 6
clojure-spin 26
dpsutton19:09:37

interesting thought i just had from twitter. someone asked if anyone had used mutual recursion in an actual codebase. Be interested to see someone write a clj-kondo script or carve script that would look for letfns that had two functions each of which referred to the other

p-himik19:09:31

Couldn't you just search for trampoline?

dpsutton19:09:32

that doesn't imply mutual recursion though does it?

p-himik19:09:27

What would be other use-cases?

souenzzo19:09:17

most of mutual recursions that i remember were done via declare

2
dpsutton19:09:35

(letfn [(even? [x] (if (zero? x) true (not (odd? (dec x)))))
        (odd? [x] (if (zero? x) true (not (even? (dec x)))))]
  (even? 4))
true
things like this

dpsutton19:09:42

ah, good point about declare

Alex Miller (Clojure team)19:09:58

In almost 12 years of Clojure, I've used trampoline once

dpsutton19:09:53

and later removed it?

😂 2
borkdude19:09:57

similar to dosync: together with trampoline that was one of the first things I learned from the Stu Halloway book in the Christmas break of 2009, only to discover that I would almost never use them :)

dpsutton19:09:41

i have never used the stm directly (not including require and such that use it i think)

borkdude19:09:08

I thought it would never end up in bb but it did get there because someone needed it ;)

p-himik19:09:36

Found one actual usage of letfn for mutual recursion in the dependencies of one of my projects, if it's of any use to you: reitit.dependency/post-order.

seancorfield19:09:06

We have eight instances of trampoline at work, all courtesy of @U0NCTKEV8

😂 6
hiredman20:09:40

Great for retries

☝️ 2
john20:09:21

I've been working on a "higher order components" thing for cljs for a bit. Most impls I've made of it, the constructor just refers to itself. But a few impls spread the constructor across two fns, which referred to each other

hiredman20:09:14

For mutual recursion, the big use case for me lately has been parser combinators, where I've used both letfn and declare

dgb2320:09:43

To understand mutual recursion read the next sentence. Mutual recursion is explained in the previous sentence. --- Someone make a more elegant, funnier joke out of this please.

steveb8n00:09:32

was that the post from Pam Fox? I thought about responding as well but wasn’t sure she’d like a clj example

dpsutton00:09:34

Not sure. But I don’t think the poster would care about language at all

emccue12:09:04

I have, but not in a tail recursive way

emccue12:09:16

(declare schedule-save-thing)

(defevent save-thing []
  [{:keys [db]}]
  (if (currently-saving? db)
    {:fx (schedule-save-thing)}
    {:db (set-saving db)
     :fx (http-request ...)}))

(defn schedule-save-thing []
  (debounce-fx {:process :thing-saver
                :ms      1000
                :then    (save-thing)}))

emccue12:09:26

this is pseudocode, but roughly what we do for simple autosaves

emccue12:09:03

it doesn't need tail recursion because there is a queue in the middle

steveb8n23:09:53

What do y’all think of REPL’ing on one of these? https://frame.work Personally I see this finally replacing my Mac addiction. Will be interested to hear from anyone who is already using one

seancorfield00:09:35

Seems like you'd want Performance or Pro and those are only $300 cheaper than a Microsoft Surface Laptop 4 with the same specs -- I'd be concerned about the quality and compatibility of an "unknown" company like Framework just to save $300.

seancorfield00:09:08

And there are only companies with an established reputation that would have equivalent models priced below the MS laptops.

steveb8n00:09:30

yeah, the top cpu is a bit underpowered but I assume they will release much more powerful replacements soon

steveb8n00:09:13

how self-servicable is a surface pro? the appeal for me is the ease of switching components

seancorfield00:09:26

No idea. I never take any of my machines apart or do anything beyond a RAM upgrade mostly.

seancorfield00:09:20

I love my Surface Laptop 3, Windows 11 + WSL2. 16GB, i7, 512GB SSD (I think -- it's busy installing a new build of Windows 11 but I'll check as soon as it's done).

seancorfield00:09:57

I've been a Mac user since around 1992 and have slowly been switching over to Windows over the last five or so years.

steveb8n00:09:09

I’ve had keyboard and screen replaced on my 2016 mac. in the past I’ve upgraded SSD and mem. I’m pretty sure this desire is common. the success of https://www.owc.com is a testament to that

steveb8n00:09:57

I can’t bring myself to go back to windows. makes my skin crawl. linux is my preference if I’m gonna switch

⬆️ 8
seancorfield00:09:32

That's why I run WSL2 / Ubuntu for all my dev work.

seancorfield00:09:47

Kinda like the best parts of a Mac but not Apple 🙂

steveb8n00:09:16

on the perf front, I’ve been using an M1 mac mini for the past 6 months. it’s twice as fast as my MBP for 1/3 the price. insanely good. I doubt the framework will match that

seancorfield00:09:18

Macs have become a lot less reliable over the past decade. I've had a number of HDs fail completely, and several screens.

steveb8n00:09:16

totally agree. I’m falling out of love but that M1 perf makes me feel like a crack-head who can’t let go. (or a social media user 🙂

steveb8n00:09:31

hmm, is Slack social media. oops

seancorfield00:09:49

My 2012 iMac (27") is still my daily dev box but it has HD problems and I'm still running 10.12 because the disk errors mean the O/S upgrades refuse to run -- and the repair tool can't fix it 😐

seancorfield00:09:38

My 2012 Dell XPS 12 still works perfectly, by comparison, but it just isn't powerful enough for a daily dev laptop (whereas the Surface Laptop 3 definitely is).

steveb8n00:09:38

yeah, repair is not in Apples vocab

steveb8n00:09:12

anyhoo. I need to get back to my code. thanks for the response

seancorfield00:09:37

I've never been a hardware person so the idea of upgrading/building stuff has never interested me -- but I can see the appeal of the Framework for folks who like to tinker.

steveb8n00:09:32

for me it’s part tinker but mostly e-waste. I don’t want to throw out my 5 year old laptop but I do want faster components

steveb8n00:09:12

my family is happy with the hand-me-downs though. that’s a good side-effect

seancorfield00:09:14

Fingers crossed that Framework stay in business long enough for that to be possible in the future 🙂

steveb8n00:09:24

fingers and toes 🙂

seancorfield00:09:56

I think I've spent about $1,500 on every laptop I've ever bought, going back decades. You get a lot more bang for your buck for that now -- and in real (inflationary) terms, that just gets cheaper and cheaper. Kind of crazy just what you can get for that price compared to a decade or two ago 🙂

steveb8n00:09:14

In Aussie that translates to $3-4k most of the time. you are lucky over there. probably another reason why it’s more attractive to me

seancorfield00:09:05

Ah, good point. I used to live in the UK and would sometimes pick up a new laptop when visiting the US. Even with the flight costs and declaring it at UK customs for tax -- which I could claim some of back as a consulting business -- it was still sometimes cheaper than buying the same laptop in the UK 🙂

steveb8n00:09:23

yeah, same here. Europe is slightly worse than Aussie. I had the same solution: regular jaunts to the US with an empty suitcase that got filled up with clothes and tech gear. was better than Xmas

🎄 4
💼 2
✈️ 4
sova-soars-the-sora03:09:05

It's 2021 and we almost have build-it-yourself laptops with exchangeable hardware. The concepts that fueled the industrial revolution (replaceable parts) are taking a lonng time to catch on in tech where there is huge economies-of-scale at play. 5 major manufacturers could have got together and made this a reality 30 years ago, but maximizing profit would be harder. Not to be cynical, I just think a little altruism and cooperation goes a long ways to benefit people.

steveb8n03:09:47

I agree. hopefully framework allows other vendors to use their interfaces. I think they are planning to do this

gklijs06:09:48

Isn't it going backwards just so we consume more. I think I read somewhere they use inferior parts on washing machines on purpose, just so they can sell you a new one earlier. I don't think we see a lot of replaceable parts. It's a niche market for the few that care, at least I'm afraid it's like that.

seancorfield06:09:36

I expect my computers to last about five years. Right now, I'm at about eight years (my desktop is late 2012, I replaced my mid-2012 laptop within the last year). I don't think that's too bad. I used to have to replace laptops every 2-3 years and desktops every 3-4 years.

dominicm07:09:24

I've been using plastic welder to keep my thinkpad together for my hobby programming from the sofa. I'm hoping to hold out for frame.work as a "green" choice. Very excited to have one.

2
dominicm07:09:31

Once they're in the UK 🙂

steveb8n07:09:20

they say they will open up to international by the end of this year

Mno08:09:36

I expect to buy one when it comes to Europe but only because i believe in them and that they are an amazing example of right to repair. Also I like the 3:2 aspect ratio and changeable io