HNHacker News
TopNewBestAskShowJobs

gardaani

1,591 karma · joined August 31, 2018

submissionscomments
gardaani··on Functional State Machines in Rust: Typestate and Newtype Patterns
The article also mentions that typestates can be cumbersome:

> 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.

gardaani··on Apple introduces M6 and M5 Ultra
Rumors say that Apple will only release M6 base variant and skips M6 Pro, M6 Max and M6 Ultra variants to concentrate all efforts to create a good AI capable M7:

"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.

gardaani··on Kitesurf: Agent-first browser that runs in V8 isolates
The Blitz Github page says: "Blitz is currently in a pre-alpha state." .. "we would not yet recommend building apps with it."

Is it a good idea to already build something on top of Blitz?

gardaani··on Show HN: Audiomass – a free, open-source multitrack audio editor for the web
Is bassoontracker too old-school? https://www.stef.be/bassoontracker/
gardaani··on The woes of sanitizing SVGs
W3C has been defining SVG Native, but it hasn't progressed much lately — mostly because there hasn't been any interest in it. SVG Native is a small subset of SVG 2.0 which doesn't support scripting, animations or any external references. https://svgwg.org/specs/svg-native/
gardaani··on GitHub CLI now collects pseudoanonymous telemetry
It isn't only corporate development teams — open source development teams want to spy on their users, too. For instance, Homebrew: "Anonymous analytics allow us to prioritise fixes and features based on how, where and when people use Homebrew." [1]

[1] https://docs.brew.sh/Analytics

gardaani··on Intel 486 CPU announced April 10, 1989
Linux kernel version 7.1 will drop support for 486: "Linux devs think even one second spent on 486 support is a second too many." https://arstechnica.com/gadgets/2026/04/linux-kernel-maintai...
gardaani··on AIs can't stop recommending nuclear strikes in war game simulations
The movie was made in 1983 and it already uses the word "hallucination": "what you see on these screens up here is a fantasy; a computer-enhanced hallucination" https://www.imdb.com/title/tt0086567/quotes/?item=qt0453841&...
gardaani··on Closing this as we are no longer pursuing Swift adoption
Here's Andreas Kling's general thoughts on Rust:

- Excellent for short-lived programs that transform input A to output B

- Clunky for long-lived programs that maintain large complex object graphs

- Really impressive ecosystem

- Toxic community

https://x.com/awesomekling/status/1822241531501162806

gardaani··on Debian 13 arrives with major updates for Linux users – what's new in 'Trixie'
Debian Trixie drops 32-bit x86 support. Ubuntu dropped 32-bit support already earlier, which meant that lightweight Lubuntu and Xubuntu don't support it either. It's sad to see old hardware support getting dropped like that. They are still good machines as servers and desktop terminals.

Are there any good Linux distros left with 32-bit x86 support? Do I have to switch to NetBSD?

gardaani··on HyAB k-means for color quantization
> Oklab is a nightmare in practice - it's not linked to any perceptual color space, but it has the sheen of such in colloquial discussion. It's a singular matmul that is supposed to emulate CAM16 as best as it can.

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...

gardaani··on Container: Apple's Linux-Container Runtime
I have been using lima to run Linux VMs on macOS. This new Apple tool looks very similar and I might replace lima with it.
gardaani··on Show HN: We made a photo search engine for homes for sale
Does your crawler respect robots.txt? Does it request pages with nice delays so that it doesn't bring down servers? Related: https://news.ycombinator.com/item?id=43422413
gardaani··on Recommendations for designing magic numbers of binary file formats
Many modern file formats are based on generic container formats (zip, riff, json, toml, xml without namespaces, ..). Identifying those files requires reading the entire file and then guessing the format from the contents. Magic numbers are becoming rare, which is a shame.
gardaani··on Recommendations for designing magic numbers of binary file formats
Wikipedia has a good explanation why the PNG magic number is 89 50 4e 47 0d 0a 1a 0a. It has some good features, such as the end-of-file character for DOS and detection of line ending conversions. https://en.wikipedia.org/wiki/PNG#File_header
gardaani··on Apple's Software Quality Crisis
Bluetooth is also turned on after every OS update. I don't understand why macOS does these. They can't be bugs because they have been around for years.
gardaani··on Gooey rubber that's slowly ruining old hard drives
That's why I've decided that my next mouse won't have any rubber in it, but it's difficult to find a good mouse without rubber. I'm still looking for one.

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...

gardaani··on Xcode Constantly Phones Home
Another annoying Xcode feature is that building a macOS app with Xcode command line tools (xcodebuild) sometimes complains that my iPhone is locked:

"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"

gardaani··on No-Panic Rust: A Nice Technique for Systems Programming
> Ideally, you can constrain the set of inputs to only valid ones by leveraging types. But if that's not possible and a truly invalid input is passed, then you should panic.

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.

gardaani··on Blackmagic Debuts $30K 3D Camera for Capturing Video for Vision Pro
Which open format can handle this kind of video? The Cineform video codec can store stereo video, but I don't know if it would be suitable for this.
gardaani··on M4 MacBook Pro Uses Quantum Dot Display Technology
There's few new 5K monitors: ASUS ProArt Display 5K PA27JCV (already sold for $799) and Benq DesignVue PD2730S.
gardaani··on Show HN: Nova JavaScript Engine
Is this an experimental only JS engine or do you aim to implement the entire ECMAscript specification?

I have been following the Rust Boa project, but I think that it isn't production ready, yet. https://github.com/boa-dev/boa

gardaani··on Will plants grow on the moon?
Chinese already did a similar experiment few years ago and the result was that "plants can grow on the moon despite the intense radiation, low gravity, and prolonged intense light"

https://phys.org/news/2023-10-china-tiny-farm-moon.html

gardaani··on Apple acquires Pixelmator
> what other products with users has Apple acquired and shut down?

Shake was acquired in 2002 and killed 7 years later.

gardaani··on Arm is canceling Qualcomm's chip design license
> That doesn't mean you can just slap a RISC-V decoder on an ARM chip and it will magically work though.

Raspberry Pi RP2350 already ships with ARM and RISC-V cores. https://www.raspberrypi.com/products/rp2350/

It seems that the RISC-V cores don't take much space on the chip: https://news.ycombinator.com/item?id=41192341

Of course, microcontrollers are a different from mobile CPUs, but it's doable.

gardaani··on Speeding up Electron apps by using V8 snapshots in the main process
VS Code does become slower for me on my MacBook M1. I typically don't restart the app unless I have to. After few days of usage, scrolling the code area becomes so slow (<20fps) that I have to restart the app. I haven't experienced such slowdown in other IDEs, such as Xcode or Qt Creator.
gardaani··on Firefox will consider a Rust implementation of JPEG-XL
> the team at Google has agreed to apply their subject matter expertise to build a safe, performant, compact, and compatible JPEG-XL decoder in Rust

There's already a JPEG-XL decoder written in Rust: https://crates.io/crates/jxl-oxide

It would be nice to hear why it's not good enough.

gardaani··on iPhone 16 could let you shoot in JPEG-XL
macOS 14 / Safari 17.6 shows static pics, but no animation.

Honestly, I wish all animated image formats would just die. They are an inefficient way to animate images, because they only use intra frames. H.264, H.265 or AV1 should be used for animations. Fortunately, Safari can display video files in <img> or CSS images, which makes all animated image formats unnecessary.

gardaani··on The News Is Information Junk Food (2022)
Welcome to Hacker News!
gardaani··on Data Formats: 3D, Audio, Image
Another good web site for media data formats is https://wiki.multimedia.cx
Page 1 of 9Next →