B
Belkadan
belkadan.com · Personal blog · on HN since 2015
Belkadan is Jordan Rose's blog on compilers, Swift, Rust, optimization and language design.
What HN saysCommenters recommend it for the compiler wizard guide and the Swift regrets series, and cite it on Protobuf streaming and Objective-Rust.
40HN people shared it
12linked it in comments
83stories submitted
2.1Kstory points
2 months agolast shared
2015people per year2026
Most-shared posts
- 1So you want to be a compiler wizard (2016)5 people · 445 points · first shared 2016 · 61 comments on HN
- 2CellLVM: A proof-of-concept LLVM to Excel spreadsheet compiler4 people · 298 points · first shared 2023 · 27 comments on HN
- 3Objective-Rust3 people · 212 points · first shared 2020 · 33 comments on HN
- 4Nibblesort: Adventures in Optimization3 people · 12 points · first shared 2015 · 4 comments on HN
- 5Run-Time Polymorphism in Swift3 people · 10 points · first shared 2024 · discussion on HN
- 6Swift was always going to be part of the OS3 people · 9 points · first shared 2022 · discussion on HN
- 7Swift regrets: a programming language design retrospective3 people · 3 points · first shared 2021 · 1 comments on HN
- 8Protobuf Is Almost Streamable (But not really)3 people · 3 points · first shared 2023 · 1 comments on HN
- 9Swift on Mac OS 92 people · 394 points · first shared 2020 · 44 comments on HN
- 10Swift Regrets2 people · 173 points · first shared 2021 · 200 comments on HN
- 11The Biggest Smallest PNG2 people · 141 points · first shared 2024 · 11 comments on HN
- 12My Little Optimization: The Compiler Is Magic (2018)2 people · 24 points · first shared 2018 · 4 comments on HN
- 13Rescuing Files from Classic Mac OS with Swift2 people · 8 points · first shared 2023 · discussion on HN
- 14Dynamic Linking Is Bad for Apps and Static Linking Is Also Bad for Apps2 people · 8 points · first shared 2022 · discussion on HN
- 15Keyboard Pants2 people · 7 points · first shared 2021 · discussion on HN
What HN people wrote when they linked it
tmdh · 2023-10-15
I've been following this excellent book: https://craftinginterpreters.com/
Also read this:
https://belkadan.com/blog/2016/05/So-You-Want-To-Be-A-Compiler-Wizard/
yccs27 · 2022-04-26
Jordan Rose also has the "Swift regrets" series [0] as a retrospective on the language design of Swift. Highly recommend it if you didn't already find it when it was on the front page.
[0] https://belkadan.com/blog/2021/09/Swift-Regrets/
sopooneo · 2025-06-01
I've heard two side the the Protobuf/streaming idea. On my first introduction, it seemed you could. But later reading leads me to believe it is only almost streamable: https://belkadan.com/blog/2023/12/Protobuf-Is-Almost-Streamable/.
* I do acknowledge you qualified the question with "better".
easeout · 2024-10-29
Swift has a lot of features, but you can leave many of them alone to begin with and learn them when you need them. Low-syntax defaults work in a reasonable, streamlined way. SwiftUI will confront you with more syntactic variations than other Swift code, but that's not unusual in a DSL. Overall it's a smooth learning curve due to progressive disclosure in language features.
If Swift compiled five times faster, I would want for very little. But I don't know how they'd walk back the combination of type-based overloading and implicit conversions. See: https://belkadan.com/blog/2021/08/Swift-Regret-Type-based-Overloading/…
favorited · 2023-02-02
I had seen macros to support a quasi-message-send signature from Rust (`let value = [[cls.into() numberWithUnsignedInt:42u32] stringValue];`), but never method implementations!
https://belkadan.com/blog/2020/08/Objective-Rust/
iainmerrick · 2022-09-20
I think that’s actually a positive feature of TypeScript -- a useful limitation. Reflection is generally a bad idea and it’s good to be forced to do without it.
It is a bit annoying sometimes that you can’t have overloaded functions with different types, but in that case you can usually just give the overloads different names, and usually that’s better for readability anyway. (Or if you really want to, write one function and use JS reflection to do the overloading manually) (but you really don’t!)
Here’s an interesting discussion of the overloading question in Swift: https://belkadan.com/blog/2021/08/Swift-Regret-Type-based-Overloading/
johnthuss · 2021-09-23
This is a whole series of articles, and he does address type overloading in one of them, which is maybe what you're looking for.
https://belkadan.com/blog/2021/08/Swift-Regret-Type-based-Overloading/…
wodenokoto · 2021-09-22
This introduction post to the series of swift regrets is placed somewhere in the middle of all the posts.
If you want to read these, it might be easier to start here: https://belkadan.com/blog/tags/swift-regrets/
qznc · 2017-02-10
Here is a plan with more self-sufficient steps: http://belkadan.com/blog/2016/05/So-You-Want-To-Be-A-Compiler-Wizard/
jcr · 2015-07-21
The hanshq.net story is just one of three blog entries that John Regehr linked to yesterday:
http://blog.regehr.org/archives/1242
The other two are:
http://jbeekman.nl/blog/2015/01/nibble-sort/
http://belkadan.com/blog/2015/05/Nibblesort/
mafalda · 2021-09-23
My main takeaway is that Swift is complex and tries to solve many problems. As a result it is going to frustrate almost everyone in one bit or another.
I'm not an expert in the Swift Evolution process but I must praise it in terms of ease of reading. Back when I was invested in learning more about Swift, reading some proposals helped me understand it better. But I believe the Swift team/community will need to define a boundary some time in the future on what must be added or not to the language as its complexity grows. In the long run, even if a proposal makes sense, is implemented and was reviewed, it usually will also add a new thing to the language that implies in a bigger documentation and another way to code/solve a given problem.
In the AnyObject dispatch regret [0], the author wrote "As I’ve mentioned many times (though not so much on this blog), Swift had to be as good as Objective-C at making most Cocoa apps, or people wouldn’t use it no matter how good the new stuff was". My first real contact with Cocoa was while learning Swift and I can imagine all the hard work that was put into it. Then SwiftUI came on together with a bunch of new features to a language that I was still getting used to. After getting frustrated with the lack of documentation (combined with the lack of knowledge about some patterns) and no clear way to solve small problems while studying it, I've decided to dive again into Objective-C to not only grasp most of in one week but also to find that…