A

Aria Beingessner

gankra.github.io · Personal blog · on HN since 2019

Aria Beingessner (Gankra) is a Rust developer who writes deep technical posts on language design, ABIs, memory models, and text rendering.

What HN saysHN commenters recommend the blog for its quality, especially 'Text Rendering Hates You,' which one calls the classic 'falsehoods' analog for text.
58HN people shared it
42linked it in comments
22stories submitted
2.3Kstory points
4 years agolast shared
2019people per year2026

Most-shared posts

  1. 1
    Text Rendering Hates You
    24 people · 949 points · first shared 2019 · 169 comments on HN
  2. 2
    How Swift Achieved Dynamic Linking Where Rust Couldn't
    12 people · 480 points · first shared 2019 · 170 comments on HN
  3. 3
    The Pain of Linear Types in Rust
    5 people · 1 points · first shared 2020 · discussion on HN
  4. 4
  5. 5
    C Isn't a Programming Language Anymore
    3 people · 379 points · first shared 2022 · 326 comments on HN
  6. 6
    Rust's unsafe pointer types need an overhaul
    3 people · 185 points · first shared 2022 · 54 comments on HN
  7. 7
    The Tower of Weakenings: Memory Models for Everyone
    3 people · 111 points · first shared 2022 · 32 comments on HN
  8. 8
    Notes on Type Layouts and ABIs in Rust
    2 people · 174 points · first shared 2019 · 68 comments on HN
  9. 9
    Swisstable, a Quick and Dirty Description (2019)
    2 people · 4 points · first shared 2021 · discussion on HN
  10. 10
    Blah
    2 people · first shared 2019
  11. 11
  12. 12
    Pre-Pooping Your Pants with Rust
    1 people · 3 points · first shared 2022 · discussion on HN
  13. 13
    Bugs You'll Probably Only Have in Rust
    1 people · 2 points · first shared 2022 · discussion on HN
  14. 14
    Transparent cursive.png
    1 people · first shared 2019

What HN people wrote when they linked it

danShumway · 2022-06-14
It's linked at the bottom of the article, but reminder that Gankra's blog (https://gankra.github.io/blah/) has a ton of other great writing like this. In particular, I always recommend "Text Rendering Hates You."
raphlinus · 2022-05-23
I think of "text rendering hates you"[1] as the classic "falsehoods" analog about text. [1]: https://gankra.github.io/blah/text-hates-you/
kibwen · 2022-04-14
The OP links Gankra's first article, but don't miss the follow-up where she actually implemented some of these ideas as proof-of-concepts in the stdlib and compiler: https://gankra.github.io/blah/tower-of-weakenings/
FrostKiwi · 2022-02-14
Everyone is in the mood to write about text rendering today for some reason, love it. Great to see so many points paralleled like this article talking [1] about sub-pixel offsets being a challange and Nuklear's Wiki article talking [2] about snapping glyphs to an interger offset. [1] https://gankra.github.io/blah/text-hates-you/#subpixel-offsets-break-g… [2] https://github.com/Immediate-Mode-UI/Nuklear/wiki/Complete-font-guide#…
mbo · 2020-09-20
> “Rust should have stable ABI” — I don’t think this is a strong argument. Monomorphization is pretty fundamentally incompatible with dynamic linking and there’s C ABI if you really need to. This is an interesting topic unto itself, described in one of my favourite pieces of technical writing of all time: How Swift Achieved Dynamic Linking Where Rust Couldn't - Alexis Beingessner - https://gankra.github.io/blah/swift-abi/
eximius · 2020-05-03
I don't think the position of the language teams is that static linking is better than dynamic linking. I think that static linking is a significantly easier target for a relatively new language whose _novel_ features make it difficult to define a stable ABI. Under the very specific constraints that Rust is operating in, static linking is currently the best option. That said, I wouldn't mind seeing some kind of ABI guarantees that make dynamic linking possible. https://gankra.github.io/blah/swift-abi/ is a great, accessible read on some of the challenges of making a stable ABI, so I certainly don't expect it SOON. I do wonder if there is some scheme that could be adopted in a performant way for making the ABI stable as of the Rust Edition, even if it were only for core and std, statically linking everything else?
gpm · 2019-11-09
I haven't read the article yet, but important context to this is probably that Gankra has a lot of experience with Rust. They literally wrote a lot of the book on unsafe rust... See their list of publications for some examples: https://gankra.github.io/blah/ (I found this while trying to determine if Gankra = Gankro, it turns out it does). Edit: Now that I've read it I can say I though they were pretty fair to both languages. This certainly isn't a comparison between them, but they made some legitimate criticisms of both when that criticism happened to be an interesting point of comparison. Really good article, I highly recommend reading it if you like low level compiler stuff.
tiborsaas · 2019-11-06
> and that’s where the performance benefits of native code shine best anyway That's right, now you just have to deal with open source OpenGL libraries or of course write it yourself. Handle unicode, sub/superscripts, RTL text, typography nuances, LaTeX etc. by yourself. (See more at https://gankra.github.io/blah/text-hates-you/) Also do it in your free time because probably you won't make a living out of it. So I totally understand why anyone would pick a browser engine where all of this is super easy to solve.
asiachick · 2022-07-15
> Instead of trying to decide whether a GUI toolkit is native or not, I recommend asking a set of more precise questions: > > * Does text look like the platform native text? > > * To what extent does the app support preferences set at the system level? > > * What subset of expected text control functionality is provided? > > * Complex text rendering including BiDi > > * Support for keyboard layouts including “dead key” for alphabetic scripts > > * Keyboard shortcuts according to platform human interface guidelines > > * Input Method Editor > > * Color emoji rendering and use of platform emoji picker > > * Copy-paste (clipboard) > > * Drag and drop > > * Spelling and grammar correction > > * Accessibility (including reading the text aloud) > > If a toolkit does well on all these axes, then I don’t think it much matters it’s built with “native” technology; that’s basically internal details. That said, it’s also very hard to hit all these points if there is a huge stack of non-native abstractions in the way. This is it! Browsers handle all of this. It's a ton of work. Many many gui kits start with just ASCII and really don't realize how deep the rabbit hole is for making all of this work. And as always, if you haven't read them https://gankra.github.io/blah/text-hates-you/ https://lord.io/text-editing-hates-you-too/
KronisLV · 2021-08-15
> It goes both ways. I certainly hate un-needed complexity but somethings are just complex. Good examples are font rendering https://gankra.github.io/blah/text-hates-you/ and text input https://lord.io/text-editing-hates-you-too/ You think it's going to be easy. It's not. It just isn't. This reminds me of a talk by Venkat Subramaniam, called "Don't Walk Away from Complexity, Run", here's a recording of it: https://youtu.be/4MEKu2TcEHM?t=343 In it he talked about inherent complexity and accidental complexity, the former being a part of the domain that you're working in, while the latter is introduced accidentally and isn't actually necessary to address the problem at hand. Often people talk about managing and decreasing the accidental complexity, but what if instead you could reduce the inherent complexity by just trying to do less? For example, instead of trying to do advanced font rendering for almost every single language and writing style known to man, why not just limit yourself to ASCII, left to right typing and monospaced bitmap fonts in certain devices? I'd argue that in many cases, such as embedded devices, that's all that's actually worth doing, though seeking out ways to not drown yourself in complexity due to having limited resources to get stuff done applies elsewhere as well. As someone else pointed out, a light switch would suffice nicely, instead of trying to write software to handle every possible use case for smart lights. Alternatively, just have an API…
nindalf · 2021-05-20
What's frustrating is people who think that they can radically simplify something without knowing anything about it. The same people think they can implement a text editor in 1000 lines of code because that's how the first text editors were made. Why can't we go back to those simple days? We can't because modern software handles cases that those didn't. For example, rendering and editing text seems straightforward until you look closer. Text Rendering Hates You (https://gankra.github.io/blah/text-hates-you/) and Text Editing Hates You Too (https://lord.io/blog/2019/text-editing-hates-you-too/) are two amazing reads that analyze this in detail. They explain the hidden complexity to the vast majority of us who never knew. We simply slapped down a <textarea> or <EditText> and called it a day. If we tried to reimplement this stuff from scratch, we would likely start with a simple implementation, then tack on bits when we tried to handle issues like right-to-left layouts, Unicode, emoji, anti-aliasing, text overlapping and so on. All this before getting into implementing features that Dennis Ritchie didn't have to, like supporting plugins, releasing on multiple operating systems, accessibility or even syntax highlighting. Problems already known to and tackled by existing text editors today. If you look at work outside of your area of expertise and you feel like starting a sentence like "why don't you just ...", then reconsider. If the person you're talking to is halfway…
greggman3 · 2020-05-06
Lots of reasons. Font rendering for all of unicode is extremely hard. https://gankra.github.io/blah/text-hates-you/ Multi-language input is extremely hard https://lord.io/blog/2019/text-editing-hates-you-too/ Having to download an extra meg or 10 of code does not make your website responsive to start, worse if you're updating it constantly so you're users have to re-download that code every few days, hours. Support for assistive technologies disappears. A page of HTML is relatively easy to scan for text to read or turn to brail or translate to another language. A screen (not a page) of pixels is not. Similarly extensions all break. Extensions work because there is a known structure to the page (HTML) UI consistency disappears. Of course pages already have this issue but it will be much much worse if every site rolls it's own pixel rendering GUI because none of the standard keys will work. Ctrl/Cmd-Z for undo Ctrl/Cmd-A for select all? Similarly maybe the user has changed those keys or is using some other assistive device which all works because things are standardized. Letting the browser handle what's best for the device probably disappears. Cleartype for fonts? Rendering Text or SVG at the user's resolution (yes that can be handled by the page but will it? up to the site) Password managers break including the browser's built in one. There's no text field to find so no way to know if this is the place to fill them in. Spell checking breaks. Same as…
mmmrk · 2019-09-29
> So subpixel-AA is a really neat hack that can significantly improve text legibility, great! But, sadly, it's also a huge pain in the neck! When playing around with FreeType's ftview demo program, text rendered with an OTF/CFF font using the Adobe CFF renderer with stem darkening enabled actually looks pretty good with grayscale rendering. Subpixel rendering is not strictly necessary. > https://gankra.github.io/blah/text-hates-you/#aa-breaks-glyph-caches I think the author mixes up two concepts here, hinting and subpixel positioning. A TrueType font can change stuff around on the x and y-axis. Applying hinting on the x-axis messes with your layouting and prevents subpixel positioning on the x-axis. What you do is apply hinting on the y-axis only (FreeType calls this slight hinting, DirectWrite more or less does this -- not quite, but close enough) so you are free to shift glyphs around on the x-axis. This helps with displaying text with a more even texture on LoDPI screens. On *nixes, Chrome does this, Firefox doesn't.
defen · 2022-08-31
> An online service, product, or feature that has design elements that are known to be of interest to children, including, but not limited to, games, cartoons, music, and celebrities who appeal to children. So if you write an extremely technical blog that happens to include a cartoon avatar, is your blog directed at children? Example: everything on this blog https://gankra.github.io/blah/deinitialize-me-maybe/
rhn_mk1 · 2022-05-18
For that, you don't need to know C the language, but C the calling convention https://gankra.github.io/blah/c-isnt-a-language/
tialaramex · 2022-05-18
Note that, here in 2022, those ARM chips with CHERI do now exist, Morello: https://www.arm.com/architecture/cpu/morello Also, although this article says Rust has to choose usize ~= u128 on Morello which is unpalatable, Aria proposes that instead Rust tweaks the definition of usize to say it's about addresses not pointers, and thus usize ~= u64 on Morello. https://gankra.github.io/blah/fix-rust-pointers/ leading into https://gankra.github.io/blah/tower-of-weakenings/ If you have nightly Rust, you can play with Aria's new semantics because she implemented them. I think they're a good idea, but I don't have much "skin in the game", unlike, apparently the author of this article.
Strom · 2022-04-10
Text alone is already a painful domain [1][2] and text is just a small subset of the full UI domain. -- [1] https://gankra.github.io/blah/text-hates-you/ [2] https://lord.io/text-editing-hates-you-too/
throwaway894345 · 2022-03-11
I've looked into building cross-platform GUI toolkits before and I think you're underselling the difficulty pretty considerably. To build these toolkits, you need expertise in everything from graphics programming to text rendering (which itself is surprisingly pernicious: https://gankra.github.io/blah/text-hates-you/) to accessibility and more. And then there are things which are just "regular hard" like constraint solvers for layout engines, designing a decent API, etc.
Juliate · 2022-02-14
> An engineer could not have willed a system of k-segments into existence and imposed it on users. They did reduce something that existed to a lower resolution so that it fits into k-segments: how do make o (lower case o), O (upper case o), 0 (zero), D (upper case d), Q (upper case q) coexist on a 7-segment display without ambiguity? You start by deciding that lower/upper case it not important and that only one case for each letter will subsist. That's reduction. > The 7 segments had to be the subconsciously recognized abstract form of letters this entire time. There are other languages of which the scripts do not fit in this view. English Roman-derivative alphabet is not "better" because it compresses itself more into a specific-imposed compression format. https://gankra.github.io/blah/text-hates-you/ from https://news.ycombinator.com/item?id=30330144 is a perfect illustration.
thomasmg · 2021-08-11
Yes, exactly. Linear probing is often easier and faster. Using buckets also helps (each bucket contains multiple slots), for both cuckoo hashing and linear probing. E.g. the cuckoo filter uses a bucket size of 4. See also https://gankra.github.io/blah/hashbrown-tldr/ for a fast hash table implementation.
baxuz · 2021-04-30
What do you mean by "font smoothing"? Subpixel antialiasing has been disabled and steadily pruned from the OS since Mojave if that's what you're talking about: https://gankra.github.io/blah/text-hates-you/
moonchild · 2021-03-13
Swift has a stable ABI. It makes different tradeoffs than rust, but I don't think complexity is the cliff. There is a good overview at https://gankra.github.io/blah/swift-abi/
steveklabnik · 2021-03-10
> at which point I bet it would be a somewhat easy modification to what Rust has already implemented. You'd lose that bet: https://gankra.github.io/blah/linear-rust/
moosingin3space · 2021-03-06
Another fascinating look into text on computer screens is this article: https://gankra.github.io/blah/text-hates-you/. Just goes to show that text rendering is actually absurdly complex, unless you drastically restrict the problem space.
zamadatix · 2021-01-10
It's simply that drawing a non trivial amount of(nice looking) generic text (accurately) seems simple but actually takes a lot of logic and a lot of processing time relative to a rendering deadline. There are a lot of reasons for this but largely it comes down to having to do a lot of individual rendering every time something changes and when one thing needs to be rerendered (e.g. the user zoomed) it likely means everything needs you have to bulk render everything again in the next 16 or fewer ms. https://gankra.github.io/blah/text-hates-you/ has a decent description of many of the problems seen with rendering text in the browser setting (which is on the more complex side of text rendering).
floatboth · 2020-09-26
Hot take: ABI stability is overrated. How often do you need to relink specifically without recompiling everything? As an OS packager, it's no big deal to rebuild everything depending on a C++ shared library when that library is updated. For self-contained binary distributions, statically linking the C++ library or putting the shared objects together works fine still. vtables are always a pain, but I think the Swift team had some cool ideas about vtables and other dynamic stuff across dynamically linked shared objects.. upd: https://gankra.github.io/blah/swift-abi/ this
oconnor663 · 2020-09-25
Swift has done some very original things around ABI stability: https://gankra.github.io/blah/swift-abi/
mwcampbell · 2020-06-28
If your framework has a broad audience, please make sure it accounts for the full complexity of text rendering [1] and editing [2], particularly when it comes to internationalization. You may find that there are good reasons for Cocoa to be as slow as it is in the measurement phase, if not the rendering phase. And of course, please don't forget about accessibility. [1]: https://gankra.github.io/blah/text-hates-you/ [2]: https://lord.io/blog/2019/text-editing-hates-you-too/
nicoburns · 2020-06-19
Rust's ownership system has Affine types (types which must be used 0 or 1 times), which are indeed closely related to Linear types, which must be used exactly once. Types marked with `#[must_use]` in Rust are pretty close to linear types. But must_use is a lint rather than being integrated with the type system. See also: https://gankra.github.io/blah/linear-rust/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close