Better HN
topnewbestaskshowjobs
Log inSign up

raphlinus

14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions

I do research on fundamental UI technology and 2D graphics, with a focus on Rust and fonts. @raph@mastodon.online
Submissions

comment 6y ago · link · parent

There is a growing body of evidence of longer term effects in adults. Obviously the picture is still developing because this is a novel coronavirus, but I think there is plenty of reason to be very concerned.

https://www.theatlantic.com/health/archive/2020/06/covid-19-...

comment 6y ago · link · parent

I read at one point that the typesetters at the New Yorker would work with the copy editors to fix cases of bad justification (huge word space, awkward hyphen). It's rare to see that kind of care, but automatic algorithms are getting better.

On topic to the original post, I implemented Knuth-style line breaking in the Android text stack (working with Anish Athalye who was an intern at the time and did the first prototype). There were a bunch of nicely tuned implementations of advanced data structures and algorithms in there.

comment 6y ago · link · parent

Relevant to the topic of political propaganda and in particular conspiracy theories, the leftist blogger Digby wrote a good post [1] critical of TikTok even though she was sympathetic to the punking of the Trump rally in Tulsa. In particular, she cites reporting from the Daily Beast that Pizzagate conspiracy theories are circulating widely on the platform. I'm not endorsing this reporting as fact, but do think it is good food for thought. In any case, the platform seems to be very poorly optimized for critical thinking, which is fine for "laughter and dancing" but less fine in other domains.

[1]: https://digbysblog.net/2020/06/tiktok-isnt-the-answer-folks/

comment 6y ago · link · parent

Almost certainly this one, which explored the question of whether it would be an effective strategy to encourage healthier food choices:

https://journals.plos.org/plosone/article?id=10.1371/journal...

Also, interesting fact: this is a Wansink paper. Wansink is a bullshit artist of the highest order. So I think there's quite a meta-lesson here.

https://www.vox.com/science-and-health/2018/9/19/17879102/br...

comment 6y ago · link · parent

A really interesting exploration is Co-dfns [1]. This is indeed a compiler that runs on the GPU, but it's also extremely out of the mainstream.

IMHO this is an area ripe for more exploration. If I were working on it, I might look to linking first before compilation, because the basic link task is more similar to what GPUs are good at (advanced stuff such as LTO is a different story, though).

[1]: https://github.com/Co-dfns/Co-dfns

comment 6y ago · link · parent

Both sets of numbers are meaningful, for understanding different parts of the problem. The spread of an infectious disease like Covid-19 is not a virus moving through a relatively homogeneous population, but rather the overlay of a lot of small outbreaks. Early on, when the total number of cases is small, absolute numbers are most meaningful as a basis for comparison. [1] is a thread from Mar 29 (from the brilliant visualization expert John Burn-Murdoch) arguing that absolute numbers are more predictive of "death toll one week after 10th death" and that normalizing by population only makes smaller countries look worse.

But as the spread continues (a process which takes time), per-capita numbers make sense. Mr. Burn-Murdoch revised his position (see [2] for a podcast with transcript where he talks about his thinking), and now the FT graphs have a normalized option (though their focus has moved on to other metrics such as excess mortality).

Carl Bergstrom also has a great thread [3] where he talks about the choice, concluding that both are valid as long as you're careful about context.

HTH

[1]: https://twitter.com/jburnmurdoch/status/1244380095164420101

[2]: https://voices.media/transcript-john-burn-murdoch-senior-dat...

[3]: https://twitter.com/CT_Bergstrom/status/1249930293928030209

comment 6y ago · link · parent

Some reflections, having slept on it.

I am disappointed but not at all surprised that many of the reactions here are responses to my partisan position. I worked pretty hard to reduce that without compromising what I was trying to say. Certainly in the Twitter list I'm promoting I think I succeeded; it includes Scott Gottlieb, who was FDA commissioner under Trump and now advising two Republican governors on Covid-19, but doesn't have anybody (D or R) who uses their platform to push partisan political messages.

But I think the reduction of everything to partisanship is one of the ways in which we're broken. It's impossible to have a productive conversation under those circumstances. I think it's a kind of learned helplessness. We don't want to solve problems ourselves, we want our political party (and institutions in general) to do it. I'm sure many of us on this thread have fantasies of our party vanquishing the other one on the political stage and carrying out our wishes. Or if our party is in power, then we reflexively want to rationalize away whatever flaws they have. (For the record, I am equally upset by what's going on in blue states and red. Seeing the numbers go up in California, where I live, is at odds with any simplistic narrative that Democrats embrace science and Republicans deny it, with direct consequences for Covid response)

In any case, thanks for the responses, they're all respectful, and I appreciate that.

comment 6y ago · link · parent

This might be a good opportunity to make some distinctions. @kakape is a professional journalist, and his work product is the articles he publishes in Science. The Twitter feed is not the journalism, but is participating in a conversation. I find following Twitter feeds of journalists particularly useful, because they tend to have their ear to the ground about what is interesting, but of course it's no substitute for vetted, edited articles.

That particular tweet resonates poetically for me, and speaks to major themes in my essay. The belief that you can have rising cases and mortality will stay low is, as we speak, a major narrative in what I refer to as "idiot Twitter." What I get from the Tweet is that a basic theoretical understanding of the underlying processes should be enough to dispel the notion. Just as a child might not know that thunder follows lightning, the people espousing this theory do not understand basic epidemiology. It's not a scientific proof that thunder follows lightning, or that there might not be edge cases such as the flash being so far away that the sound dissipates.

Increased testing is absolutely a factor in explaining why we're seeing this puzzling pattern, but doesn't by itself explain what we're seeing. Part of the answer is lead time bias, which from what I can tell is a reasonably obscure epidemiological concept but relevant in this context. Dr. Ellie Murray explains it in this linked "tweetorial":

https://twitter.com/EpiEllie/status/1280305393516904448

Simpson's Paradox is another major factor: to really gain an understanding of what's going on, you need to look at individual states or even finer regional divisions, and aggregating them can obscure important patterns. The effect is especially important these days because different states are very different.

comment 6y ago · link · parent

I probably could have worded that a bit more clearly. I was trying to make the argument that there is an anti-truth faction and that this faction is currently in a much stronger alliance with the right. I'm under no illusions that it's exclusive to the right, though, and was thinking of adding a section on anti-vax to clarify this.

In any case, I wanted to stay away from reflexive both-siderism as I've most often seen it used as a bad faith argument.

comment 6y ago · link · parent

It goes up and down depending on how busy I am with other things, but aside from keeping on top of Twitter I try to read about a paper a day. I went pretty deep into a few topics, including HCQ and trying to understand the capabilities and limitations of isothermal PCR.

One interesting pattern I found from discussions on HN is that when people cite papers, they very often don't support what the poster seems to be claiming. That's maybe I something I could expand on, because it's similar to cherry-picking but still not quite the same. In any case, I still appreciate the references because often I learn something :)

comment 6y ago · link · parent

I'm not knowledgeable enough about the CCP's disinformation efforts to do the topic justice. But if you'd be willing to write something in the same general spirit as my essay, I would be more than happy to link it.

comment 6y ago · link · parent

Yes, and I refer to that at least in passing. I've observed that the political and informational environment around climate change and Covid-19 are basically identical, with the exception of about a couple orders of magnitude of time scale. That gives the opportunity to see how well arguments hold up in more or less real time, which is much less of a luxury with climate change.

comment 6y ago · link · parent

I had another section on "is this an echo chamber?" that didn't make it into the final version. It would have gone into internal consistency and evolution of thought in the face of evidence as reasonably objective yardsticks. I'm not sure how much I'd be able to accomplish trying to establish a framework for critical thinking in a blog post.

In any case, the message is much more, "I've been paying close attention and have found these people worth listening to," and I don't think "authority" is really the word I'd use to express my criteria. I mean, I had a whole section against authority, and in my penultimate graf I implore readers to do their own critical thinking and not blindly follow.

comment 6y ago · link · parent

It did not, because there are many many threads of disinformation and I wasn't trying to catalog them all. I'm happy to engage a discussion of how to avoid misinformation specifically related to China, but not really clear what point you're trying to make here. I also think it's pretty far down on the list of threats we face right now, but understand others may feel differently about that.

comment 6y ago · link · parent

I have a feeling you might enjoy this code: https://github.com/zbraniecki/tinystr/blob/master/src/tinyst...

I wrote this because I wanted (normalizing) locale comparisons to be super fast, as they can be part of the key for cache lookups of text layout. In a language identifier such as "en-Latn-US" the script is in title case.

So this kind of thing still does happen, just at the lowest levels of libraries that provide nice clean abstractions for other people to use.

comment 6y ago · link · parent

That's actually a reasonable position. We solved some problems, and had ideas for others (for example, overloading "priority" to position the cursor after things like inserting whitespace for indentation), but had a list of other things we wanted to do, including "soft spans" (issue #244 in the repo) that we never quite figured out how to do.

Ultimately, I'm not very smart, and someone who is could probably figure out how to map all these other code editing problems to CRDT data structures. Once that's done, the result should be compelling, because CRDT lets you take advantage of low-latency local connections rather than requiring everything to get serialized on a central server. It's research I would love to see being carried forward.

comment 6y ago · link · parent

To fill in slightly more detail, that's GS-441524 instead of remdesivir. It's closely related but a lot easier to manufacture. Here's a good article on that:

https://www.statnews.com/2020/05/14/gilead-should-ditch-remd...

And a fascinating tale how cat owners are buying the black market version to treat FIP:

https://www.theatlantic.com/science/archive/2020/05/remdesiv...

comment 6y ago · link · parent

Glad you enjoy them! I certainly plan to continue writing.

comment 6y ago · link · parent

You might enjoy a few of my favorite sigmoids: https://raphlinus.github.io/audio/2018/09/05/sigmoid.html

That's not a deep exploration of the numerical analysis (especially compared with OP), but it does make one point: traditional "numerical analysis" techniques tend to assume the traditional four mathematical operators as canonical, but if your goal is to get something computed on actual computer hardware quickly and reasonably accurately, you have a wider palette to play with. In particular, inverse square root is a primitive about as efficient as reciprocal on modern hardware (or if using Carmack's wtf trick).

comment 6y ago · link · parent

I also hope to be able to pick up text editing again, but make no promises. If not, then I hope Druid provides a solid foundation for others to build the dream editor I envisioned.

comment 6y ago · link · parent

Very likely, the specific thing you're experiencing is poorly-engineered switching between integrated and discrete GPUs. It's not a mac-only problem, see this thread for a somewhat horrifying story (follow last link): https://www.reddit.com/r/gigabyte/comments/91ld3o/aero_15x_d...

A good intro to layout transitions is: https://www.gamasutra.com/blogs/EgorYusov/20181211/332596/Ta...

The number of copies required to get a pixel from CPU space into photons today is ridiculous. It used to be you'd just write into a memory-mapped buffer, and your graphics card would scan out directly from that where it would get to the electron beam modulator in microseconds.

comment 6y ago · link · parent

What kllrnohj says here. There are other trends as well. Because bandwidth was considered a very scarce resource, apps used to do very fine-grained dirty region tracking, and be very careful to update only what really changed (again, often by painting on the front buffer directly). Scrolling was often handled by an explicit bitblt operation, which commonly had hardware support even on very early computers.

For complex reasons, that's all been changing. For example, Metal on macOS doesn't even have a way to specify partial screen updates. Those optimizations are still valid, though, and in my ideal world we have both good support for partial invalidation and fast GPU rendering. Among other things, that would be really good for power usage. But to get there requires some attention to detail that seems to be mostly gone from the desktop UI space.

comment 6y ago · link · parent

Yes. In this discussion and on Reddit, people still talk about binary vs textual as the source of the problem, but I've argued (based on empirical data) that the lexical details are not the reason for the performance problems.

Also, Swift is marketed as a fast language (also based on LLVM), yet in my measurements it's 20x to 50x slower than Rust for JSON processing. I found that surprising. Would you not?

comment 6y ago · link · parent

This is a bit complicated. My main goal was to make something good. I would have liked it to be so good that lots of people would use it, but I wasn't optimizing for popularity, and, indeed, had I been, I would have done quite a few things very differently.

Also, thanks for those early winapi discussions. The attitude of Rust towards winapi is one of the early reasons I started seeing Rust as being viable for actually building GUI.

comment 6y ago · link · parent

So, just syntax highlighting is not compelling to move out to a server. But part of my idea is that if you have async to hide server latency, so it's not slowing down typing, maybe you can do a much deeper analysis than just surface syntax. Right now you get basically instant coloring and then much slower but more accurate feedback that's generally comparable to an incremental recompile. I was thinking that a language server might be able to give you quick feedback on some aspects of your program before having to do all of it.

Perhaps an even better motivation is indentation. When I use editors with regex-based indentation (the norm), I'm regularly annoyed when it gets it wrong. Being able to budget a few milliseconds or tends of milliseconds to do indentation that exactly matches what rustfmt or gofmt would recommend would be worth it, imho.

comment 6y ago · link · parent

You will probably find https://github.com/BurntSushi/aho-corasick/blob/master/DESIG... good reading. I believe captures get in the way of using the fastest of these NFA-style techniques, though. There's a comment from burntsushi to this effect in: https://lobste.rs/s/fq8uil/aho_corasick

ETA: Heh, I'm amused to find the latter link to be another point in what seems to be an extended conversation between Andy Chu and the Rust text-processing community :)

comment 6y ago · link · parent

Very good point, and accessibility is important. We do have it on our longer-term roadmap for Druid, and until it's done it's a very good reason to consider it unfinished work-in-progress. I will make sure to discuss this in my follow-up blog, which is about building GUI. Thanks.

comment 6y ago · link · parent

First, syntect can use both onig (an adaptation of Ruby regex, same as Sublime) and fancy-regex. The latter is yet another xi-instigated, and was motivated by trying to do a better job at this.

Second, the design of fancy-regex is precisely to delegate to the regex crate when features like lookahead aren't needed. I had high hopes for the performance, but it turned out to be lackluster, a highly tuned backtracking engine beats it in most cases. And much of the problem is indeed that RE2-style approaches are a lot faster when captures aren't required. And, by nature, Sublime-style syntax definitions rely extremely heavily on captures. A bit of discussion (including comments from burntsushi) here:

https://www.reddit.com/r/rust/comments/5zit0e/regex_captures...

Third, the question of whether "regular languages" would support faster parsing is somewhat academic, though perhaps you could build something. Though the languages being parsed often have some regular features, as a rule there are exceptions. Markdown is an extreme example, and cannot be parsed well with either regular languages or Perl-style regexes, though that hasn't stopped people from trying.

comment 6y ago · link · parent

Thanks for the kind words!

I agree with you that getting shortcuts (and other similar aspects) right is more important than which code is used to implement text editing. We're very much going to try to take that to heart as we implement more text capabilities in Druid.

Regarding LSP. Yes, while the functionality is there, it is very difficult to implement a really polished user experience with it. I think a lot of that is in the design of the protocol itself; it's hard to avoid annotating the wrong region when there are concurrent edits. It's interesting to think about how to do better, but I fear you'd be bringing in a lot of complexity, especially if you started doing some form of Operational Transformation. I would highly recommend that if someone were to take this on, they study xi in detail, both for what it got right and what was difficult.

comment 6y ago · link · parent

It was maintained for a little while after I left Fuchsia (almost two years ago now), but the pace of development on Fuchsia is such that if it's not actively maintained, it bitrots very quickly. And there aren't really any devices running Fuchsia that need text editing at scale.
1
383940
63