1,590 karma · joined Aug 31, 2018 (8y ago) · 411 submissions
comment 2mo ago · link · parent
> Typestate improves code faultlessness and testability, but comes at the cost of more boilerplate code and can degrade readability.
I have noticed this in my own code. `Ticket` with an internal variable tracking the state makes using it simpler. I just have to store one object in my struct `struct MyData { ticket: Ticket }` and call `ticket` methods in the correct order.
Typestate `Ticket<T>` is not as simple. I have to wrap it in my own enum: `enum TicketState { Ticket1(Ticket<Func1Done>), Ticket2(Ticket<Func2Done>), }` to store in my struct: `struct MyData { ticket: TicketState }`. Then every time I call `ticket` methods, I must extract the correct variant value first. That degrades readability and creates extra run-time cost.
comment 3mo ago · link · parent
"According to reports from Bloomberg, Apple will be skipping its M6 Pro, M6 Max, and M6 Ultra chips to accelerate development of the M7 chip. That means the only chip to be released from the M6 family will be the base M6.
The reason for this break with tradition: AI. Apple had been planning major neural-processing upgrades for the M7 family and ultimately decided those improvements were important enough to justify accelerating the next generation rather than completing the M6 lineup." https://9to5mac.com/2026/08/08/apple-m7-chip-heres-why-it-ma...
I'd skip M5 and M6 chips for LLM work and wait for a year for M7.
comment 6mo ago · link · parent
comment 7mo ago · link · parent
comment 7mo ago · link · parent
9.
App Store sees 84% surge in new apps as AI coding tools take off(9to5mac.com ↗)
66 points · by gardaani · 7mo ago · 74 comments
comment 9mo ago · link · parent
comment 1y ago · link · parent
Are there any good Linux distros left with 32-bit x86 support? Do I have to switch to NetBSD?
comment 1y ago · link · parent
Oklab is perceptually uniform and addresses issues such as unexpected hue and lightness changes in blue colors present in the CIELAB color space. https://en.wikipedia.org/wiki/Oklab_color_space
Oklab is used in CSS because it creates smoother gradients and better gamut mapping of out-of-gamut colors than Lab. Here's a picture how Oklch (on the left) creates smoother gamut mapping than CIE Lch (on the right) ("Explore OKLab gamut mapping in oklch"): https://github.com/w3c/csswg-drafts/issues/9449#issuecomment...
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
Generally, I try to avoid buying anything with rubber. It is usually the first part that goes bad. Either it gets sticky and starts melting or it gets hard and dry and breaks up. Also, I avoid using rubber bands. They usually end up damaging objects they hold together.
Here's a good page about conservation of rubbers and plastics for those who like to preserve their vintage stuff for a long time. https://www.canada.ca/en/conservation-institute/services/con...
comment 1y ago · link · parent
"An error occurred whilst preparing device for development -- Failed to prepare the device for development. Domain: com.apple.dtdevicekit Code: 806 Recovery Suggestion: Please unlock and reconnect the device. The device is locked. Domain: com.apple.dt.MobileDeviceErrorDomain"
comment 1y ago · link · parent
But how can the caller know what is "a truly invalid input"? The article has an example: "we unfortunately cannot rely on panic annotations in API documentation to determine a priori whether some Rust code is no-panic or not."
It means that calling a function is like a lottery: some input values may panic and some may not panic. The only way to ensure that it doesn't panic is to test it with all possible input values, but that is impossible for complex functions.
It would be better to always return an error and let the caller decide how to handle it. Many Rust libraries have a policy that if the library panics, then it is a bug in the library. It's sad that the Rust standard library doesn't take the same approach. For println!(), it would mean returning an error instead of panicking.
comment 2y ago · link · parent
I have been following the Rust Boa project, but I think that it isn't production ready, yet. https://github.com/boa-dev/boa