HNHacker News
TopNewBestAskShowJobs

jamespwilliams

2,548 karma · joined August 15, 2020

https://github.com/jamespwilliams

Submissions != endorsements

submissionscomments
jamespwilliams··on Go: Sentinel errors and errors.Is() slow your code down by 3000%
https://go-review.googlesource.com/c/go/+/576015 this change to optimise errors.Is in the err == nil case was merged recently. It’s not included in the latest Go release, hence the stats here, but should end up in a release pretty soon I’d imagine.
jamespwilliams··on Go: Sentinel errors and errors.Is() slow your code down by 3000%
That err == nil check was added very recently and isn’t included in the latest Go release, which the author used in this article.
jamespwilliams··on Google Public DNS's approach to fight against cache poisoning attacks
And conversely, short domains like Google’s own g.co are less secure!
jamespwilliams··on Show HN: Goralim - a rate limiting pkg for Go to handle distributed workloads
Fun weekend project but definitely not production-ready (no tests, no error handling, concurrent requests will cause a race condition, etc.). If readers are looking for something production-ready to use, consider https://github.com/go-redis/redis_rate (which implements GCRA/leaky bucket), or https://github.com/ulule/limiter (which uses a much simpler algorithm, but has good middleware).
jamespwilliams··on Xz.git: Fix Linux Landlock Feature Test in Autotools
Can you spot the intentional bug in this commit?
jamespwilliams··on Type-Safe Printf() in TypeScript
> Maybe it would be easier to have some kind of framework for compiler plugins that do extra checks. [...] But I haven't seen any language community do something like that. What am I missing?

Go has adopted a similar approach to this - they've made it fairly easy to write separate plugins that check stuff like this. The plugins aren't executed as part of the compiler though, they're standalone tools. For example, see golangci-lint, which bundles together a load of plugins of this kind.

Some of these plugins are shipped within the go command directly, as part of the "go vet" subcommand. (including a printf format check, which is similar to what's described in this post, i.e. it checks that arguments are of the correct type).

jamespwilliams··on How to Lose Control of Your Shell
> Now, listen. I wish I could continue here and end with “… and this is why ZSH does it that way!”

https://github.com/zsh-users/zsh/blob/47c7bc9b1493c7374f076b... has a comment about this behaviour, but no justification. I think it's just an optimization to save a little bit of time by not forking, and to avoid having the zsh process hanging around taking resources for no reason.

jamespwilliams··on Freenginx: Core Nginx developer announces fork
nginx supports graceful reloading and I’m pretty sure it has for a very long time - there are references to it in the changelog from 2005

https://nginx.org/en/docs/control.html

jamespwilliams··on Anki – Powerful, intelligent flash cards
It doesn’t cover all of your requirements but you might find Clozemaster interesting
jamespwilliams··on Anki – Powerful, intelligent flash cards
I can recommend this too, although I use DeepL instead of Google Translate, and I also use DeepL Write to identify issues in my grammar
jamespwilliams··on Non-interactive SSH password authentication
Depending on your use case it might be better to just store the key unencrypted. There’s not really much point encrypting it if you’re storing the passphrase on disk alongside the key anyway.
jamespwilliams··on Non-interactive SSH password authentication
Something like https://matrixzj.github.io/documentations/idm_decrypt_ssh_pr... (then ssh -i decrypted_key) should work and avoid ssh-agent
jamespwilliams··on SSH over HTTPS
You could probably use a self-signed cert, then configure socat either to trust that certificate (with the cafile option) or to disable verification (with the verify option)
jamespwilliams··on Shellcheck finds bugs in your shell scripts
Shellcheck is a godsend

https://github.com/jamespwilliams/strictbash, I wrote this little wrapper a while back that you can use as a shebang for scripts. It runs shellcheck for you before the script executes, so it’s not possible to run the script at all if there are failures. It also sets all the bash “strict mode” [0] flags.

[0] http://redsymbol.net/articles/unofficial-bash-strict-mode/

jamespwilliams··on Ask HN: Has anyone gotten complete, permanent relief from tinnitus?
I’m almost completely deaf in one ear and had problems with tinnitus in the beginning (~7 years ago), especially when trying to sleep. Nowadays, I really only notice it when I focus on it, and it has no impact on my quality of life whatsoever. I think a lot of it is psychological.
jamespwilliams··on Linux kernel maintainers, why are they so grumpy? (2013) [pdf]
https://www.youtube.com/live/fMeH7wqOwXA?si=7jbkLCm4QalwumNw for a video version of this talk

One funny bit about the talk, which isn’t mentioned in the slides, is that he actually gave the talk at Linaro (the very same company who were called out in the slides as a case study of submitting a particularly bad set of patches)

jamespwilliams··on Fixing for loops in Go 1.22
Go is the worst language, except all the others
jamespwilliams··on Brute-forcing a macOS user’s real name from a browser using mDNS
https://developer.chrome.com/blog/private-network-access-pre... is one idea being actively worked on in this area
jamespwilliams··on Simpsons Hit and Run source code (2003)
https://github.com/Svxy/The-Simpsons-Hit-and-Run/blob/eb4b34... is a highlight
jamespwilliams··on NixOS and my descent into insanity
I agree that NixOS (and Nix) is difficult to learn and the documentation is generally poor, which I realise is what you’re getting at in your comment,

But I do think we should keep in mind what an incredible project NixOS is. NixOS isn’t just some other Linux distro, repeating pretty much what every distro has done for 40 years. It’s a complete rethink of how a Linux distribution and package manager should work, from first principles, in a way that I don’t think has ever been done before. That’s an incredibly bold thing to do. That alone, as a research project, would be an impressive achievement. But it hasn’t just ended up as some researcher’s PhD thesis. It works in the real world, and it’s built a large community despite its learning curve.

So despite the terrible docs and UX, I have trouble agreeing that it “sucks”!

jamespwilliams··on Why Perl?
> I can be confident that a Perl script I write today will run unaltered 10 years from now, modulo external collaborators.

Yeah, because the ecosystem is dead. The flipside is that the bulk of Perl modules available are stale and don't receive any security updates or bug fixes. If I had a pound for every time I've seen a 10+ year old bug with no comments in the CPAN issue tracker...

> Perl has a small set of core syntax and is very extensible and flexible in adopting new paradigms.

Depends what you call "core syntax". The syntax available to you with a stock Perl install is certainly not small compared to other languages.

> With a great amount of discipline, Perl scripts can be successfully scaled up into large, complex systems.

If you're disciplined, you can write complex systems pretty much as well as you could in Python or any other dynamically-typed language.

However, it requires a lot of discipline and experience, and with other languages you at least have good formatters and LSPs to help with that. Perl sorely lacks this kind of infrastructure.

I also think the lack of static types makes writing complex systems massively harder, but that's not a criticism of Perl in particular.

jamespwilliams··on Tell HN: Azure Portal Down with 503s
https://azure.status.microsoft/en-us/status is 502ing and 504ing for me
jamespwilliams··on Ask HN: What is the license of GitHub's blog and The README project?
Translations are derivative works (https://en.m.wikipedia.org/wiki/Derivative_work, https://www.copyright.gov/circs/circ14.pdf) and in most countries the copyright holder of the original work must give permission for derivative works to be distributed publicly
jamespwilliams··on Atuin replaces your existing shell history with a SQLite database
It’d be pretty trivial to do this yourself though, shell history files are very simple
jamespwilliams··on Ask HN: How are you using GPT to be productive?
We don’t actually know what “thinking” is, though, so I’m not sure it’s possible to say “this model can’t think”.
jamespwilliams··on Ask HN: How are you using GPT to be productive?
This is probably a tokenisation problem: https://news.ycombinator.com/item?id=33915287 (which is an artefact of the way the model was trained)
jamespwilliams··on Ask HN: Who needs beta testers?
https://github.com/jamespwilliams/nde

Project description: If you like (neo)vim and Nix, you might find this interesting: it’s a Nix-based Neovim development shell supporting a bunch of languages (with more to come!). LSPs are used with Neovim’s LSP support to give nice editing features, and treesitter is used for highlighting. Nix makes it possible to try out the shell with a single command (once you have Nix installed).

Contact info: https://jameswillia.ms/contact.html

jamespwilliams··on It's time to stop texting
Email falls at the very first hurdle presented in the article (“No privacy whatsoever” applies just as well to email as it does to SMS).
jamespwilliams··on GNU nano is my editor of choice (2021)
One reason among many: less keyboard<->mouse hand movements -> less strain on your hands and wrists. Vscode has decent vim bindings btw.
jamespwilliams··on Accelerating zk-SNARKs - MSM and NTT algorithms on FPGAs with Hardcaml
https://signalsandthreads.com/programmable-hardware/ and https://www.youtube.com/watch?v=X1cgRXhpQLY are worth a listen if you’re interested in hardcaml (they’re both with the author of this article) - I’m not a hardware person by any means, but still found both interesting.
Page 1 of 5Next →