Top all-time · #15847
Michal Zalecki
Personal blog · michalzalecki.comprogrammingweb
Michal Zalecki's personal blog at michalzalecki.com covers programming and web. Since 2017, 5 different Hacker News readers have linked it 5 times. It is still writing: the last post was on 2025-09-26, and you can follow it by feed.
Too few sampled comments (4) to say how often HN recommends it.?
Why HN links it
Michal Zalecki's posts cover TypeScript quirks, nominal typing, and RxJS with React. Commenters cite them as sources for points on structural typing, branded types and RxJS patterns, without judging them.
Summarised by Claude from a sample of 4 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- /nominal-typing-in-typescript/2 people · 2 mentions · first linked 2020-03-23
What Hacker News says?
As a long time TypeScript user, I do think this is a design mistake with the language. For example, it breaks instanceof checks. However: - The language primarily uses structural typing. If two classes are compatible, it's not completely unreasonable to expect them to also behave in a structural way (though I would prefer them not to). - Adding a private field to a class makes it work as a nominal type ( https://mic…
Comment linking /nominal-typing-in-typescript/
on “TypeScript’s quirks: How inconsistencies make the language more complex”Submitted TypeScript vs. Flow as a story · 2 points
HN discussionThere are ways to enforce nominal typing in TS [1] type Brand<K, T> = K & { __brand: T } type USD = Brand<number, "USD"> type EUR = Brand<number, "EUR"> const usd = 10 as USD; const eur = 10 as EUR; function gross(net: USD, tax: USD): USD { return (net + tax) as USD; } gross(usd, usd); // ok gross(eur, usd); // Type '"EUR"' is not assignable to type '"USD"'. [1] https://michalzalecki.com/nominal-typing-in-typescript…
Comment linking /nominal-typing-in-typescript/
on “Secure by Design”I don't think you can use _refinement types_ for this, at least not as of now (e.g. you can't do {.requires validEmail(email).}), but you can use distinct types[1] in nim to model what you want: type Email = distinct string Now Email is a type that is incompatible with string, even though its runtime representation is a string (i.e. no additional overhead). To convert a string to an Email, you can call Email("a"). I…
Comment linking /nominal-typing-in-typescript/
on “Prologue: Full-Stack Web Framework Written in Nim”I've been fascinated by approaches like the following: https://michalzalecki.com/use-rxjs-with-react/ Building on top of those ideas I built something a bit more powerful and feature complete than the example in that blog post, but the exact implementation doesn't matter: having RxJS driving the show is really, really cool. Async issues? What async issues?
Comment linking /use-rxjs-with-react/
on “JavaScript Power Tools: Real-World Redux-Saga Patterns”