Joined • 61 following • 1882 followers

Websitehttps://saagarjha.com
Emailsaagar@saagarjha.com
HotelTrivago

Saagar Jha

Fun fact: the more you practice, the better you get at making just-in-time presentations. Please enjoy my slides that I put the finishing touches on while at the lectern: https://github.com/saagarjha/Presentations/tree/main/CocoaHeads%20%2B%20SLUG%20October%202026

https://federated.saagarjha.com/notice/BB7eDkqcgz4DhnOXLs

Saagar Jha

(replying to Ma’moun)
@mamouneyya I don’t think it will be livestreamed but it will be recorded (and I will of course be posting my slides)

Saagar Jha

(replying to Saagar Jha)
Quick Q&A.

Q: Do you like AI?
A: I would only approach it with a loaded gun

Q: Do you hate AI?
A: Sometimes it can do my chores

Q: AI? Security?? Sam Altman should be charged with felonies
A: Maybe he should attend my talk

Q: wtf is a San Mateo?
A: Take Caltrain

k, cis iirc

(replying to Saagar Jha)

@saagar I’m astonished that San Mateo actually exists


Saagar Jha

This Thursday I’m tricking a bunch of iOS developers into listening to me speak about threat models and secure design. Come join me at Verkada’s San Mateo office to hear about pushing the state of the art forward in sandboxing AI agents on macOS! https://luma.com/51htcbzd
1 replies →
1 replies

Ma’moun

(replying to Saagar Jha)

@saagar Will there be an online streaming?

Saagar Jha

(replying to Ma’moun)
@mamouneyya I don’t think it will be livestreamed but it will be recorded (and I will of course be posting my slides)

Saagar Jha

(replying to Saagar Jha)
Quick Q&A.

Q: Do you like AI?
A: I would only approach it with a loaded gun

Q: Do you hate AI?
A: Sometimes it can do my chores

Q: AI? Security?? Sam Altman should be charged with felonies
A: Maybe he should attend my talk

Q: wtf is a San Mateo?
A: Take Caltrain

k, cis iirc

(replying to Saagar Jha)

@saagar I’m astonished that San Mateo actually exists


Saagar Jha

It’s amazing how the “try a bunch of undiscoverable stuff and see if it works” programming model of SwiftUI seems to have been totally saved by the existence of AI which excels at doing exactly this
2 replies →
2 replies

Tim Johnsen

(replying to Saagar Jha)

@saagar FAFO: the official model of SwiftUI and AI


Matt Massicotte

(replying to Saagar Jha)

@saagar I have heard of a number of people just having AI just produce UIKit code instead


Saagar Jha

It’s hard to find good things to say about GitHub these days but I will give them credit that their terms of service are refreshingly succinct and really easy to understand. If you haven’t given them a read yet now is a good opportunity to do so: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service

Saagar Jha

(replying to Jesse Wilson)
@jessewilson Yeah it’s funny that you can basically just make languages do this inefficiently if you want but you can’t get them to do it efficiently

Saagar Jha

(replying to shac ron ₪‎)
@shac Embedded systems also say no to heaps often

Saagar Jha

(replying to Michel Schinz)
@michelschinz Yes and that heap is a bump arena

Saagar Jha

(replying to Félix)
@fay59 This sounds like something a debugger should know how to solve

Andy Wingo

(replying to Saagar Jha)

@saagar @fay59 there are solutions to all of these problems wingolog.org/archives/2014/03/


Saagar Jha

(replying to Félix)
@fay59 If you’ve got a bug in your loop the memory’s got to come from somewhere be it recursive or not

Félix

(replying to Saagar Jha)

@saagar also enjoy the debugger taking 15 minutes to give you a backtrace when you stop your process by hand

2 replies →
2 replies

Saagar Jha

(replying to Félix)
@fay59 This sounds like something a debugger should know how to solve

Andy Wingo

(replying to Saagar Jha)

@saagar @fay59 there are solutions to all of these problems wingolog.org/archives/2014/03/


Jason Molenda

(replying to Félix)

@fay59 @saagar fake news, lldb has an optimized stack walker specifically to handle inf recursion crashes well; I think the most stack frames you can get with std main thread stack size is ~500k frames; lldb can walk that in 5.5 seconds on my m4 max desktop. I mean unlimited stack means really infinite recursion crash ofc, 500k is just the start of what you could do in that env.

Jason Molenda

(replying to Jason Molenda)

@fay59 @saagar (if you have lldb formatting argument variables for each stack frame, that’s gonna take longer of course - lots of memory reads and type formatters. but just looking at “lldb has enumerated all stack frames, and knows the pc values with symbol name and debug info for each”, 5-6 seconds max.)

Félix

(replying to Jason Molenda)

@jasonmolenda @saagar I don’t stack overflow all that much but I recall at least Xcode not being very good at it. maybe I’m unjustly blaming lldb for it

Jason Molenda

(replying to Félix)

@fay59 @saagar to be fair, in the early days I’d written lldb’s register tracking up & down the stack with a recursive algorithm and you can guess what happened next.


Saagar Jha

(replying to Daniel Kochmański)
@jackdaniel I wish but the current RAM prices may make this difficult

Daniel Kochmański

(replying to Saagar Jha)

@saagar that's why we should go only forward with the stack, then the beginning can be garbage collected (and no, I don't like scheme _that_ much)


Saagar Jha

(replying to Saagar Jha)
I’m sick of ruining perfectly good recursive code because “iT mIgHt StAcK oVeRfLoW”. Dude I have endless virtual address space. If I put all this on the heap it would work just fine. Figure it out
3 replies →
3 replies

Félix

(replying to Saagar Jha)

@saagar enjoy accidental infinite recursion eating all of your RAM

2 replies →
2 replies

methoxyf

(replying to Félix)

@fay59 @saagar is this a post about firefox


Saagar Jha

(replying to Félix)
@fay59 If you’ve got a bug in your loop the memory’s got to come from somewhere be it recursive or not

Félix

(replying to Saagar Jha)

@saagar also enjoy the debugger taking 15 minutes to give you a backtrace when you stop your process by hand

2 replies →
2 replies

Saagar Jha

(replying to Félix)
@fay59 This sounds like something a debugger should know how to solve

Andy Wingo

(replying to Saagar Jha)

@saagar @fay59 there are solutions to all of these problems wingolog.org/archives/2014/03/


Jason Molenda

(replying to Félix)

@fay59 @saagar fake news, lldb has an optimized stack walker specifically to handle inf recursion crashes well; I think the most stack frames you can get with std main thread stack size is ~500k frames; lldb can walk that in 5.5 seconds on my m4 max desktop. I mean unlimited stack means really infinite recursion crash ofc, 500k is just the start of what you could do in that env.

Jason Molenda

(replying to Jason Molenda)

@fay59 @saagar (if you have lldb formatting argument variables for each stack frame, that’s gonna take longer of course - lots of memory reads and type formatters. but just looking at “lldb has enumerated all stack frames, and knows the pc values with symbol name and debug info for each”, 5-6 seconds max.)

Félix

(replying to Jason Molenda)

@jasonmolenda @saagar I don’t stack overflow all that much but I recall at least Xcode not being very good at it. maybe I’m unjustly blaming lldb for it

Jason Molenda

(replying to Félix)

@fay59 @saagar to be fair, in the early days I’d written lldb’s register tracking up & down the stack with a recursive algorithm and you can guess what happened next.


Marin Todorov

(replying to Saagar Jha)

@saagar but what about all these people who have this question on their coding interview list, imagine the amt of manhours to replace it with new one... think about the economy and productivity 😱


Jesse Wilson

(replying to Saagar Jha)

@saagar or abuse your favorite language’s async feature

Kotlin:

suspend fun sum(a: UInt, b: UInt): UInt {
enableDeepRecursion()
if (a == 0) return b
return sum(a - 1, b + 1)
}

suspend fun enableDeepRecursion() {
yield() // ✨
}

Saagar Jha

(replying to Jesse Wilson)
@jessewilson Yeah it’s funny that you can basically just make languages do this inefficiently if you want but you can’t get them to do it efficiently

Saagar Jha

Hot take: program stacks should be (more or less) infinite
6 replies →
6 replies

Andy Wingo

(replying to Saagar Jha)

@saagar preach!


Daniel Kochmański

(replying to Saagar Jha)

@saagar more infinite! not less! ;)

Saagar Jha

(replying to Daniel Kochmański)
@jackdaniel I wish but the current RAM prices may make this difficult

Daniel Kochmański

(replying to Saagar Jha)

@saagar that's why we should go only forward with the stack, then the beginning can be garbage collected (and no, I don't like scheme _that_ much)


Michel Schinz

(replying to Saagar Jha)

@saagar Hotter take: there should be no stack, activation frames should be allocated from the heap like everything else.

Saagar Jha

(replying to Michel Schinz)
@michelschinz Yes and that heap is a bump arena


shac ron ₪‎

(replying to Saagar Jha)

@saagar Embedded systems say no

Saagar Jha

(replying to shac ron ₪‎)
@shac Embedded systems also say no to heaps often

Phairupegiont

(replying to Saagar Jha)

@saagar Hotter counter-take: recursion is control flow obfuscation, it gives up the benefits of structured programming.

Ocaml was right to require explicit marking of recursive functions, so that we can know most of the code is free of this danger

Saagar Jha

(replying to Saagar Jha)
I’m sick of ruining perfectly good recursive code because “iT mIgHt StAcK oVeRfLoW”. Dude I have endless virtual address space. If I put all this on the heap it would work just fine. Figure it out
3 replies →
3 replies

Félix

(replying to Saagar Jha)

@saagar enjoy accidental infinite recursion eating all of your RAM

2 replies →
2 replies

methoxyf

(replying to Félix)

@fay59 @saagar is this a post about firefox


Saagar Jha

(replying to Félix)
@fay59 If you’ve got a bug in your loop the memory’s got to come from somewhere be it recursive or not

Félix

(replying to Saagar Jha)

@saagar also enjoy the debugger taking 15 minutes to give you a backtrace when you stop your process by hand

2 replies →
2 replies

Saagar Jha

(replying to Félix)
@fay59 This sounds like something a debugger should know how to solve

Andy Wingo

(replying to Saagar Jha)

@saagar @fay59 there are solutions to all of these problems wingolog.org/archives/2014/03/


Jason Molenda

(replying to Félix)

@fay59 @saagar fake news, lldb has an optimized stack walker specifically to handle inf recursion crashes well; I think the most stack frames you can get with std main thread stack size is ~500k frames; lldb can walk that in 5.5 seconds on my m4 max desktop. I mean unlimited stack means really infinite recursion crash ofc, 500k is just the start of what you could do in that env.

Jason Molenda

(replying to Jason Molenda)

@fay59 @saagar (if you have lldb formatting argument variables for each stack frame, that’s gonna take longer of course - lots of memory reads and type formatters. but just looking at “lldb has enumerated all stack frames, and knows the pc values with symbol name and debug info for each”, 5-6 seconds max.)

Félix

(replying to Jason Molenda)

@jasonmolenda @saagar I don’t stack overflow all that much but I recall at least Xcode not being very good at it. maybe I’m unjustly blaming lldb for it

Jason Molenda

(replying to Félix)

@fay59 @saagar to be fair, in the early days I’d written lldb’s register tracking up & down the stack with a recursive algorithm and you can guess what happened next.


Marin Todorov

(replying to Saagar Jha)

@saagar but what about all these people who have this question on their coding interview list, imagine the amt of manhours to replace it with new one... think about the economy and productivity 😱


Jesse Wilson

(replying to Saagar Jha)

@saagar or abuse your favorite language’s async feature

Kotlin:

suspend fun sum(a: UInt, b: UInt): UInt {
enableDeepRecursion()
if (a == 0) return b
return sum(a - 1, b + 1)
}

suspend fun enableDeepRecursion() {
yield() // ✨
}

Saagar Jha

(replying to Jesse Wilson)
@jessewilson Yeah it’s funny that you can basically just make languages do this inefficiently if you want but you can’t get them to do it efficiently

Saagar Jha

You know you’re in for a good time when you’re working on something in an area you’re unfamiliar in, wonder how a specific edge case is handled by other implementations, and find out the answer is “they don’t lmao”

Félix

(replying to Saagar Jha)

@saagar it’s always that


Saagar Jha

(replying to U+002C)
@cb Apple Pencil with USB-C, of course

U+002C

(replying to Saagar Jha)

@saagar supports pencil gen 1 and pencil pro, but not gen 2 and type c

Der Teilweise

(replying to U+002C)

@cb @saagar Sorry, you need the Apple Pencil Touch (works with Mac Touch but does not with iPads, loads via iPod connector on the side.)


Saagar Jha

A trackpad or mouse, riiiiiight…
Cropped screenshot of the Notes “What’s New” sheet in macOS 27.2 beta

What’s New in Notes

[pencil icon]
Drawing on Mac
Add sketches and handwritten notes using a trackpad or mouse.
5 replies →
5 replies

U+002C

(replying to Saagar Jha)

@saagar getting punked when it turns out it's apple pencil on the trackpad instead of a touchscreen mac

Saagar Jha

(replying to U+002C)
@cb Apple Pencil with USB-C, of course

U+002C

(replying to Saagar Jha)

@saagar supports pencil gen 1 and pencil pro, but not gen 2 and type c

Der Teilweise

(replying to U+002C)

@cb @saagar Sorry, you need the Apple Pencil Touch (works with Mac Touch but does not with iPads, loads via iPod connector on the side.)


Keith Lang

(replying to Saagar Jha)

@saagar Macbook Duo?


J.V.B.

(replying to Saagar Jha)

@saagar obviously to sell more hardware the touchscreen version will be a sidecar exclusive so you have to buy an ipad on top of a mac


Mieszko Ślusarczyk

(replying to Saagar Jha)

@saagar @stroughtonsmith or casually using sidecar of course


Pekka Salonen

(replying to Saagar Jha)

@saagar While this is a feature for future righteousness (which I am holding my breath for) it does (mostly) fix the glaring omission for Macs with drawing displays today. Whether it’s a Sidecar iPad or an adult-sized drawing monitor.


Saagar Jha

(replying to U+002C)
@cb No it’s better


Saagar Jha

Not sure why I’d want to but OK
Screenshot of System Settings on macOS, showing the AppleCare & Warranty in the background. Above it is a sleet that says “Extend Coverage with AppleCare” “AppleCare extends your hardware coverage and adds protection for accidents like drops and spills. Your device may require a check to make sure it is in good condition and free of damage.” and below this is a long privacy disclaimer notice, with three buttons: “Decline Offer”, “Cancel”, “Continue”. On top of this is an alert that reads “Session Ended” and “You can start a new session in Settings > General > AppleCare & Warranty” with a single button: “OK”.
2 replies →
2 replies

Paul Haddad :tapbots_logo:

(replying to Saagar Jha)

@saagar I can't get that stupid expiration warning thing to go away on any of my machines, keeps asking me over and over even though I decline. I guess just have to wait out the next 15 days.


Oliver Hunt

(replying to Saagar Jha)

@saagar you don't want more sessions? everyone loves sessions!