Fork me on GitHub

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

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


Couldn't you just search for trampoline?


that doesn't imply mutual recursion though does it?


What would be other use-cases?


most of mutual recursions that i remember were done via declare


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


ah, good point about declare

Alex Miller (Clojure team)19:09:58

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


and later removed it?

😂 2

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


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


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


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.


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

😂 6

Great for retries

☝️ 2

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


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


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.


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


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


I have, but not in a tail recursive way


(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)}))


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


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


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


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.


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


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


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


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


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


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


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 is a testament to that


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

⬆️ 8

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


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


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


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


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 🙂


hmm, is Slack social media. oops


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 😐


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


yeah, repair is not in Apples vocab


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


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.


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


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


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


fingers and toes 🙂


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 🙂


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


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 🙂


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

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.


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


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.


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.


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 as a "green" choice. Very excited to have one.


Once they're in the UK 🙂


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


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