Bit Bashing
bitbashing.io · Personal blog · on HN since 2015
Bit Bashing is a programmer's blog on systems languages like C++, Rust, and D, along with floating point, concurrency, and TeX.
What HN saysHN commenters link it for opinionated language posts, notably on async Rust and floating-point comparison, though one calls the float article weak beyond simple cases.
32HN people shared it
10linked it in comments
29stories submitted
1.7Kstory points
5 months agolast shared
2015people per year2026
Most-shared posts
- 1Std::visit is everything wrong with modern C++8 people · 324 points · first shared 2017 · 232 comments on HN
- 2Garbage collection for systems programmers (2023)5 people · 424 points · first shared 2023 · 267 comments on HN
- 3Comparing Floating-Point Numbers Is Tricky (2017)5 people · 166 points · first shared 2017 · 108 comments on HN
- 4D is like native Python5 people · 29 points · first shared 2015 · 2 comments on HN
- 5Async Rust Is A Bad Language3 people · 45 points · first shared 2023 · 4 comments on HN
- 6TeX: A Tale of Two Worlds3 people · 37 points · first shared 2017 · 2 comments on HN
- 7Shipping Culture Is Hurting Us2 people · 232 points · first shared 2015 · 162 comments on HN
- 8Concurrency in Haskell: Fast, Simple, Correct1 people · 193 points · first shared 2025 · 125 comments on HN
- 9C++ on Embedded Systems1 people · 178 points · first shared 2017 · 83 comments on HN
- 10Unsafe at Any Speed: Tradeoffs and Values in the Rust Ecosystem1 people · 59 points · first shared 2024 · 38 comments on HN
- 11Time Between The Lines: how memory access affects performance (2015)1 people · 11 points · first shared 2025 · 3 comments on HN
- 12Be lazy. Use ranges1 people · 3 points · first shared 2015 · discussion on HN
- 13Simulating Airband AM Radios1 people · 3 points · first shared 2026 · discussion on HN
- 14In defense of smoke tests1 people · 2 points · first shared 2015 · discussion on HN
- 15Homepage1 people · first shared 2017
What HN people wrote when they linked it
fulafel · 2025-10-04
Async in Rust isn't exactly universally loved, partly because async Rust is perceived to spread progressively to Rust libraries making it less optional to use. See eg https://bitbashing.io/async-rust.html, "Async Rust Is A Bad Language"
Xeamek · 2024-02-04
>more modern and less dangerous language than most people think
Compared to what? Itself from 20 years ago? That's great, but not nearly enough. Cpp just has SO MUCH FRICTION that it's simply not worth it to deal with it. Maybe if you have 20yrs of cpp experience and carved out a specific way for yourself to avoid all of it while still being productive... But that's not really an argument.
And sure, there are still some cases when the alternatives aren't ideal either (ie. Rust also having friction, especially in domain like games, or higher level languages being too slow). But cpp has so much downsides I don't see why should one ever default into choosing cpp, unless you REALLY care about the benefits it brings. But those upsides are usually external (ie. ecosystem), rather then features of the language itself
https://bitbashing.io/std-visit.html
zem · 2021-01-02
D is also worth a look as a compiled C- family language that can read like python. https://bitbashing.io/2015/01/26/d-is-like-native-python.html
zeotroph · 2020-06-24
That does not give you destructuring though, so to distinguish different variants of the same type you are left with a classic `if` inside the lambda.
Also this has "language support" in the sense that it is (again) implemented via template meta programming, i.e. the compile time is impacted quite heavily.
See "std::visit is everything wrong with modern C++": https://bitbashing.io/std-visit.html
This standards proposal would add proper match (named, of course, inspect) support: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0095r1.html
cdavid · 2022-03-30
This is not a very good article, and I would not recommend it beyond simple use cases. The problem is that there is no right way, it depends on the usecase and the magnitude of numbers you're comparing. See e.g. https://bitbashing.io/comparing-floats.html as a better referenc.
The fundamental difficulty of comparing floats is that the format ensures a near constant number of digit of precision regardless of the scale. This is very useful for most calculations because it means you can calculate without worrying too much about the amplitude of your numbers. But it means that the smallest representable difference between two numbers gets bigger as numbers get bigger: that's why they are called floating point.
That's why using tolerance, etc. is not so reliable: because the tolerance will depend on the magnitude of the numbers, even by doing those simple tricks. In particular, it is important to understand epsilon is only "correct" around 1, i.e. a + eps != a is only true of a is close to 1. More precisely, epsilon is the smallest number such as 1 + eps != 1.
colejohnson66 · 2021-02-24
“Modern C++” is very powerful, but also incredibly frustrating. Take std::variant/std::visit (sum types) for example.[0] Getting the value out is way more complicated than Rust. And if you mess up, expect an indecipherable multi-dozen line error message!
[0]: https://bitbashing.io/std-visit.html
mlthoughts2018 · 2018-05-20
I won’t be able to address all the points. But in my experience, C++ has been going in the wrong direction in terms of simplicity or productivity. Modern C++ is drastically more complicated and riddled with deep esoterica. The flexibility benefit modern Python gives is probably more like 1000x, further mitigating many cases when there are concerns about the flexibility/performance trade-off.
Just for one example about what I mean with modern C++: < https://bitbashing.io/std-visit.html >.
This example is relevant because you mentioned you feel you never need Python’s flexibility in the day to day. But in Python (much like in many functional languages), the entire idea of the visitor pattern can be boiled down to map() —- just one function call! If you want to specialize this for your own data type, you can very easily implement the iterator protocol, often simple __iter__, __getitem__, and __next__, which themselves could use e.g. numba to iterate some homogeneously typed tree class with pure C performance characteristics, or a sum type (like with Cython fused types) as in the std::visit example, etc.
The point is that the data model’s flexibility makes this trivial, rather than convoluted. In the cases when I’d care about this pattern, it would be no contest that Python offers hugely improved productivity.
So it’s not just naive flexibilty of modifying object instances, but the bigger picture of flexibility in the data model overall.
simias · 2017-10-11
I wonder if C++ is headed for COBOL-ification. This article is very interesting but doesn't really give any hope for success in implementing a modern module system in C++.
I feel like the only way to have truly useful, simple and intuitive modules in C++ would involve breaking a certain amount of backward compatibility and force a few constraints (project layout, file naming scheme, build system, ...) on the user. But clearly that's not really in C++'s DNA and you risk ending up with something that's not quite C++ while at the same time not having the simplicity and elegance of modern languages that have been designed from scratch without all the baggage C++ carries.
C++ won't go away any time soon, that's for sure. But when I read articles like TFA or for instance https://bitbashing.io/std-visit.html my gut reaction is always that maybe if you get frustrated with C++'s extreme complexity, historical baggage and user-unfriendliness you should consider moving to something else instead of trying to bolt on even more exotic features on a language which is already crumbling under the weight of all the features and programing styles it already supports. I know I did.
As an example I stumbled upon this std::visit link by perusing the top posts of reddit's /c/cpp (linked by TFA), here's the discussion: https://www.reddit.com/r/cpp/comments/703k9k/stdvisit_is_everything_wr…
There's an interesting thread about how:
variant<string, int, bool> mySetting =…
Arcsech · 2017-07-24
Here's a dump of the "Programming" folder from my RSS reader:
Aphyr's (aka the guy behind the Jepsen distributed system test series): https://aphyr.com/
Fred Herbert, the author of Learn You Some Erlang: http://ferd.ca/
Eevee, who posts a mishmash of stuff about programming in general but these days is mostly focussed on games: https://eev.ee/
Tef/Programming is Terrible, which features strong opinions about programming/programmers: http://programmingisterrible.com
Matt Kline, who posts mainly about low-level stuff and embedded systems: http://bitbashing.io/
Evan Miller, whose blog topics are wide-ranging: http://www.evanmiller.org/
tptacek, who can be seen tirelessly defending common sense in the comments on this very site: https://sockpuppet.org
Sonniesedge, who talks about front-end stuff and the human impact of programming: https://sonniesedge.co.uk/blog/
Carin Meier, who posts most often, but not exclusively, about Clojure: http://gigasquidsoftware.com/
Also Julia Evans, as mentioned in the OP.
giancarlostoro · 2016-11-08
Let me point out two alternatives:
Cython which is very Pythonic looking, and compiles to C and produces amazing projects including UVLoop which is a drop-in module for asyncio for Python 3 that will speed up asyncio:
https://magic.io/blog/uvloop-blazing-fast-python-networking/
https://github.com/MagicStack/uvloop
Note how GitHub claims it's all mostly Python code ;) That's because Cython like I said looks Pythonic.
There's other examples, but I think this is one of the one's that come to mind the most to me.
There's also D which is called Native Python by some (unlike projects like Go and Rust, you can have your Object Oriented Programming (optional like in C++), and concurrency / parallelism too and other goodies like built-in unit testing, when you compile your code your unit tests are ran but not included in the final binary):
http://bitbashing.io/2015/01/26/d-is-like-native-python.html
https://blog.experimentalworks.net/2015/01/the-d-language-a-sweet-spot…
If it's been more than a few years since you've evaluated D you might want to check it out again, it may be worth your time. D is a language I knew about for years, and recently is where I've come to appreciate it for it's many features.
D has things like array slicing, [OPTIONAL] Garbage Collection, an amazing Web Framework called Vibe.d with it's own template engine called Diet-:
http://vibed.org/
https://vibed.org/blog/posts/introducing-diet-ng
Things I like is Vibe.d is not just a…