HNHacker News
TopNewBestAskShowJobs

wwalexander

1,206 karma · joined February 10, 2016

submissionscomments
wwalexander··on Drag an emoji family with a string size of 11 into an input with maxlength=10
You make some good points! Thanks for your insight :)
wwalexander··on Drag an emoji family with a string size of 11 into an input with maxlength=10
Emojis aren’t text, though. Nobody “writes” emoji outside of the digital world so I don’t think emoji could accurately be called “text” or part of a “writing system:

> Unicode, formally The Unicode Standard,[note 1][note 2] is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems

People write smiley faces, but there was already a code point for basic smileys.

I think standardized emoticons are a good thing, but I don’t think the Unicode spec is where they best belong.

wwalexander··on Poline – esoteric color palette generator
I would absolutely love any contributions! Luckily Go is really easy to pick up.

I definitely didn’t give deep enough into proper color theory for my algorithm—I just use the Euclidean distance between (R,G,B) colors to determine similarity. I’d also like to add checks for contrast/legibility between colors maybe.

wwalexander··on Poline – esoteric color palette generator
This isn‘t entirely on-topic, but I’ve never talked about it anywhere: to this day my favorite personal project I’ve completed is imgscheme [0], a little Go tool that lets you generate ANSI terminal color schemes based on an image (e.g. to match your wallpaper).

[0] https://github.com/wwalexander/imgscheme

wwalexander··on Ask HN: Something you’ve done your whole life that you realized is wrong?
Mine broke after 2 years, but I think that’s because I dropped it, pointy-side down, onto tile, without a brush head on it.
wwalexander··on The audacity of Apple Podcasts
I was recently on a long drive and, if I had started listening to a podcast, then listened to something else, then tried to resume the podcast, it wouldn’t play. I tried multiple episodes, marking it as played, restarting the app, and restarting the phone and still couldn’t resume.

Funnily enough, the podcast was ATP, wherein Marco Arment frequently discusses his podcast app Overcast.

wwalexander··on Semantic Linefeeds (2012)
I have my résumé written in LaTeX and format it like this, mostly so that I can comment or un-comment specific bullet points depending on what’s relevant to a certain job application, rather than maintaining multiple versions.
wwalexander··on California’s population shrinks for third straight year
Please, tech bros, stay out of Maine, Portland is already unlivable.
wwalexander··on A simple guide on words to avoid in government
The response to your comment seems to be negative, but I personally think it’s accurate and on-topic, including the note about ESR and his ideology.
wwalexander··on Never used a VPN before, is there a good one to use?
I use a Unifi router which has a feature called Teleport that lets you create and connect to a Wireguard VPN with very little friction.
wwalexander··on Twitter has banned Mastodon links in name and bio for being “malware”
I don’t believe the parent made a distinction between the two. Presumably they used “HTTP” to include both bare HTTP and HTTP-over-TLS?
wwalexander··on Is Dark Mode Good for Your Eyes? (2020)
Fair enough! I do agree that it’s important to back up any concrete biological claims related to eyesight or other long-term effects. But I’m moreso trying to argue that beyond specific claims about legibility or eye strain, it’s quite easy to understand that dark schemes are less blinding and therefore more comfortable for anyone sensitive to bright light.
wwalexander··on Is Dark Mode Good for Your Eyes? (2020)
Is it not enough that a person feels very strongly that one way is more comfortable for them? Why must we quantify when someone is physically uncomfortable?

Theoretically it would be probably be optimal in terms of the science of visual perception to flood my room with the brightest white light possible, instead of using my usual dimmed yellow lights. It would also make me feel subjectively terrible (like my eyes were bleeding) so I don’t do it, and I don’t need a study to back it up.

wwalexander··on Is Dark Mode Good for Your Eyes? (2020)
I don't understand how this debate has become about which mode is biologically the most optimal for legibility. The obvious, clear benefit of dark mode is that there's less light, which feels more comfortable to many, many people.

I'm curious, how many of my fellow dark-mode users also struggle with migraine headaches? Perhaps this and other light-sensitivity afflictions can explain why dark mode seems to be so contentious...

wwalexander··on Apple GPU drivers now in Asahi Linux
MacPorts is a better alternative to Homebrew. More packages, better design, and created by an ex-Apple engineer who was also behind FreeBSD’s ports system.
wwalexander··on Optimizing images with the HTML <picture> tag
Same thing with core UNIX commands, and so many other areas. We are doomed to incessantly reinvent the wheel and turn versatile abstractions into single-purpose complications. One must imagine Sisyphus happy.
wwalexander··on Apple Music and Mercedes-Benz bring immersive Spatial Audio to drivers
If that ends up being vaporware I’ll eat my hat.
wwalexander··on Zig-style generics are not well-suited for most languages
True. I wouldn’t want to think about the borrow checker writing UI code, and I don’t need the performance or ultra-optimized machine code of Rust when I write Swift.

I moreso meant in terms of the high-level features of Rust and how they integrate FP-style patterns into a C-style imperative language. Like tuple-based structs as discussed above, or control flow as expressions, like if and match.

The alternatives to the latter in Swift are

A) defining a dedicated function for the control flow, using return statements

B) defining but not initializing a let constant before the control flow statement

C) using the ternary operator, which is concise but doesn’t really allow for destructuring complex types

all of which are more verbose, less clear in intent, and IMO don’t embody’s Swift’s mantra of “clarity at the site of use” as well as Rust’s approach.

wwalexander··on Zig-style generics are not well-suited for most languages
Practically, there’s little difference. But as they say, naming things is one of the two hard problems in computer science and I’d rather avoid it wherever possible when the name inevitably doesn’t add any meaning, and arguably obscures it.

I could just use rawValue as the field name every time, but foo.rawValue is a lot less readable, IMO, than foo.0

wwalexander··on Why 23.976 and not 24 FPS? (2016)
I think the real reason HFR isn’t used much in cinema is that it ends up exposing a lot of the choreography, set design, special effects, etc. as fake, where before our brains filled in the details due to the low information rate and blurry frames.

Watch either of Ang Lee’s HFR movies (Billy Lynn/Gemini Man) and you’ll understand what I mean. HFR breaks suspension of disbelief. I didn’t want this to be true but I’ve come to accept that it doesn’t really have a place in cinema at least for now.

wwalexander··on Zig-style generics are not well-suited for most languages
Yep, I remember thinking this was a great approach. Unfortunately, Swift doesn’t allow you to extend “non-nominal types”, which includes tuples.

I often find myself thinking of Swift as a not-quite-fully-baked attempt at making a Rust, and this reinforces my impression.

wwalexander··on Zig-style generics are not well-suited for most languages
An aside: Swift’s generics have a pain point I bump into nearly daily, where type aliases are just that-aliases of the underlying type. This means that protocol conformance/method implementation is applied to the underlying type as well as any aliases.

So if I have two types, both of which can be represented by an underlying Int, but have entirely different semantics or methods (for instance, LosslessStringConvertible or various computed fields based on the underlying Int), I have to wrap the underlying type in either an enum with a single case or a struct with a single field, obscuring the meaning of the type and requiring awkward duplicate naming of the struct field/enum case.

The ExpressibleBy*Literal protocols are some help here, allowing Int/String/Array literals to be directly assigned to the type, but this only helps for assignment and not for retrieving the underlying value (and only applies when the type can be initialized from the literal without any failure cases).

It’s not a huge deal, but a simple newtype statement would make the generics system far more general and easy to use imo.

wwalexander··on The pervasive effects of C's malloc() and free() on C APIs
I’m not sure how common it is for libraries to return heap-allocated memory like this, vs. taking a pointer to an uninitialized value.
wwalexander··on Swift Proposal: Move Function
>I like that. I'm stealing it :)

You led me to finally track down the name of this feature in Bash: "brace expansion"! I often wish my non-techie friends recognized this syntax, along with sed replacement syntax for fixing typos.

> I was very excited with it at the beginning, but the few times I dipped my toe it was frustrating and slow.

Okay, it definitely can be slow to compile, especially with large blocks of type-inferencing ResultBuilder DSLs like SwiftUI or RegexBuilder. I find this mostly occurs when there's a type error within the DSL, and it often takes forever for the compiler to stop trying to do inference and give up with "Type of expression is ambiguous without more context" or simply "The compiler is unable to type-check this expression in reasonable time". But in practice I rarely run into this issue unless I'm creating a massive hierarchy that should be split into smaller components anyway. And I haven't really run into issues with runtime performance yet, though I haven't made anything too performance-critical with it. In any case, Swift makes it decently easy to call out to C/C++/Objective-C if you had a performance-critical routine.

What I like about the language:

It gives me the satisfaction of languages like Rust that let me express types and logic in a way that feels "correct". I rarely feel like I'm hacking stuff in due to deficiencies in the language. Swift encourages a standard approach of record types with polymorphism but still supports legacy NSObject-based stuff in a logical way, so I never feel like I have to jump through too many hoops if I need to touch dusty old frameworks.

I like the type inference, even if it's not perfect category-theoretic Hindley-Milner magic and gets stuck sometimes as mentioned previously.

I like the `guard` statement as someone who's done a lot of Go programming and always instinctively used early returns even when my CS professors told me it was a bad practice ;)

SwiftUI is really nice to use and is the only UI framework that I've ever enjoyed using (and am hoping to write it for my job soon)--it sometimes feels more like a UI prototyping tool to me because it's so straightforward, except that at some point while prototyping, you realize you've already made the finished UI without writing a dreadful mountain of glue code and interface files!

I really like the syntax in general, though I also appreciate Rust's terse symbol-based approach, I think the English-like labels actually work really well despite being a bit verbose. It definitely benefits from an editor with autocompletion, but I wouldn't say it's strictly necessary.

I appreciate the strict Unicode-correctness of the language that makes it harder to do bad stuff with strings.

I think the ARC-based approach to memory management is a good balance between Go's GC and Rust's borrow checker that makes Swift feel like a very pragmatic choice for lots of different problems (though UI was obviously first in mind).

I really like the ArgumentParser and RegexBuilder frameworks, and I think they're the best implementations of each in any language I've used.

In general, Swift just feels good to write and easy to read while being extremely powerful in what you can create with it, and coupled with the ease of use and fast feedback of SwiftUI, feels like a very complete approach to creating many different sorts of software, for my own use or to sell.

wwalexander··on Swift Proposal: Move Function
I personally love Swift and find it a joy to use. To be fair, I’m ultimately doing {i,mac}OS dev with it [1] but the parts that actually touch SwiftUI/UIKit/AppKit are just a small part, and I usually start by writing packages with all the business logic/model data.

I write Go for work and my all-time favorite language is probably still Rust, but I find that a ton of really thoughtful and smart choices have gone into Swift-the-language as well as how it’s used to build apps.

Happy to expand more on what I like about using Swift if you’re curious.

[1] which you can now write as the same codebase using SwiftUI

wwalexander··on Help pick a syntax for CSS nesting
> determining which should be championed through to a specification candidate

Didn’t they mean “implemented in Chrome and therefore forced into the CSS standard due to browser monoculture”?

wwalexander··on The inventor of ibuprofen tested the drug on his own hangover
I get migraines (not as frequently as when I was young, but still quite often) and caffeine is key—my pediatrician told my mom to get me a Coke if I was coming on with a migraine, which I was of course thrilled about as a kid.

I also find that combined ibuprofen and acetaminophen has the best results, though if I had to choose one for a desert island I’d take Advil Liqui-Gels since they don’t hurt my stomach if I haven’t eaten/am unable to eat.

wwalexander··on Is the Ride over for Uber?
If that makes you weary, you should try explaining engineering to business people!
wwalexander··on An engineer’s tips for writing documentation devs love
Simple is subjective, which means it shouldn’t be used in contexts where accuracy and objectivity are paramount (like technical documentation).

But if I’m searching for e.g. a “simple monitor hardware brightness control for Mac” without extra nice-to-have features or GUIs, a project that describes itself as “simple” gives me a useful clue that the developers might have priorities that match my needs.

wwalexander··on Rust 1.62.0
Very true, my phrasing was a bit of hyperbole in retrospect. But the bugs I end up finding at runtime when writing Rust are usually deeper issues with my own reasoning about the higher-level problem, rather than my reasoning about the inscrutable low-level machinations of a memory allocator or garbage collector.
← PreviousPage 6 of 8Next →