Daniel Hooper's Avatar

Daniel Hooper

@danielchooper.bsky.social

Graphics, low-level, and game programmer. Made www.principle.app. Former Apple Engineer. https://danielchasehooper.com

291 Followers  |  67 Following  |  50 Posts  |  Joined: 06.02.2024  |  1.9583

Latest posts by danielchooper.bsky.social on Bluesky

It’s got a consistent ~1200 monthly active users. Don’t know how many finish each puzzle, but it seems like a lot of people play (and finish) every day

19.07.2025 04:37 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

The header technique described towards the beginning of my article is effectively that.

09.07.2025 10:08 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

Ok, here's the new way I recommend to do type safe generics in C.

It's cleaner compared to my old function-pointer-cast approach, avoids the undefined behavior everyone is so paranoid about, and doesn't require typeof()

01.07.2025 05:18 β€” πŸ‘ 5    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0
Video thumbnail

Hacked together a weird spiral Mario game prototype

30.06.2025 23:08 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I haven't, thanks for the link.

I used to do that too, but it became problematic in a large, long lived, multi-engineer codebase

30.06.2025 22:00 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

New Post: How I Write Type Safe Generic Data Structures in C
danielchasehooper.com/posts/typech...

30.06.2025 16:37 β€” πŸ‘ 19    πŸ” 3    πŸ’¬ 1    πŸ“Œ 0

As a precursor to public key cryptography, William Jevons said in 1874 "What two numbers multiplied together produce 8616460799? I think it unlikely that anyone but I will ever know"

Modern computers find the answer in 0.004s: primes 89681 and 96079

Cool for the time, just needed bigger numbers!

04.06.2025 16:11 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

I like this comment in the source of /usr/bin/dtruss. It provides context with a "Hey dorks, don't mess with my code" kind of energy.

03.06.2025 23:48 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Weird time to be someone that likes making tools

30.05.2025 16:51 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Haha so true!

29.05.2025 01:42 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Not a good sign when fixing a bug requires editing a file with this at the top

21.05.2025 15:32 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

This was written by a filmmaker about color science, but it applies just as well to the software industry's dependency problem

15.05.2025 17:40 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Support Alpha blending in sokol_gl.h by danielchasehooper Β· Pull Request #1266 Β· floooh/sokol sokol_gl's api accepts colors with alpha, so blending should probably be enabled

I ended up doing this: github.com/floooh/sokol...

15.05.2025 02:08 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

Github needs this notification option

Tired of getting pinged every time a random person adds their two cents to a Github issue I follow.

14.05.2025 19:58 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I've had that sitting on my games shelf for years but haven't played it, maybe I never will now!

14.05.2025 15:24 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@flohofwoe.bsky.social Is there a trick to get alpha blending working in sokol-gl, or does that require making my own pipeline?

aka:
sgl_begin_triangles();
sgl_c4b(255, 0, 0, 127);
...
sgl_end();

13.05.2025 21:18 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

It’s wild that iOS still doesn’t have a β€œlock orientation *except videos*” mode

05.05.2025 15:27 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

That was really nice. I recently realized I haven’t been playing guitar as much I used to, so I’m trying to fix that.

14.04.2025 18:22 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

haha yeah, I wasn’t sure how far to take the meme…could have included micro architecture all the way down to electrons!

14.04.2025 18:04 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

"C is how a computer actually works"

14.04.2025 15:30 β€” πŸ‘ 5    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

TIL that CRT "pixels" can have only a portion illuminated, unlike LCD pixels. (Seen on the top and bottom edge of this 'P')

11.04.2025 04:56 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image Post image

Today I bought an old TV for visual reference. Played Balatro to see how the game's CRT emulation compared to a real Cathode Ray Tube. Sadly details aren't legible on a 13" TV, and the emulation's scanline/phosphor pattern isn't realistic, but it nails the chromatic aberration.

11.04.2025 04:56 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Already exists! β€œSpace” toggles pencil. β€œShift + a number” edits pencil digits regardless of pencil mode.

04.04.2025 02:45 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

The bottom middle 4 and the 8 are disambiguated by the cell to the NE of the center 7 – in other words it has one solution but you made a mistake by filling in the 4/8 cells too early.

Colors don't mean anything.

19.03.2025 22:52 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

135,000 Github projects mention "blazing fast" in the readme, but only 3,000 of those mention "benchmark" or "MB/s".

So in other words, when you read "blazing fast" think "unserious".

17.03.2025 17:49 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

My article titles keep getting longer. I don't know what to make of this.

14.03.2025 14:51 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I never wrote a version that uses `Set`, so I don't know. Coming from C, I just reach for bitmasks first.

13.03.2025 23:05 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Agreed. A sudoku setter contacted me today about creating a cracked sudoku, will post about that when it's done!

13.03.2025 23:03 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

I'd guess that 93.732% of JavaScript devs don't know about bitmasks.

I used them to speed up my sudoku generator.

13.03.2025 22:58 β€” πŸ‘ 9    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I removed dark mode for the puzzle page. Couldn't make a color scheme that was as legible as light mode.

13.03.2025 20:17 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@danielchooper is following 20 prominent accounts