HNHacker News
TopNewBestAskShowJobs

Decabytes

3,924 karma · joined September 20, 2017

I have a blog called "Deus In Machina" on Substack to improve my writing. If you check it out, I hope you enjoy your time at the digital hearth :)

https://www.deusinmachina.net/

submissionscomments
Decabytes··on How memory safety CVEs differ between Rust and C/C++
Bjarne Stroustrup was recently interviewed by Ryan Peterman^1

1. https://youtu.be/U46fJ2bJ-co?t=2780

and Ryan asked Bjarne about memory safety. Bjarne brushes it off and says that in almost all cases where we see memory safety issues, they are either

1. Being written in C style C++ and not using "Modern C++" 2. Being written in C

He then goes on to say say that Modern C++ and where it is necessary, hardened libraries, go a long way to making these problems non issues. I'm not a C++ guy, so how much of this is true? What do the C++ developers think about this?

I've postd the whole message if people would like to read. It's about 46minutes into the video

Ryan: One thing that I think C++ is uh infamous for is kind of like memory safety issues or kind of foot guns that exist there.

Bjarne: I'm so tired of that. Um I haven't had those problems for years. Um, and somebody did a a study of the obvious problems with buffer overflows and um people hacking in using that kind of stuff and uh almost all of the uh these cases when people writing C style code or in C and uh Herb Server has a a talk with with actual numbers and they they are quite significant. It's it's sort of that kind of problems more than 90% are for people that don't write modern C++. They they use raw pointers to pass things around without um the number of elements. No fat pointers, no spans. um you you have them in C++. You can use them. You can use uh vectors. We have hardened libraries. Everybody has hardened libraries that that does the runtime checking. Uh Apple has it. Google has it. Microsoft has it. It's just not standard till now. C++ 26 has a hardened option that are standard. uh and the work I'm doing on profiles will give you a way of guaranteeing that you don't do the stupid things. Um so anyway, uh fundamentally theoretically the problem was solved many years ago and people just do what they've always done and get the problems they've always had. And uh that makes me sad and uh it's one of the things that makes me work on uh coding guidelines and on enforced profiles and on education. I mean education is one way to solve the problem. Is there a way to get the compiler to just prevent people from doing all those risky things? And is that enabled by default in modern C++ today? No, but it should be. I'm proposing that for C++ 29. Uh the simpler versions of that should have been in in in uh C++ 26, but there are still a lot of people even in the C++ standards committee that are very devoted to uh their old code and their old ways of doing things. Um there's people who says you should only standardize what is common in industry. But when the bugs are common in industry, you should do something else. The standards committee is a a topic I

Decabytes··on Zig by Example
For clarity in this dual programming language scenario I'm talking about, I'm writing a user facing app that's mostly a lot of business logic.

It's running slow so I profile it and I see my math function in pure Dart (or whatever language you are writing in) is the hot spot, and pressures the garbage collector too much, so I rewrite the function in a lower level language that doesn't have as much overhead, to speed things up. Then I just call it from the higher level language through the FFI.

The benefit of Zig is the syntax is simple, and the build steps are simple, so it doesn't slow down app development too much

Decabytes··on Zig Structs of Arrays (2024)
> Why have operators at all?

I mean as an avid Lisp fan, I feel like Lisp basically answers the question of how much syntax you need in a langauge. I must admit though, not having to deal with operators precedence is really nice

  (mod (+ x (* 2 step)) width)
Decabytes··on Zig by Example
Here is where I think Zig shines. When you are a high level programmer that needs to drop down to a low level programming language for performance reasons. The issue with doing that as a high level programmer is that you don't do a lot of low level work frequently.

So unless you work in another domain where you do a lot of low level programming, then every time you drop down you will be out of practice. This favors using a simpler low level language, with low friction for integration. Rust and C++ don't handle being used infrequently, but C with it's simpler standard library and syntax fits this nicely. But it doesn't have things you expect for a modern programming language, and it is also has a lot of dangerous footguns that are easy to forget if you are out of practice

In comes Zig. It's low level, comes with it's own toolchain that makes it pleasant to work with, easy to cross compile, has more safety features built in that C, but is not overly complicated. The code tends to be more verbose, but also more straightforward. So it's a perfect language to pair, when you know you won't be able to do everything in a high level language.

For me that's what seals the deal. I'd argue that Odin has a nicer syntax, but there is a reason that tools like cargo-zigbuild^1 exists. The fact projects not related to Zig are willing to ship Zig toolchains to make lives easier is a testament to how seriously Zig takes this.

1. https://crates.io/crates/cargo-zigbuild

Decabytes··on Ask HN: Why is the HN crowd so anti-AI?
I am not 100% opposed to AI and I spent multi hundreds of dollars across the major players right now, but I'll see what I can add.

> At some point, execution speed starts to matter more than the elegance of the code.

This sentiment has been with us for a long time, and AI has only made it worse. Many people have experienced the damaging effects that focusing on execution speed have had on our lives, and you would think if AI makes us 10x faster, we could spend half that time actually making programs more performant and secure. But all of the gains always funnel into speed, when we have the golden opportunity to make things better.

Then there are the players that make it. Casey Muratori recently did a video called "It just Happened" where Eric Schmidt gives a commencement speech and washes his hands of the negative things that have happened in it, even though his decisions at Google and the technology he helped create made a lot of that happen. A quote from Casey's Video

> This is a case where someone who had direct decision-making authority during the time period when the very worst most dystopian parts of the technology business model were developed, perfected and entrenched. And he is giving this commencement speech to a group of students who have known nothing but that their whole lives. They're not like me. They didn't know a time before all of this. They didn't experience technology in the 80s or something like this.

One of the most important things in that quote is that there are people who have known nothing but a predatory, privacy invasive technology world. When that is your baseline, new technology that could advance that at 10x speed does not feel great. And now it requires only a couple bad actors and a subscription to make that happen.

At work we are mandated to use AI. That feels bad for a lot of reasons. But one of the worse is having to review AI generated code. I have never liked reviewing other peoples PRs, and now with the speed AI code is created, I could spend the whole day just doing that. So now my job is worse because I have to do more of the part I like the least.

Next, I've been thinking a lot about "the human scale of things". To me that means slowing down, and not consuming things faster than my lizard brain can understand. While I might be able to go 10x faster, unless I'm doing something I've done a million times before, I will not be able to keep that much code in my head. So I quickly lose understandings of projects, and I have to fight hard to rebuild my knowledge.

Lastly, as someone who has "vibecoded" an app, It feels completely impersonal. Yea I had the idea, and yea I had to type the prompts, but producing a whole mountain of code over the course of weeks or months (I've done both) just leaves me feeling empty on the inside. There is still a selfish human component to the programming that I and I suspect others do, and AI takes away from that

I'm not sure what the solution is though. Do we say, if you don't want to take ownership over the bad things that happen then we will down play your part in the good? Do we try to set up organizations that persecute those accountable? Should Eric Schmidt be in jail? Should he be fined? Do we as developers try to use the tools "for good?" I don't know, and I'd love to know what other people have to say on this

Decabytes··on Failing grades soar with AI usage, dwindling math skills in Berkeley CS classes
In Grad school I remember learning Python 2, and there was one particular night where an assignment of mine just wasn’t working and no searches were helping me. I was frustrated to the point of tears, and when I solved it, it wasn’t with some triumphant yell. I just remember being so tired, closing my laptop and going to sleep.

I’m sure I wouldn’t be the programmer I am without that experience, but I am Not sure I would have willingly put myself through that if LLMs existed at that point

Decabytes··on Why Janet? (2023)
Blizzard's Real ID system would fix all of this. It was ahead of it's time /s
Decabytes··on Zig: Build System Reworked
Very cool use of Elixir! I have been considering the Fig Stack (F# + Zig) myself, so I'm excited to see Zig being paired with a Functional Language
Decabytes··on Zig: Build System Reworked
There is an idea I've been kicking around for a long time, which I'll just call dual programming. The idea is to develop a stack that consists of just two programming languages, 1 higher level language, and one lower level language. You are supposed to do as much programming as you can in the high level language, and only drop into the low level language as needed. The problem is that unless you already know a low level programming language really well, you'll most likely have to re familiarize yourself with the language before doing the low level stuff.

This makes Cpp and Rust harder to use then say C, so C becomes the default for me. But C is not without its issues of which we are aware. But Zig feels like it could fill that sweet spot really well, being simple enough that it's easier to pick up after a long break, but still coming with a lot of modern tooling that makes programming easier.

Decabytes··on But It Happened [video]
I really appreciate Casey for making this video. The two quotes that stand out to me are

> This is a case where someone who had direct decision-making authority during the time period when the very worst most dystopian parts of the technology business model were developed, perfected and entrenched. And he is giving this commencement speech to a group of students who have known nothing but that their whole lives. They're not like me. They didn't know a time before all of this. They didn't experience technology in the 80s or something like this.

I think this is hugely important context. New technologies are not being built in a vacuum. It's not like we haven't seen the negative side effects of these new technologies play out already, and like Casey said, many of the people who are voicing their concerns have only gotten to live through the bad parts.

> It didn't just happen because the tool was let loose on the public and it just happened. People built the bad parts of it. They did that.

There is a JFK quote that I think accurately sums up the issue

> Victory has a hundred fathers and defeat is an orphan.

People just don't want to be associated with bad things. Billionaires don't want to be associated with the negative parts of capitalism, CEOs don't want to be associated with the terrible things their companies do, and businesses that do wrong want to settle out of court, with no public statement of blame.

I'm not sure what the solution is though. Do we say, if you don't want to take ownership over the bad things that happen then we will down play your part in the good? Do we try to set up organizations that persecute those accountable? Should Eric Schmidt be in jail? Should he be fined? Do we as developers try to use the tools "for good?" I don't know, and I'd love to know what other people have to say on this

Decabytes··on Use boring languages with LLMs
> What does it bring to the table that isn't achievable with Cargo?

Speaking purely about the cli dart devtool (flutter and debugging) dart compile (More options but the big one is JavaScript transpilation) dart info (outputs diagnostic information about installed dart toolchain)

> which isn't particularly fast

Against other programming languages that are also garbage collected Dart compares favorably, though it's implementations of things typically aims for user accessibility over maximum performance. For example a Dart Isolate is much more heavy weight than a goroutine due to it's higher startup cost and additional memory per worker. The advantage is that it has its own memory, own event loop, and communicates with other isolates only by message passing, so it's much harder to mess up.

But where Dart shines for me is in two instances. The first is as a Python programmer that wants to work in a statically typed, ahead of time compiled language. Dart fits the bill here, and covers a weakness many programming languages have which is user facing GUIs. I would argue nothing comes close to Flutter when it comes to slapping together cross platform GUIS that just work. Dart is also very good on the front and backend (with more emphasis on the frontend) of web development, and can be integrated into an existing project very well through it's ability to compile into JavaScript. Typescript definitely eats Dart's lunch here, and Go more so for the backend, but very few languages can do Webdev in a way that feels natural and due to many design decisions of the past Dart is better than most. So Dart is good for packaged user facing apps.

This also makes it a strong contender as the higher level language to pair with a lower level language. You mentioned Rust, and Dart has a Flutter Rust Bridge^1 which allows you to write normal Rust code that automatically has the glue code generated. The native code interaction story gets even better through Dart's Hooks^2, Which allow you to integrate and compile or download native assets into your Dart projects directly through Darts build interface.

> doesn't have the library ecosystem or vast training data of Rust, Go etc

LLMs are better at handling niche languages than they have ever been. And the fact that Dart is not applied broadly, in the same way Python is, means you don't need a million examples to cover the most common use cases.

1. https://pub.dev/packages/flutter_rust_bridge 2. https://dart.dev/tools/hooks

Decabytes··on Use boring languages with LLMs
Just want to throw the other Google language into the ring. While I would say Dart has a few more fancy language features than Go, it has an extremely strong and modern cli tool, which is a one stop shop for all your formatting, linking, and project building needs. It even grades how well your project is constructed before you publish it to pub.dev
Decabytes··on OpenBSD 7.9
How do the various BSDs run on framework laptops?
Decabytes··on Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"
When I was in grad school, my mentor once said, that he didn’t actually see programming as anything more than a tool to solve the problems he needed to solve. As someone who was excited about learning to program, I couldn’t understand it. As I’ve gotten older, I’ve come to understand him more. The language a program is written should be far down the list of reasons to use a programming language. Same with who happens to be the BFDL for the language, or what streamer is using it.

What matters more is if it does what you want it to do, and is well maintained.

Decabytes··on O(x)Caml in Space
I know that many garbage collected languages have ways of reducing gc pressure by minimizing classes, and pushing more things on the stack. I’ve even heard how languages like Java will allocate a massive amount of memory in the beginning, and then turn. Off the garbage collector for the whole day in high frequency trading scenarios.

Having never been in this situation, I wonder how difficult it is to bend a garbage collected language to behave like a non garbage collected one

Decabytes··on If AI writes your code, why use Python?
I legit have had this same thought. If we are going to be writing programs with AI, We should be programming in a more performant and explicit way, with statically typed programming languages that are able to encode the invariants in the program, even if it requires programming in a way that would be tedious for humans
Decabytes··on I'm going back to writing code by hand
We should go back to designing UML diagrams for programs before we write them /s
Decabytes··on Making your own programming language is easier than you think (but also harder)
Like most things in programming, handling the easy stuff is easy, but it’s all the edge cases that kill you. I’m writing an IDE in flutter right now, and all of the defensive programming I have to do to handle the unhappy path, is where 50% of my code goes.
Decabytes··on Ghostty is leaving GitHub
Come to the Gnu Savannah (jk) strange to see so many projects moving off GitHub. I always used gitlab, and only grudgingly had a GitHub, because that is where every project was. So while seeing people move off GitHub validates my choice to not personally invest in it, I can’t help but be a little sad that We are splitting across the different git providers.
Decabytes··on I'm done making desktop applications (2009)
Flutter has brought the joy of desktop gui programming back for me. Especially in this vibe coding era, building all those apps that only really have value to me has never been easier. And seeing the support for Flutter from Canonical has been nice. They’ve been helping make flutter on Linux better
Decabytes··on USD Purchasing Power in Real Time Since 2000
I like this visualization, but I think there is a harder to quantify layer under this. While someone making 50k a year in 2000, would need to make 100k in 2026 for the same economic power, it is actually much worse.

In the year 2000, there were just less products and services then there are now. And the products that did exist were generally more durable and repairable than today. And in many cases, products that exist now but didn’t back then have reasonable substitutes (like renting or buying movies, since you don’t have Netflix).

I would even take it one step further and say that the ways you had to interact with those substitutes were healthier and more social than what we have now.

Decabytes··on XML is a cheap DSL
S-expressions are a cheap dsl too. I use it in my desktop browser runtime that is powered by wasm that I’m developing As the “HTML”^1 and CSS^2 in fact it works so well I use it also reused it to do the styling for html exports in my markup language designed to fight documentation drift^3.

1. https://gitlab.com/canvasui/canvasui-engine/-/blame/main/exa...

2. https://gitlab.com/canvasui/canvasui-engine/-/blob/main/exam...

3. https://gitlab.com/sablelang/libcuidoc

Decabytes··on Can I run AI locally?
Does anyone use the super tiny models for anything ? Like in the 2billion or lower parameter level?
Decabytes··on Ask HN: What Are You Working On? (March 2026)
I’m working on an R7R7-small scheme called Sable. The focus is on having good Windows support, vscode support, Lsp and Debug adapter protocol support. It is closer to SBCL and is image based, and builds with just the platforms native c compiler
Decabytes··on Notes on writing Rust-based Wasm
Yes wasm is basically a rust thing at this point unfortunately. And if you want to write a wasi preview 0.2 component, you need a bunch of rust tooling to do it properly
Decabytes··on AI and the Ship of Theseus
The existence of permissive licenses like BSD or MIT does not show that copyleft was unimportant.Those licenses allowed code to remain open, but they also allowed it to be absorbed into proprietary products.

The GPL’s significance was that it changed the default outcome. At a time when software was overwhelmingly proprietary, it created a mechanism that required improvements to remain available to users and developers downstream.

Gcc was a massive deal for the reasons why compilers are free now today for example

Decabytes··on MacBook Neo
This would be a great Asahi Linux target, but I know that group has a lot on their plate with the MacBooks pros already
Decabytes··on Gemini 3.1 Pro
Any tips for working with Gemini through its chat interface? I’ve worked with ChatGPT and Claude and I’ve generally found them pleasant to work with, but everytime I use Gemini the output is straight dookie
Decabytes··on Gemini 3 Deep Think
Gemini has always felt like someone who was book smart to me. It knows a lot of things. But if you ask it do anything that is offscript it completely falls apart
Decabytes··on I started programming when I was 7. I'm 50 now and the thing I loved has changed
I too have felt these feelings (though I'm much younger than the author). I think as I've grown older I have to remind myself

1. I shouldn't be so tied to what other people think of me (craftsman, programmer, low level developer)

2. I shouldn't measure my satisfaction by comparing my work to others'. Quality still matters especially in shared systems, but my responsibility is to the standards I choose to hold, not to whether others meet them. Plus there are still community of people that still care about this (handmade network, openbsd devs, languages like Odin) that I can be part of it I want to

3. If my values are not being met either in my work or personal life I need to take ownership of that myself. The magic is still there, I just have to go looking for it

← PreviousPage 2 of 19Next →