HNHacker News
TopNewBestAskShowJobs

wwalexander

1,206 karma · joined February 10, 2016

submissionscomments
wwalexander··on An engineer’s tips for writing documentation devs love
I think it’s fair for a project as a whole to describe itself as “simple” as a statement of its goals (vs. e.g. “flexible”, “high-performance”, “easy-to-use”, and so on).

For example, Suckless Software describes many of their Linux applications as simple, and it’s a fitting description that also encodes the spartan nature of the projects compared to their more commonly used counterparts.

But outside of a README or GitHub project description, I completely agree. Simplicity is the absence of complexity, and will become in retrospect when users choose what you’ve made because you made it simple enough to do so.

wwalexander··on V 0.3
Combining them in general makes sense to me, at least to the extent of having an Optional<T> be an alias of Result<T, ()>.

There are some obvious cases where a none optional is separate from failure, like a hash map lookup or an element from an iterator. But I often also see optionals used to signal e.g. an unparseable string, where it would seem equally reasonable to return a Result or throw an error.

I’ve been writing a lot of Swift lately, and because it uses `throws` rather than a Result type, it’s made the often arbitrary choice of returning an optional value or raising an error more noticeable to me. Especially when using `async`, as pretty much everything declared `async` also throws, so if an Optional is actually what you want to return, you get some fairly gross boilerplate at the site of use:

    guard let value = try await getValue() else { … }
This has turned into a bit of a ramble but my main point is that implementing Optional as a Result with void error type makes a lot of sense in my head.
wwalexander··on Rust 1.62.0
Absolutely agree with you. Rust lets me offload all the boring, inscrutable memory management checking to the compiler. Sure, I can’t get away with undefined behavior, but I spend my Rust programming time thinking about the business logic and letting the compiler tell me when the books are off.
wwalexander··on Rust 1.62.0
Rust definitely has a different feeling of mastery than other languages, due to the fact that most if not all bugs are caught during the compilation phase.

In other languages I like, I reach a point where I’m generally confident my code will compile before I ask it to. In Rust, for all but the most trivial logic, the compiler will usually have several things to say. However, I usually feel like the compiler is guiding me towards a simpler/more idiomatic/better way of doing things, and the compiler is more strict simply because Rust is so well-equipped for static compile-time analysis.

So fret not, the borrow checker and all the other checks that happen when writing Rust exist precisely because these things are so painful and complex to reason about as a human. The compiler is your colleague, not your boss!

wwalexander··on Artistic Radiance Fields
This was my impression as well. It seems to have some sort of object permanence when the camera is moved rather than just convoluting a single frame; seems significantly more difficult to me as a layman.
wwalexander··on The day I discovered that Apple Maps is Kind of Good now
I prefer Apple Maps in absolutely every way except their business info. Many businesses are missing, listed but no longer operating, or have incorrect/outdated business hours and other metadata. I do my best to add or correct info via the in-app crowdsourcing interface, but it often takes a long time for the information to be reflected if at all.

That being said, it’s hard to compete with Google on data munging. Besides, if I’m actually looking for info on a business besides it’s location, I’d just Google it or visit its website anyways—especially post-pandemic as businesses close, open, and change hours so frequently.

wwalexander··on What Le Corbusier got right about office space
> I want society to be like a machine and less like an organism.

Unfortunately, this desire is at odds with the fundamental nature of a group of organisms, but you are welcome to fashion your own personal life/community into a machine if you so choose.

> Seems like your personal belief system does not align with Le Corbusier.

It does not, but that’s okay, we’re discussing the pros and cons of architectural philosophies here! Unfortunately, Le Corbusier put no value on the expressed desires and needs of the communities who had to live in his projects, whose buildings were torn down to make way for Le Corbusier’s machines.

Humans and communities are not machines and cannot be engineered.

> I am not a fan of crowded hectic life, $2M houses, having to ration electricity, live in a cardboard box sized apartment in a highly dense but "walkable" city.

The issues with car-centricity go far beyond dense urban areas. The most easily-recognized example is probably the stroad [1], which also discretizes and alienates formerly human-oriented areas. I grew up in rural Maine and have lived in two of America’s largest cities, and I’ve seen our mechanization throughout.

[1] https://en.wikipedia.org/wiki/Stroad?wprov=sfti1.

wwalexander··on Impressions from a first-time Mac user
> macOS has a weird snapping implementation where you need to click and hold the green “zoom” button, then choose to “tile” left or right. But, once you pick another window to fill the other half, both of those windows (together as one) move to their own virtual desktop. I want them split on my current desktop, not on a separate desktop.

This functionality is actually built into macOS by default, though it’s not very discoverable. The Tile Window to Left/Right of Screen options (which can also be found in the Window menu in the menu bar) change to Move Window to Left/Right of Screen when you are holding ⌥, which will move and resize the windows as desired without entering full screen. (For windows whose minimum width exceeds half the screen width, the left edge will be aligned properly while the right edge will overflow into the other half of the screen or off the edge of the screen respectively).

> Also, unlike Windows or Linux, you can’t “maximize” a window using the green “zoom” button, it will only make the current window fullscreen (and again, on its own desktop). Confusingly, you need to again click and hold the green “zoom” button, then choose “Zoom”. Apple calls the green button “zoom” in their documentation, but its default function is fullscreen, not zoom.…For all the Apple fanboys screaming “There’s an app for that!”, I hear you, but remember, this is a work machine and I need to get everything I install blessed by IT security.

While it is unfortunate that Apple doesn’t provide any shortcuts for these features, you can set them up yourself without any extra software via  > System Preferences > Keyboard > Shortcuts > App Shortcuts. I have the following “missing” shortcuts set up, kind of like the tiling shortcuts on Windows but with more modifier keys.

Move Window to Left of Screen: ⌃⌥⌘←

Move Window to Right of Screen: ⌃⌥⌘→

Zoom: ⌃⌥⌘↑

Tile Window to Left of Screen: ⌃⌘←

Tile Window to Right of Screen: ⌃⌘→

Enter Full Screen: ⌃⌘↑

wwalexander··on What Le Corbusier got right about office space
Le Corbusier was also partly responsible for the American ideal of the ultra-zoned, socially-stratisfied, car-centric city. Le Corbusier saw society as a machine, not an organism, and his work reflects this outlook; a comprehensive plan for alienation and the decay of community.
wwalexander··on USB-C hubs and my slow descent into madness (2021)
I’d just like to chime in with the Kensington SD5700T [1]. I’ve tried a CalDigit TS3 Plus, an Anker PowerExpand 13-in-1, and the Kensington has by far been the most reliable.

It doesn’t have built-in HDMI/DisplayPort out, but it’s easy to buy the appropriate cable to connect to your monitor (I recommend Club3D [2]). Especially if you’re trying to use an HDMI 2.1 or DisplayPort 1.4 display, as I’ve found most built-in ports on these hubs don’t support these latest standards or have weird issues with them.

It also has a nice mounting bracket [3] that lets you hide the cable mess under your desk or behind your monitor.

[1] https://www.kensington.com/p/products/device-docking-connect...

[2] https://www.club-3d.com/en/cat/cable/usb_type_c/1606/301/

[3] https://www.kensington.com/p/products/device-docking-connect...

wwalexander··on Your computer is a distributed system
Plan 9 was designed in this way, but never took off.

Rob Pike:

> This is 2012 and we're still stitching together little microcomputers with HTTPS and ssh and calling it revolutionary. I sorely miss the unified system view of the world we had at Bell Labs, and the way things are going that seems unlikely to come back any time soon.

wwalexander··on Why I Prefer Makefiles over Package.json Scripts
Homebrew is a subpar choice on macOS; MacPorts is faster, has more packages, and is implemented more correctly than Brew.

Additionally, MacPorts was co-created by an engineer who also created the original FreeBSD Ports system, and thus hews much more closely to standard UNIX/BSD practices.

I’m not sure how and when Homebrew became the standard, but it is definitively worse.

wwalexander··on Apple announces 27-inch 5K Studio Display
I feel like everyone immediately realized what a terrible UX scrolljacking provides when the trend started, but Apple has pressed on despite their (in my opinion) otherwise thoughtful UX design.
wwalexander··on What do you really get from IDE-driven development?
I agree; before I starting writing Swift, my only IDE experience was using Eclipse in college, and I really looked down on IDEs. I thought of them as a crutch required by poorly-designed and overly-verbose languages like Java.

But the IDE experience with a language that has decent type system like Swift is really great. It truly just feels like a more efficient way to consume documentation and write code.

The analogy I would make is to texting on a numpad by repeatedly tapping a key vs. using T9 (assuming you’re in the right age range to have memories of texting on numpads). Sure, T9 might have guessed the wrong word a fraction of the time, but you never felt like it was dictating the direction of your thoughts or getting in your way.

This all depends on the programming language, the package/project scaffolding, and the IDE being tightly integrated and very thoughtfully designed, but when it works it’s a real pleasure. While I still believe that all languages should be ergonomical to write without IDEs, I definitely underrated the experience.

wwalexander··on Building an iPod for 2022
Apple should be able to identify your MP3s as long as those songs are also in the Apple Music collection (and you are subscribed to Apple Music).

There’s a “Create Station” feature that might be what you’re looking for.

Additionally, for discovering new music, Apple Music has plenty of recommendations and curated playlists to check out. Like most machine-curated approximations of my taste, these never quite do it for me and I end up finding new music by exploring artists/producers/labels I’m interested in “by hand”.

But in any case, Apple Music is definitely a better choice over Spotify if you want to maintain a collection of personal media files while getting access to a big streaming catalogue and recommendations. If you use iCloud Music Library, your MP3s are cloud-synced to all your devices automatically. Spotify allows adding personal files, but it must be done manually per-device, so it’s quite a headache if you regularly listen to anything that isn’t available to stream (due to business, politics, or simply never having an official release).

wwalexander··on Mathematician Hurls Structure and Disorder into Century-Old Problem
For anyone else confused by the problem description:

A Van der Waerden number is notated as W(r, k).

r is the number of colors that can be applied to an integer (e.g. 2 if you have blue and red beads).

A “big evenly spaced sequence” means that at least k integers of the same color form an arithmetic progression. So if n, n+1, n+2, …, or n, n+3, n+6, …, etc. all have the same color, that is considered an “evenly spaced sequence”, . “Big” means this sequence contains at least k integers, so for example, if n, n+1 and n+2 are all red, but n+3 is blue, this sequence would be “big” for a k of 3, but not for a k of 4.

The Van der Waerden number W(r, k) is then the smallest integer i such that, coloring the integers starting at 1 and ending at i, will force a “big evenly spaced sequence” to exist as defined above.

wwalexander··on Price increase on .io domains on January 1, 2022 (Renewal: $55.00)
I’m always mind-boggled at the level of acceptance in the industry of clear misuse of ccTLDs. Is having “input/output” in your domain really so cute that it’s worth tying your entire business to an incorrect ccTLD? Especially when we have so many new cute, built-for-purpose geek-cred gTLDs like .dev.
wwalexander··on The origins of ‘horn ok please,’ India’s most ubiquitous phrase (2016)
This feature is present in at least a couple of Toyota’s newer models that I’ve had the chance to drive (specifically a Prius Prime and RAV4 Prime).
wwalexander··on Linus on Line Breaks (2020)
Ironically, if the text on this page used the correct HTML elements instead of cramming everything into a monospaced code block—which results in browsers not wrapping long lines—this email would be readable on narrow displays like mobile phones.

I get the argument that you shouldn’t bring down the experience for everyone just to accommodate the most limited imaginable scenario (80x22) when it comes to breaking code lines, but it’s pretty easy to just replace <pre> with <p> in the context of the LKML listings.

wwalexander··on QOI: Lossless Image Compression in O(n) Time
Are there compression algorithms that take longer than O(n)? My impression is that even two-pass encoding is O(n) with a large constant factor in front of it, but I’ve never actually thought this much about it.
wwalexander··on Dollar Tree says US$1.25 price point to become new standard
Yeah, there’s three or four items I’ve been meaning to buy for about half a year that haven’t come back. Sometimes I’ll get the stock notification but it will disappear quickly, and they don’t let you place pickup orders for items with less than 5 units in stock.
wwalexander··on Why Are Topre Keyboards So Expensive?
There are mechanical keyboards that are lower profile. I felt the same as you with my old Filco Majestouch-2 with MX Blues, but switched to a Logitech G915 with MX Browns and enjoy it a lot more.

The key travel is still the same, but I found that having the tops of the keys closer to the desk surface made it a lot less straining.

I also recommend a desk chair that lets your forearms rest so that your wrists are parallel with and just slightly above the desk surface, so that your fingers are sort of pecking down (L shape) instead of curled (J shape). For any keyboard, but it matters more the taller the keyboard.

wwalexander··on Go: Don't Change the Libraries in 1.18
> this causes cognitive confusion, because you are effectively labelling the multiplicand as something that it isn't

You make a fair point, but at that point the debate is about other choices made in the Go language disallowing implicit type conversions.

> The correct decision would have been to make the * operator be allowed to operate on a time.Duration and an integer, just as you are uncontroversially allowed to operate * on a float and an integer

What should the resulting type of the multiplication operator be when applied to a float and an integer? Should the type be different if the operands are swapped? Is it acceptable for the multiplication operator to not be commutative, given that we seem to be demanding a great deal of rigor from our type system? Should we only allow this implicit conversion if type inference is not being used?

> To refute your statement and go even stronger I don't know of ANY pls that require * operands be the same type

Rust, for one, but will test out some more when I’m not on a bus: https://play.rust-lang.org/?version=stable&mode=debug&editio...

> cannot multiply `i32` by `f32`

wwalexander··on Go: Don't Change the Libraries in 1.18
“Units” in the last bit was maybe the wrong word.

To be clear: time.Duration is a type, and is the only part of this discussion where “type safety” is a factor.

time.Millisecond is a constant time.Duration whose value represents the duration of a millisecond. time.Millisecond et al are not a unit as in chemistry class, so you’re not supposed to get a time.Millisecond^2 by multiplying them. Just like in any other typed language, T * T -> T, not T^2 (where T = time.Duration), since it’s a type and not a unit.

time.Millisecond et al instead make you explicitly annotate the scale of user-provided durations. When you write

    d := time.Second*time.Duration(input)
you are assigning to d a value of type time.Duration equal to the duration of one second multiplied by the input. You are free to not use the constants defined by the time package and instead create time.Durations from the literal number of nanoseconds in the duration, if you so choose:

    d := time.Duration(input)*1000000000
But since the time package already defines convenient constants for standard durations, those will be used instead and be far more explicit and readable.

This has nothing to do with dimensional analysis of units, of the sort you do in physical sciences. I don’t know of any general-purpose languages that include dimensional analysis in the language or their standard library’s datetime package, but I’d be curious if you know of one (that isn’t specifically geared towards the sciences) - seems like the sort of thing Ada might include? In any case, I don’t think a language focused on keeping a simple feature set like Go should be a trailblazer here. Durations are easy.

wwalexander··on Go: Don't Change the Libraries in 1.18
> you must first cast the user value to milliseconds

Incorrect. You must cast the user value to a time.Duration, since Go is a type-safe language, and like most type-safe [1] languages, its numerical operations generally require their operands to be of the same type.

You might be thinking of multiplying a user-provided value by a constant (of type time.Duration) defined by the time package, like time.Millisecond or time.Hour. I’m under the impression this is a very intentional choice to require user-provided values to be explicitly annotated with their units. Some implementations/variants of durations use nanoseconds, some milliseconds, some seconds, and requiring this assumption to be explicit in the code helps avoid critical bugs like the Mars Climate Orbiter failure. [2]

The time package (and other stdlib packages) definitely has some warts, especially the time format parsing, but I’ve always appreciated the approach taken for durations.

[1] We could get into more advanced type inference here like Rust’s From/TryFrom traits, but the debate between simplicity vs. expressiveness in Go has been retreaded here tens of thousands of times and I doubt either of us has anything new to say on the topic.

[2] https://en.m.wikipedia.org/wiki/Mars_Climate_Orbiter

wwalexander··on Ocean drone captures video from inside a hurricane
Very cool, but obviously hard to tell scale. Does anyone with more expertise have an idea of how large those swells/waves might be?

Edit, after RTFA:

> SD1045 is battling 50 foot waves

wwalexander··on AI Recognises Race in Medical Images
I can’t admit I have any qualifications to speak about biology, and I know HN is known for proposing reductive “solutions” based on oversimplified models of reality.

That being said, it seems to me that it makes sense that a species would include the entire connected graph whose nodes are members and whose edges represent the ability to have fertile offspring.

I found [1] which is an interesting example of a very large graph, but nevertheless, all the examples seem to be within altogether very similar groups.

I think a reasonable definition for casual use doesn’t need to require the graph of a species to be fully connected, only fully reachable.

There are certainly leaks to any abstraction of species, but they are empirical cases of exceptions. They don’t inject arbitrary social categories into the definition. Definitions of “race” have no empirical basis on which to be proved or disproved in the first place.

[1] https://en.m.wikipedia.org/wiki/Ring_species

wwalexander··on AI Recognises Race in Medical Images
The second sentence of the Wikipedia article for “species” reads:

> A species is often defined as the largest group of organisms in which any two individuals of the appropriate sexes or mating types can produce fertile offspring, typically by sexual reproduction.

This is the definition I’ve always heard, and it’s certainly more rigorous than any definition of “race” that I’ve encountered, and makes no reference to any arbitrary social constructs.

Conversely, the definition for “race” is explicitly arbitrary and social:

> A race is a grouping of humans based on shared physical or social qualities into categories generally viewed as distinct by society.

wwalexander··on Gitpod shipped GitHub a launch cake for Codespaces
In Montreal, there is a flashing neon sign on top of a former flour factory [1]. This sign originally read:

    FARINE
    FIVE ROSES
    FLOUR
The first line is French for “flour”, the second line is the brand name, and third line is, well, “flour” in English.

When Bill 101 passed, they had to remove “flour” from the sign as it was an English word. However, they were allowed to keep “Five Roses”, as opposed to “Cinq Roses”, since it’a a brand name, so now it simply reads:

   FARINE
   FIVE ROSES
The owners have apparently tried to take the sign down, since the brand has since been sold to their competitors, but capitulated to public outcry. Apparently, it’s quite expensive to maintain, but I can see why locals don’t want it to go. It adds a lot of character to the skyline.

[1] https://www.atlasobscura.com/places/farine-five-roses-sign

wwalexander··on Gitpod shipped GitHub a launch cake for Codespaces
While they’re similar, crème fraîche and sour cream are different foods. Sour cream usually has additional ingredients and is noticeably more viscous, and has a much more sour flavor. You wouldn’t really want to put it on fruit or breakfast pastries like crème fraîche.
← PreviousPage 7 of 8Next →