Saagar Jha

Every argument about undefined behavior in a nutshell
27 replies →
27 replies

Renaud Lienhart

(replying to Saagar Jha)

@saagar how many hours did you spend making this. This is amazing.

Saagar Jha

(replying to Renaud Lienhart)
@layoutSubviews idk like 45 minutes? Most of it was laying out text by hand because I thought that it would be faster than figuring out how srt works
2 replies →
2 replies

Graham Sutherland / Polynomial

(replying to Saagar Jha)

@saagar @layoutSubviews to save yourself time on the next video: SRT is just a text file with lines containing a timestamp range followed by the subtitle text to be displayed during that time. there are a ton of free tools for creating them on a timeline, too.

Saagar Jha

(replying to Graham Sutherland / Polynomial)
@gsuberland @layoutSubviews Yeah this ended up being a mistake

Saagar Jha

(replying to Nicolás Alvarez)
@nicolas17 @layoutSubviews you know I use a Mac :(

Adam Demasi

(replying to Saagar Jha)

@saagar @nicolas17 @layoutSubviews all that tells me is it’s time for you to install the Qt build tools 🙃

Saagar Jha

(replying to Adam Demasi)
@kirb @nicolas17 @layoutSubviews Did that once. Never again

jonpalmisc

(replying to Saagar Jha)

@saagar @kirb @nicolas17 @layoutSubviews what’s so bad about them?

Saagar Jha

(replying to jonpalmisc)

Jean-François Geyelin

(replying to Saagar Jha)

@saagar holy mother of god this is good


StarkRG@myside-yourside.net

(replying to Saagar Jha)

@saagar Also, even if it worked well every time (which it doesn't) garbage collection is a crutch for lazy coding. Just delete stuff when you're done with them.

Saagar Jha

(replying to StarkRG@myside-yourside.net)
@StarkRG I would simply not use anything

coolbutuseless

(replying to Saagar Jha)

@saagar Brilliant!


Steven Lawson Photography

(replying to Saagar Jha)

@saagar I don't understand much of the terminology but this is pure genius! 😂

Saagar Jha

(replying to Steven Lawson Photography)
@stevenlawson Consider yourself fortunate

shac ron ₪‎

(replying to Saagar Jha)

@saagar LLVM dev enters his apartment after a long day at work and is surprised to find the entrance to his kitchen replaced with a brick wall. He calls his landlord, asking what happened. Landlord says the lease specified a 2 bedroom apartment, no mention of a kitchen, so she optimized it out. But don’t worry, she’ll be back tomorrow for the living room.

Allison Husain

(replying to shac ron ₪‎)

@shac @saagar the brick wall is merely a curtesy, he's lucky she didn't just delete it and let him fallthrough to whatever was below!

Pierre H.

(replying to Allison Husain)

@ezhes_ @shac @saagar too soon


Ye Lin Aung :verified:

(replying to Saagar Jha)

@saagar this is too good!


benstiglitz

(replying to Saagar Jha)

@saagar we watched the original last night so I can hear Nicholson as the voice of LLVM in my head perfectly…which means Kiefer Sutherland is Clang?

Saagar Jha

(replying to benstiglitz)
@stig I haven’t actually watched the movie so I wouldn’t know

Brian Kung

(replying to Saagar Jha)

@saagar I didn't actually watch this movie so I thought the captions were verbatim xD

Saagar Jha

(replying to Brian Kung)
@briankung I haven’t watched the movie either so I really have no idea what they’re talking about

Andrew Pontious

(replying to Saagar Jha)

@saagar @briankung I have watched the movie.

Trust me, this is *gold*.


Wolf480pl

(replying to Saagar Jha)

@saagar
> I'll delete a thousand bounds checks before I let this code be slow


Damien Sorresso

(replying to Saagar Jha)

@saagar @shac "Well can I have a compiler flag that just turns off that optimization?"

"NO THEN EVERYONE WOULD USE IT."

Saagar Jha

(replying to Damien Sorresso)
@enhancedscurry @shac What, you didn’t like -O0?

Damien Sorresso

(replying to Saagar Jha)

@saagar @shac I'd really just like a -fplease-preserve-my-stack-trace-i-beg-you


Kit Rhett Aultman

(replying to Saagar Jha)

@saagar this is true perfection


Brian Dear

(replying to Saagar Jha)

@saagar

That was good.


Leonardo

(replying to Saagar Jha)

@saagar i can hear their Jack Nicholson screaming in my head


carrickdb

(replying to Saagar Jha)

@saagar I hope @fugueish has seen this


enterprisey

(replying to Saagar Jha)

@saagar bounds checks have a negligible performance impact in many use cases and even when they don't, they're still extremely worth it news.ycombinator.com/item?id=3

Saagar Jha

(replying to enterprisey)
@enterprisey I am very much on the side of near-universal bounds checks

Kevin Chadwick

(replying to Saagar Jha)

@saagar @enterprisey
@filippo

Ada is probably the fastest safest language on the planet. The ranged type system actually means that bounds checks can be elided in more cases than other languages. It can also ensure that a program never crashes better than any other and it isn't a difficult language to use.

"learn.adacore.com"


Rob Ricci

(replying to Saagar Jha)

@saagar This got linked in our faculty slack, and if that isn't the definition of viral I don't know what is

Rob Ricci

(replying to Rob Ricci)

@saagar Like, all I saw in the slack notification was your name, and I immediately knew what it was

Saagar Jha

(replying to Rob Ricci)
@ricci You can say you knew me before I was famous

Rob Ricci

(replying to Saagar Jha)

@saagar I've never seen this person in my life, officer


Ted Spence

(replying to Saagar Jha)

@saagar This is quite intensely appropriate


Jon

(replying to Saagar Jha)

@saagar this is great!


Ted Faber

(replying to Saagar Jha)

@saagar
That was created by a person who has been badly hurt by LLVM
@ricci


Ted Faber

(replying to Saagar Jha)

@saagar
And, for the record, LLVM should go to jail for it
@ricci


Severák

(replying to Saagar Jha)

@saagar you did a great job with subtitling this scene!


Hugo Devillers

(replying to Saagar Jha)

@saagar I love this

also I'm unironically on Kernel LLVM's side, YOU CAN'T HANDLE THE TRUTH (seriously just write your stuff in a memory-safe language if you dislike having to deal with UB)


ketchup71

(replying to Saagar Jha)

@saagar I’m getting mixed vibes here, knowing the source movie… 😁


Sander van Kasteel

(replying to Saagar Jha)

@saagar I am instantly reminded of this beauty...

youtube.com/watch?v=HaDfMjzroS


Peter Ludemann

(replying to Saagar Jha)

@saagar
I worked on an early digital telephone switch (at a competitor to Bell Labs), using a safe language with bounds checking. We estimated that the bounds checking cost us ~5-10% performance, and that it was a worthwhile price to pay for reliability -- what good is your performance boost if it's causing system crashes?

A few decades later, I see that Go (by someone from Bell Labs) has "invented" similar slices (I wonder if its compiler is as good as ours was at safely removing unneeded bounds checks).

Saagar Jha

(replying to Peter Ludemann)
@PeterLudemann Look I’ll gladly take a 5-10% performance hit *and* system crashes

Peter Ludemann

(replying to Saagar Jha)

@saagar You forgot to include integer overflow, for also getting wrong results; and as a bonus, hinders optimisations.
mastodon.social/@regehr/111308

Saagar Jha

(replying to Peter Ludemann)
@PeterLudemann I’ll take another 5% and crashes for that too

Richard Hendricks

(replying to Saagar Jha)

@saagar Oh god, I feel this in my soul. Trying to support multiple compilers for a product is a special level of hell.