HNHacker News
TopNewBestAskShowJobs

jbboehr

242 karma · joined July 23, 2015

Hell is other people’s code.
submissionscomments
jbboehr··on How fear and disgust drive consumer behavior
> There is no upside.

Iunno not having to learn Chinese/Mexican to order a sandwich seems like a pretty big upside.

jbboehr··on How fear and disgust drive consumer behavior
That just tells me your interest is your savior complex and not "free healthcare."
jbboehr··on How fear and disgust drive consumer behavior
> vote for things that were against their interests

People love it when you tell them they are "voting against their interests" when you really mean they are voting against YOUR interests.

jbboehr··on Modern storage is plenty fast
If you don't mind giving up the durability of EBS, you can use an i3 (or similar) instance's ephemeral disks. They should be way faster.
jbboehr··on Free and liberated e-books, carefully produced for the true book lover
> “The Fall of the House of User,”

Sorry for bringing it up, but is that a typo in the description?

jbboehr··on Java Edition is moving house
Has anyone made a build of Minecraft with stripped networking? I never use the online features when I play. I know this is basically asking about piracy but I bought the game so I wouldn't feel bad about using it.
jbboehr··on Swift System Is Now Open Source
The type of an underlying variable at runtime may be different than what the typescript type declares. Practically, this would probably be due to either poor, incorrect, out-of-sync, or incomplete type definitions.

A poor example, but this compiles without error and crashes at runtime:

let x: string = "foo"; (x as any) = 1; x.substr(0);

Now, technically, you can do this sort of thing in most, if not all, languages, but this happens organically more often with typescript due to many libraries being written for plain javascript and being looser on their types, or type definitions getting out of sync with the libraries they are written for.

jbboehr··on We now consider Moment.js to be a legacy project in maintenance mode
> shared CDN

That helps with transfer but clients still have to parse and execute the javascript which can be significant, especially on mobile devices.

jbboehr··on PHP 8.0.0 beta 2
> you're still stuck working around the massive mistake of binding routing to the file system

fastcgi_param SCRIPT_FILENAME /var/www/index.php;

jbboehr··on New TypeScript Website
> Our brains like novelty, and so when we see a different shape from what was there yesterday we instinctively prefer it

How do you reconcile this with people complaining about redesigns? I tend to hate them, personally.

jbboehr··on 25 Years of PHP
As long as there is nothing broken in internals (a very big if, to be fair), user code crashing will not affect subsequent requests.
jbboehr··on Guix Further Reduces Bootstrap Seed to 25%
When I was deciding between Nix and Guix, perhaps 5 years ago, I definitely got the impression that Nix had more contributors and the more comprehensive package set, which is one reason why I ultimately decided on NixOS. I couldn't say which was more up-to-date, but, well, anything not up-to-date is an excuse for me to contribute :)

That being said, at the time I had wanted to choose Guix over Nix. The channels seemed a bit better thought-out and grafts sounded like a good idea.

Not having a lisp background though, it was just easier for me to get into Nix.

jbboehr··on Ask HN: Why do you use Rust, when D is available?
> this is just D's size_t

Rust has usize [0] as a size_t equivalent.

[0]: https://doc.rust-lang.org/std/primitive.usize.html

jbboehr··on 25 Years of PHP
php-fpm uses a worker pool. How is this true unless you corrupt the shared memory segment?
jbboehr··on What Is Nix?
In NixOS, typically the config files will be generated from scratch using the Nix language, see for example sshd [0] or bind [1].

`d4ys2c8kzzcp3g4fv3ivy7a5nkayg7w2` is a hash of the inputs to a derivation (a package in Nix terms).

In a sense, at it's lowest level, a derivation is a function `f(x) -> y` where `x` is some Nix expressions (including the inputs and how to build it, often in bash) and `y` is a nix store path. The nix store path includes the hash which is a hash of `x`.

For bind, the config file itself is a derivation, it just uses a plain string (interpolated with variables via Nix) into the writeText wrapper.

[0]: https://github.com/NixOS/nixpkgs/blob/de493bd74921139860624e... [1]: https://github.com/NixOS/nixpkgs/blob/de493bd74921139860624e...

jbboehr··on What Is Nix?
> programs are sometimes patched to look for configs in nonstandard locations generated by Nix

This may be true, but typically the NixOS module will specify the generated config file via the command line [0] or symlink the generated config to the default location in /etc [1]. I don't believe it's terribly common to patch programs to have different config file paths in nixpkgs.

If you're just using plain Nix on a foreign distro, and not, say, home-manager or similar, it's up to you to provide your own configuration including service units. Presumably you could use Nix for this as well, but I'm not terribly familiar with using Nix on foreign distros.

[0]: https://github.com/NixOS/nixpkgs/blob/de493bd74921139860624e... [1]: https://github.com/NixOS/nixpkgs/blob/de493bd74921139860624e...

jbboehr··on How porting to TypeScript solved our API woes
Dynamically typed languages still have types internally, they just look like this [0] (imagine it all implemented in assembly, without C's types, if you prefer).

[0]: https://github.com/php/php-src/blob/3709e74b5e495e210ada8039...

jbboehr··on New in PHP 8
> For a development and staging website you do want notices and warnings displayed.

Just SSH in and tail the log. Dealing with unexpected output from errors clobbering your headers isn't worth the trouble.

You can also try something like FirePHP [0] if you need the errors in the context of the current page.

[0]: http://www.firephp.org/

jbboehr··on Russia blocks ProtonMail
I've heard it's relatively common to get allocated an IP that has previously been abused by spammers, or certain providers will reject incoming mail from IPs that have no reputation (but then how can you build reputation?).
jbboehr··on Being a Noob
> can't create a self-consistent system of logic that explains the reasoning behind why people vote the opposite way that I do.

Have you read any SlateStarCodex? He may have some relevant thoughts, see for example top posts [0] especially #3 and #4.

Also maybe worth researching: cultural evolution and memetics.

[0]: https://slatestarcodex.com/about/

jbboehr··on Always Review Your Dependencies, AGPL Edition
As a library, if you just have to avoid logging frameworks, at least log to `stderr` so you don't break tools that parse output.
jbboehr··on PinePhone Review
Conspiracy theory inbound: The size of the battery is precisely tuned such that after two years of degradation, it lasts less than a day (~16 hours), so people are driven to upgrade. All thickness "improvements" are incidental.
jbboehr··on Why Child Care Is So Expensive
> And then most of the benefits of that freedom were captured by employers through stagnating wages and landlords through skyrocketing rent and real estate prices.

Don't forget the gub'ment gets its cut too!

jbboehr··on My transition to an Ubuntu workstation
It's kind of a pain, but you can use buildFHSUserEnv [0] to run a custom binary. If memory serves, this also works by writing the config for buildFHSUserEnv in a .nix file, running it with nix-shell, and then running the desired binary "the old-fashioned way."

[0]: https://nixos.org/nixpkgs/manual/#sec-fhs-environments

jbboehr··on Banned C standard library functions in Git source code
I've used talloc [1] where appropriate to greatly simplify memory allocation and string handling.

[1] https://talloc.samba.org/talloc/doc/html/index.html

jbboehr··on America has no use for hides, so leather prices plunge
It's funny, I have a similar story: my mother bought me a leather belt as a child around 1995. It finally bit the dust a few years ago. I bought a belt from the same company (Land's End) and it barely lasted a year. Then my aunt got me one from Duluth Trading Company for Christmas. That was about two years ago and it's shown no signs of stopping yet.
jbboehr··on Things I Enjoy in Rust: Immutability
In many cases, due to Rust's move semantics, the previous value is consumed anyway. Imagine a function that takes and consumes a Point by value and returns a new, modified Point (assume we're talking about a struct without the Copy trait, as Point would likely have here). The original Point is no longer usable, and you may just want to replace it with the modified one. Yes, you could have the function (if it's yours) take a &mut Point but that precludes other references to it and using &mut unnecessarily isn't really considered good Rust AFAIK.

From personal experience, this also makes it easy to set up `let y = f(g(x))` as easily reorderable or printf-debuggable statements in the form of `let y = x; let y = g(y); let y = f(y);`

jbboehr··on What's next for SemVer
The key value in minor, based on my understanding, is that it's unsafe for a package manager to automatically downgrade a package that was developed against a particular minor version because that would constitute removed functionality.
jbboehr··on De-Googling my phone
If your Android phone supports USB-C, there's another alternative: you can embed your TOTP tokens on a Yubikey and access it via USB-C and the Yubico Authenticator on F-Droid: https://f-droid.org/en/packages/com.yubico.yubioath/

You can also use GPG keys embedded on the Yubikey for encrypted emails via OpenKeychain and K-9.

jbboehr··on NixOS 18.03 Released
Not what the OP asked, but:

Initially, I really wanted to use Guix over Nix, but Nix is more mature with more packages, maintainers, and features.

Last I checked, for example, there was no equivalent of a channel or overlay in Guix. Their npm importer was also not released, whereas Nix has a very usable node2nix.

Having done virtually no functional programming, learning Guile Scheme was also a barrier to me, but the Nix expression language felt a lot more natural for whatever reason.

It's unfortunate - I'm very interested in the work in reproducible builds and substitutions Guix has done, maybe it'll take off at some point or those features will be integrated into NixOS.

← PreviousPage 5 of 6Next →