George Haidar's Avatar

George Haidar

@disintegrator.dev.bsky.social

Confused and coding. Building code generators @speakeasy.com.

134 Followers  |  463 Following  |  150 Posts  |  Joined: 09.09.2023  |  1.9748

Latest posts by disintegrator.dev on Bluesky

Ghostty is great but I am too reliant on iTerm's tmux integration so I'm switching back for now :|

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

Since we're not going to get keyword arguments in @golang.org in the foreseeable, I've become very invested in using type definitions to "brand" common types in our codebase e.g. string, int, uuid.UUID and so on...

15.05.2025 21:58 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Clean room tests with JavaScript's `using` keyword And a slick approach to test encapsulation when you need a database

I think it has super interesting uses that were tedious to pull off in the past. Here’s one way I take advantage of it.

blog.disintegrator.dev/posts/clean-...

05.05.2025 11:11 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Running scripts | uv A guide to using uv to run Python scripts, including support for inline dependency metadata, reproducible scripts, and more.

It would be so cool if @pnpm.io could support single file scripting the same way `uv` does including specifying dependencies in at the top of the script file.
docs.astral.sh/uv/guides/sc...

20.04.2025 15:43 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

There are 2 kinds of structs in a codebase: 1. structs that act as configuration/options for components in the system and 2. structs that carry state to/from DBs, to/from http endpoints, etc... In the case of 1. there is some affordance for unset fields but with 2. it can be really bad to miss one.

15.04.2025 13:21 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Consider what happens to code shown below when a new field is added to the ProductResult struct. To compound the problem, imagine a larger codebase where you're creating `ProductResult` values in a few places. Similarly imagine adding a field to `Product` and forgetting to fill it out before INSERT.

15.04.2025 13:11 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I now firmly believe that the zero value concept for structs in @golang.org does more harm than good and have taken to running the exhaustruct linter through golangci-lint to prevent me from ever accidentally relying on it. I might write a post about this some day.

15.04.2025 12:50 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Incredible pun. Hat tip and 🫑.

15.04.2025 12:45 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Pleas hire Adam so he can keep making incredibly content and educate the rest of us. If I’m at all good at CSS, it’s because of him.

11.04.2025 19:18 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
proposal: spec: anonymous struct literals Β· Issue #35304 Β· golang/go Currently it is not possible to write a struct literal without mentioning its type (with the exception of struct literals in map and slice composite literals). This can make it extraordinarily hard...

I actually have a proposal for something like that. github.com/golang/go/is...

07.04.2025 21:58 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

Oh my, that is spot on haha! Thanks for sharing :)
Here's hoping it gets more eyes.

07.04.2025 22:15 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Code snippet:

foo := {
  "Name": "Georges",
  "Employer": "Speakeasy",
}

type Person struct {
  Name     string
}

type Employee struct {
  Name     string
  Employer string
}

p := foo.(Person)
e := foo.(Employee)

fmt.Println(p.Name, e.Employer)
// all good

Code snippet: foo := { "Name": "Georges", "Employer": "Speakeasy", } type Person struct { Name string } type Employee struct { Name string Employer string } p := foo.(Person) e := foo.(Employee) fmt.Println(p.Name, e.Employer) // all good

I wonder if Go could benefit from object literal syntax that can be late-bound (if that's even a word) #golang

07.04.2025 20:00 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

- Classes are confusing when used as types. Not nominally typed and you can mistakenly pass a compatible literal object.
- Classes cannot be augmented like interfaces iirc.
- Far easier to discriminate union of classes than union of object types that don’t have a natural discriminator key.

26.03.2025 21:42 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

No corepack? No problem, mise and aqua are here to make life easier. You can have different versions in different repos and mise will switch to the right ones automatically. And I haven't gone into how useful mise tasks are - so much better than `make` and npm scripts.

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

I love the evolution of projects like TanStack Query where stewardship is shared/passed over to deeply aligned & invested folks. The way Query passed hands from Tanner to Dominik and the project only continued to thrive is inspiring. similar great examples on the Vue/Vite/VoidZero side of the world.

19.03.2025 12:59 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I thought about this and I couldn’t come up with an example where open governance wasn’t ceased by big players or used to greatly slow down progress on an otherwise great project. I also don’t think I’m looking hard enough for counter-examples. To me @tanstack.com is setting an important standard.

19.03.2025 12:54 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

That’s actually genius hahaha

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

Amazing… One of our competitors just copies our docs for features we’ve built and they haven’t yet. Basically selling through.

18.03.2025 23:26 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Excitement intensifies!!!

06.03.2025 09:36 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Who’s the best Python developer you know that’s looking for a job? You know… the sort that sets all
linters to strictest and has their finger on the pulse of the ecosystem. I want to meet them.

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

Waaaaaait what? Are we going to be able to support SSE APIs and various AI libraries with this?

06.03.2025 02:08 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@dr-axel.de you might find this interesting after your recent post on enums too πŸ™‚

02.03.2025 17:11 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
An ode to TypeScript enums Pouring one out for a fallen friend

I wrote about the main feature of @typescriptlang.org enums that I'm going to miss: TSDoc support on enum members. I hope the TypeScript team can port this over to union members as more folks migrate towards string unions instead of enums.

blog.disintegrator.dev/posts/ode-to...

02.03.2025 17:11 β€” πŸ‘ 20    πŸ” 4    πŸ’¬ 2    πŸ“Œ 0
Screenshot of the Exhaustiveness Checks section of Axel's blog post on TypeScript Enums

Screenshot of the Exhaustiveness Checks section of Axel's blog post on TypeScript Enums

A great tip with exhaustiveness checks using switch blocks is to add a `value satisfies never;` expression to the default branch. This adds a compile time check and you'll spot that you missed a case in your IDE. Demo:
tsplay.dev/w2y48W

01.03.2025 11:43 β€” πŸ‘ 5    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

The Event Destinations Initiative is a community effort aimed at creating a model for event interoperability between event producers and their consumers.

27.02.2025 14:19 β€” πŸ‘ 7    πŸ” 2    πŸ’¬ 1    πŸ“Œ 1

I love TypeScript so effing much. I’m laughing so hard at the commitment to the bit.

26.02.2025 23:50 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I did this with `uvx posting` yesterday and it was soooo magical!

26.02.2025 21:34 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Oh and if I recall correctly, @thedsp.bsky.social mentioned that he worked on LSPs before creating MCP so there's lineage there I guess.

26.02.2025 11:36 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
arktype/ark/attest at main Β· arktypeio/arktype TypeScript's 1:1 validator, optimized from editor to runtime - arktypeio/arktype

Maybe @ssalbdivad.dev can tell you more about @ark/attest

github.com/arktypeio/ar...

26.02.2025 09:43 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

It’s such a small spec that it’s easy to pass over it in many instances but, when building a protocol, it’s a nice choice to lean on and focus on the actual messages that make up a protocol instead of having to invent another envelope format.

26.02.2025 09:35 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@disintegrator.dev is following 20 prominent accounts