HNHacker News
TopNewBestAskShowJobs

hgs3

1,589 karma · joined August 11, 2020

submissionscomments
hgs3··on Why I Always End Up Going Back to C
I'm being pedantic, but on modern hardware, the ISA is an abstraction over microarchitecture and microcode. It's no longer a 1-to-1 representation of hardware execution. But, as programmers, it's as low as we can go, so the distinction is academic.
hgs3··on The tech market is fundamentally fucked up and AI is just a scapegoat
> it's been mostly static

In a well-functioning competitive market, no company should be able to rest on its laurels. The problem is industries have consolidated and trustbusters are nowhere to be found.

Notice when tech is new (the web, smart phones, AI) there's an initial burst of competitive companies? That's because the market hasn't consolidated yet. Ask yourself how many dot-com millionaires would realistically be able to duplicate their success in 2026, given the same product but launching today.

Aside from consolidation, discoverability is a huge problem, especially in the era of AI slop. Building a superior product is easy, getting it noticed and building traction is hard.

hgs3··on After two years of vibecoding, I'm back to writing by hand
I'm flabbergasted why anyone would voluntarily vibe code anything. For me, software engineering is a craft. You're supposed to enjoy building it. You should want to do it yourself.
hgs3··on Date is out, Temporal is in
> like nearly all other datetime APIs, has 0 support for querying leap-second information

That's probably because you only need leap second accuracy in niche use cases, like astronomy or GPS. In JavaScript specifically, that kind of accuracy isn't needed for 99% of client-side use cases. Most date-time libraries work with POSIX time which assumes 86,400 seconds each day.

hgs3··on Quake 1 Single-Player Map Design Theories (2001)
Tangentially, if you're interested in Doom mapping, John Romero has some interesting tips [1]

[1] https://www.youtube.com/watch?v=ptHurafdCoQ

hgs3··on How SQLite is tested
> It never occurred to me that this was a possibility

Yes, it's viable. I do it for my companies projects in addition to dual-licensing under the GPL. See "The unit tests and Unicode data generators are not public. Access to them is granted exclusively to commercial licensees." [1].

[1] https://github.com/railgunlabs/unicorn?tab=readme-ov-file#li...

hgs3··on Craft software that makes people feel something
> The default script now is that every side project should either be open-sourced or turned into a SaaS

I think its worse then that. It seems the narrative is everything needs to be enterprise-scale by default. Those who value small languages and tools, experimentation, self-hosting, and the do-it-yourself mindset are the counterculture.

hgs3··on 10 Years of Let's Encrypt
Congratulations to Let’s Encrypt. I do wish there was something akin to them for code signing. OV and EV certificates are out of reach for many indie devs.
hgs3··on Rust in the kernel is no longer experimental
I'm not a kernel developer myself, but I’m aware of the Tanenbaum/Torvalds debates in the early 90’s. My understanding is the primary reason Linus gave Tanenbaum for the monolithic design was performance, but I would think in 2025 this isn’t so relevant anymore.

And thanks for attempting to answer my question without snark or down voting. Usually HN is much better for discussion than this.

hgs3··on Rust in the kernel is no longer experimental
Rust in the kernel feels like a red herring. For fault tolerance and security, wouldn’t it be a superior solution to migrate Linux to a microkernel architecture? That way, drivers and various other components could be isolated in sandboxes.
hgs3··on Thoughts on Go vs. Rust vs. Zig
Are you familiar with Zig's error handling? It's arguably more Go-like than the Rust approach.
hgs3··on Hardening the C++ Standard Library at scale
> The people writing libraries have no idea how their library will be used.

Unless you're paying them, the people writing the libraries have no obligation to care. The real issue is Big Tech built itself on the backs of volunteer labor and expects that labor to provide enterprise-grade security guarantees. That's entitled and wholly unreasonable.

> Take libxml2 as an example.

libxml2 is an excellent example. I recommend you read what its maintainer has to say [1].

[1] https://gitlab.gnome.org/GNOME/libxml2/-/issues/913#note_243...

hgs3··on The current state of the theory that GPL propagates to AI models
Copyleft isn't about the software authors freedom, it's about the end-users freedom. Copyleft grants the end-user the freedom to study and modify the code, i.e. the right to repair. Contrast this with closed-source software which may incorporate permissively licensed code: the end-user has no right to study, no right to modify, and no right to repair. Ergo less freedom.
hgs3··on Fifty Shades of OOP
> I feel that prototypes are harder to wrap one’s head around compared to classes.

This is sad to read because prototypes are conceptually easier to understand than classes. It’s unfortunate that most developers experience with them is JavaScript, because its implementation is extremely poor. I recommend trying Io which is very Self inspired as well as Lua.

hgs3··on Giving C a superpower: custom header file (safe_c.h)
It supports C99 minus VLAs. Worth noting that only C99 mandates VLAs. They are optional in C11, C17, and C23.
hgs3··on Lux: A luxurious package manager for Lua
> The ability to edit it using the CLI

This perplexes me. Lua was conceived as a configuration language and the whole point of a configuration language is you edit a config file. Trying to abstract this away behind a CLI seems like it misses the ethos of Lua.

It’s also a tad strange that a package manager designed for Lua isn’t written in Lua. Presumably Lua developers already have Lua installed, know Lua, and would more likely contribute to a project written in Lua.

hgs3··on MAML – A new configuration language
In practice, there are still types, they are just validated by your application. I didn’t want Confetti itself to make assumptions. I wanted to give you the freedom to define your own custom types and keywords, like “on” and “off”, or even tri-states like “yes”, “no”, “maybe”.

The problem with mandatory keywords, like “true” and “false”, is they box you into the English language. And which data types should be intrinsic is arbitrary, for example, TOML has data types for date and time, but JSON does not [1]. Where do you draw the line? Confetti let’s you decide.

You might enjoy reading this take on the subject [2].

[1] https://toml.io/en/v1.0.0#offset-date-time

[2] https://github.com/madmurphy/libconfini/wiki/An-INI-critique...

hgs3··on MAML – A new configuration language
> It would be much more interesting to see a language which experiments with what is fundamentally representable

You might checkout my project, Confetti [1]. I conceived of it as Unix configuration files with the flexibility of S-expressions. I think the examples page on the website shows interesting use cases. It doesn't have a formal execution model, however, for that you might checkout Tcl or Lua.

[1] https://confetti.hgs3.me/

hgs3··on Show HN: I built a web framework in C
The code is very readable and well organized. My only major critique is that there's very little error checking, e.g. there are many calls to snprintf and malloc without checking the result. There is also an unused loop here [1].

As an aside, I don't see any support for parallelization. That's fine for an initial implementation, but web servers do benefit from threading off requests. If you go that route (pun intended) you might consider using something like libuv [2].

[1] https://github.com/ashtonjamesd/lavandula/blob/51d86a284dc7d...

[2] https://github.com/libuv/libuv

hgs3··on The Big Oops: Anatomy of a Thirty-Five-Year Mistake [video]
> It goes through the history of OOP

Unfortunately, the "history" omits prototype-based OO (Self, Io, Lua, etc.) which doesn't suffer from many of the "issues" cited by the speaker.

hgs3··on Exhausted man defeats AI model in world coding championship
This is interesting, but aren't "coding competitions" about writing small leetcode programs from a prompt? I would expect the AI to excel at that.
hgs3··on I write type-safe generic data structures in C
I'm curious what a hashmap looks like with this approach. It's one thing to pass through or hold onto a generic value, but another to perform operations on it. Think computing the hash value or comparing equality of generic keys in a generic hashmap.
hgs3··on Libxml2's "no security embargoes" policy
Just be respectful and not snarky. And be clear about your boundaries.

What I do is I add the following notice to my GitHub issue template: "X is a passion project and issues are triaged based on my personal availability. If you need immediate or ongoing support, then please purchase a support contract through my software company: [link to company webpage]".

hgs3··on No More Shading Languages: Compiling C++ to Vulkan Shaders [pdf]
I would expect a shading language to provide specialized features for working with GPU resources and intrinsic operations.
hgs3··on Open source can't coordinate?
> Since then Microsoft has had no real answer for "how do I write desktop applications for Windows?" other than "use Electron".

Microsoft has been pushing WinUI the past few years, with WinUI 3 being the latest recommended UI toolkit [1]. I think what's interesting about WinUI 3 is it's not built into Windows - you have to ship the whole toolkit with your app, just as you would GTK or Qt on Windows. I find that a perplexing direction for a "native" toolkit.

[1] https://learn.microsoft.com/en-us/windows/apps/winui/winui3/

hgs3··on The Subjective Charms of Objective-C
It's a shame that Objective-C never really caught on outside of the NeXT/Apple ecosystem. User interfaces benefit greatly from dynamism, and all the UI toolkits I've used for C and C++ try to emulate message passing in one way or another: from WinAPI's SendMessage, to GTK and Qt's signals and slots.

I'm surprised the wider FOSS community didn't adopt the language. I've been building a GTK4 app recently, and the macro-heavy class boilerplate, C-style casting everywhere, and custom signaling mechanisms would all be far cleaner in Objective-C. It's easy to imagine glib and GTK as what could have been a FOSS parallel to Core Foundation and Cocoa.

If you like C, then Objective-C is definitely worth a look. You don't need a Mac to try it either [1].

[1] https://github.com/gnustep/libobjc2

hgs3··on Hacktical C: practical hacker's guide to the C programming language
Can you elaborate? C constructs generally map to one or a few assembly instructions at most. You can easily look at C and predict the generated assembly. This is in contrast to other compiled languages, like Go, that inject instructions for garbage collection and other runtime features.
hgs3··on Show HN: Lux – A luxurious package manager for Lua
Lua was designed for configuration, so I'd rather use Lua. Plus, it makes for a more elegant, unified design. TOML, and friends, are better paired with languages that were not designed for configuration.
hgs3··on Show HN: Lux – A luxurious package manager for Lua
Why not use a function to add dependencies, e.g. `add_dependency "dependency@version"` or `add_dependencies { ...table-here... }`. This is, more or less, how premake works [1]. For `lx add ...` you'd append the function call to the script.

[1] https://premake.github.io/docs/Your-First-Script

hgs3··on Show HN: Lux – A luxurious package manager for Lua
Lua has a sandboxed runtime so couldn't you kill rogue scripts after a timeout?
← PreviousPage 2 of 21Next →