Recent submissions

Comment · 2 days ago
If you have a map, get(key) returns Option[ValueT]: None if the key is missing, Some(value) otherwise. If the value type itself is, say, Optional[String], your return type is Optional[Optional[String]]. Here None still always means the key is missing, while Some(None) means the value is just None.
Comment · 1 month ago
I always wondered what the actuator in the exhaust air valve for my apartment ventilation was - now I'm pretty sure it's a wax motor! You can use a switch to increase the airflow, but it takes a few seconds to react and opens/closes very slowly and quietly.
Comment · 1 month ago
Paid tier just means you're a more lucrative ad target.
Comment · 2 months ago
Comment · 3 months ago
They might be trying to get into the context of long-running chat sessions.
Comment · 3 months ago
Yes, editions are a great mechanism. It still has its limits, especially if you want easy edition migrations. All existing Rust code assumes it can drop any type whenever it wants, and that is not something you can just change across editions. You have to be very careful with defaults if you don't want conflicts when crossing edition boundaries.
Comment · 3 months ago
Yes, destructuring is typically the only allowed way to get rid of linear/indestructible values. If the type has private fields, this is only possible in the same module, so commit(txn) and rollback(txn) would have to be implemented in the same module as the Transaction type.
Comment · 3 months ago
Ah, thanks, I didn't realize "pin ergonomics" was the Rust Project name for @withoutboats' pinned places.
Comment · 3 months ago
There's a different proposal by @withoutboats to make immovability a property of the place/reference instead of the type:

https://without.boats/blog/pinned-places/

Does this project goal mean that the rust maintainers have decided to implement @yoshuawuyts' immovable types proposal in favor of pinned places?

Comment · 3 months ago
You could also detect when the elevator call button gets pressed again right after the elevator has left a floor. That means someone wasn't able to get on the elevator (and is now waiting for the next one).
Comment · 4 months ago
The gluon with color (|g1> + |g2> + |g8>) / √3 is just a superposition of the gluons with colors g1, g2 and g8, the same way you can make superpositions of any other particles. You are right that the choice of basis vectors is arbitrary, but that doesn't make it wrong to count the number of dimensions. It also doesn't make it fundamentally different than, say, polarizations of photons or even flavors of quarks. You can have superpositions of photon polarizations or quark flavors.

All of these are continuous properties in an n-dimensional vector space.

Comment · 4 months ago
I guess it's mainly a limit to savescumming.
Comment · 5 months ago
Yeah, this is basically stochastic dithering applied to numeric floating point quantization instead of image color quantization.

This makes me wonder whether you could apply different dithering approaches to numeric computations. You cannot use diffusion or similar mehods, because you don't have information about neighboring pixels/computations. Using low-discrepancy sequences might work to reduce stochastic noise, but it could also reintroduce bias for some computations.

Comment · 5 months ago
It's the same topology! Just replace each shuffle/blend with multiplication by a root of unity and addition, and you get FFT!
Comment · 5 months ago
A good example for this is A + A^T; you can fuse the two operations but you cannot get around the access pattern of matrix transposition.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton