HNHacker News
TopNewBestAskShowJobs

nitnelave

481 karma · joined July 25, 2019

submissionscomments
nitnelave··on Ghostty 1.4
Wezterm has a similar feature with QuickSelect, absolutely game-changing for keyboard-driven workflows
nitnelave··on The CEO of Mullvad is the main financer of the Swedish Örebro party
For context, from wiki:

> Remigration is a far-right concept referring to ethnic cleansing via mass deportation of non-white minority populations [...] to their place of racial ancestry

nitnelave··on How Shamir's Secret Sharing Works
Two points make a line in any number of dimensions.
nitnelave··on Claude Code Unpacked : A visual guide
Ah, good well-architected code, finally... With most of the code in utils/other :D
nitnelave··on How many options fit into a boolean?
I guess I was missing the NPE: https://ideone.com/rp4Nvv

Optional.of(null) throws an NPE

nitnelave··on How many options fit into a boolean?
5, no? Null, Optional::empty, Optional(null), Optional(true), Optional(false)
nitnelave··on Use the Mikado Method to do safe changes in a complex codebase
Also known as "Make the change easy, then make the change"

Something to realize is that every codebase is legacy. My best new feature implementations are always several commits that do no-op refactorings, with no changes to tests even with good coverage (or adding tests before the refactoring for better coverage), then one short and sweet commit with just the behavior change.

nitnelave··on Using go fix to modernize Go code
Rust has clippy nagging you with a bunch of modernity fixes, and sometimes it can autofix them. I learned about a lot of small new features that make the code cleaner through clippy.
nitnelave··on Clean Coder: The Dark Path (2017)
Isn't that the classic argument "Real C programmers don't write defaults!" ?

The one that companies have spent billions of dollars fixing, including creating new restrictive languages?

I mean, I get the point of tests, but if your language obviates the need for some tests, it's a win for everyone. And as for the "how much code will I need to change to propagate this null?", the type system will tell you all the places where it might have an impact; once it compiles again, you can be fairly sure that you handled it in every place.

nitnelave··on Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust
Client-side pre-commit hooks are there to help you in the same way that type checking (or a powerful compiler) is there to help you avoid bugs. In particular with git, you can skip the hooks when committing.

Now, if the server enforces checks on push, that's a project policy that should be respected.

nitnelave··on Tomo: A statically typed, imperative language that cross-compiles to C [video]
For CLI arguments, have you checked out clap? It's declarative (you create and annotate a struct, it generates the parser), and can be agremented with man page generation or shell completion generation.

And as a result of the parsing step, you get a fully typed struct

nitnelave··on List animals until failure
I added "kudu", a type of antilope, and it replaced it with "turtle". I don't know the relationship between the 2, but it doesn't pass a toddler's sniff test!
nitnelave··on LaTeX Coffee Stains (2021) [pdf]
You need to go all-in on tea and make your own mark. Get a fancy Chinese teapot with holes in the spout to use loose leaf tea, and start getting snobby about traditional vs modern techniques of Pu'er tea, and you'll get your own brand of respect!
nitnelave··on My favourite small hash table
You can probably get away with just a union between a 64 bit and 2 32 bit integers.
nitnelave··on My favourite small hash table
The alignment constraint is different, which they use to be able to load both as a 64-bit integer and compare to 0 (the empty slot).

You could work around that with a union or casts with explicit alignment constraints, but this is the shortest way to express that.

nitnelave··on The fate of "small" open source
I think it's a reference to the Google interview problem that the author of Homebrew (IIRC) failed. They were quite upset about it since they have proved their worth through their famous open-source contributions, but got rejected in a LeetCode-like interview.
nitnelave··on Free software scares normal people
That's broadly the same reason I created LLDAP. It's the 20% of features of an LDAP server that 80% of users need.

It's been hard pushing back and saying no to all the new features. We've started work on a plugin API so that people can add features and opt in to the complexity.

nitnelave··on Evolving the OCaml Programming Language (2025) [pdf]
Also, of course, talk to people. Pitch your PR idea before writing it, so you can avoid hearing "oh, there's a much simpler way" or "we can never merge this approach because of X"
nitnelave··on My Self-Hosting Setup
LDAP author here. I'm happy that LLDAP is mentioned and yet that it is not highlighted. The goal of the project was to have a simple LDAP server that is easy to install/manage for self-hosters without knowledge of LDAP required. Cheers and congrats on your setup!
nitnelave··on A good day to trie-hard: saving compute 1% at a time
I think the point is that naive regex are a very generic purpose tool, but it's still in the same ballpark. Having a custom optimized state machine for this specific use case could bring another 5x improvement on top, leading to 2.5x faster, potentially.
nitnelave··on What's so hard about constexpr allocation?
Deep const: since you have a (const) ref to the variable, you cannot access any of its parts mutably. Of course, RefCell and co are not allowed, I suppose.
nitnelave··on Authelia and Lldap: Authentication, SSO, User Management for Home Networks
LLDAP dev here! I'm happy to see it on the front page :) I made LLDAP specifically because it was very complicated to get OpenLDAP up and running, and it was resource heavy for a handful of users on a self-hosted server. If you have any questions, AMA!
nitnelave··on Authelia and Lldap: Authentication, SSO, User Management for Home Networks
There's a few people who looked into getting samba to plug into LLDAP. I haven't looked myself, but I seem to remember that the main obstacle was not insurmountable (last modified timestamp for users)
nitnelave··on Authelia and Lldap: Authentication, SSO, User Management for Home Networks
LLDAP dev here, I'm glad you found the project easy to setup! That was one of the main motivations for creating it, after struggling to set up OpenLDAP
nitnelave··on Authelia and Lldap: Authentication, SSO, User Management for Home Networks
I'd be curious to see what you had to change to get LLDAP to work on windows, and whether we can upstream that (I'm the LLDAP dev)
nitnelave··on Authelia and Lldap: Authentication, SSO, User Management for Home Networks
Kanidm is very cool! LLDAP uses their LDAP library underneath to handle parsing the protocol.
nitnelave··on C++ left arrow operator (2016)
I actually ran into that at work a few days ago. I wanted to provide a callback that accumulated stuff, and check that the total was equal to what was expected, or crash the program otherwise (fail fast). I could have equivalently written the output of the test to a capture-by-ref variable and checked it outside if I really wanted to.
nitnelave··on C++ left arrow operator (2016)
If you want an instance with a destructor (e.g. print "this was called X times"), you need a class.
nitnelave··on Your last name contains invalid characters (2010)
My wife's last name is only 2 letters long. Some websites don't accept that as it's too short (take that, Xi Jinping!)

Conversely, I've had to fill forms in Korea that included space for only 4 letters, including both first and last name. Needless to say, my 3 first names plus last name didn't fit.

nitnelave··on Don't pass structs bigger than 16 bytes on AMD64
It's kinda what Rust forces you to do, except that std::move is implied. Anything taken by value is equivalent to taking by && unless the type is explicitly marked as Copy (i.e. it can be trivially copied and the copies are implicit).

But yeah, in a c++ codebase, good modern practices are often verbose and clunky.

Page 1 of 3Next →