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 7y ago · link · parent

We use Zulip for xi-editor and related projects, and I am very happy with it. I find it helps us have real discussions, as compared to other types of forum (and I've tried a bunch).

Two features in particular make me feel it's helping me rather than just trying to soak up my time and attention. One is the "topic" organization, which is especially useful for conversations that span a length of time. A serious downside to HN and Reddit is that discussions flare up for a day and then become dead. Topics solve that, and have the added advantage (compared to, say, IRC) of being linkable, so I can point people to an existing discussion.

The second is the unified chronological display. This lets me catch up quickly with lots of discussions at once, as opposed to digging through a page for each conversation and then sifting through timestamps to find the new comments.

Disclosure: none. I'm just a happy user, and it's generously available for free to all open-source projects. I have no connection to Zulip or Tim, other than being fellow Recursers (which is probably how a lot of Zulip users get hooked).

comment 7y ago · link · parent

The dirty secret is that it's basically Cairo, a 1990's graphics API, with modern C++ syntax. So all of the work that's happened since then, including HDR color spaces, precise control of swapchain present, dynamic multimonitor support, doesn't exist. I also got a chuckle out of chapter 10, text (basically TBD, like that's not one of the biggest of all possible cans of worms).

In fairness, piet is currently missing the fancy stuff too. But I'm hopeful we'll get there, in part because we can afford to break compatibility.

(Going deep into the weeds, presentation doesn't belong at the piet level, but, in my stack, at the druid-shell level. I'm working on this, using quantitative measurements of latency and power dissipation. But it's all evidence that this stuff is quite hard, and Titus is absolutely right that putting it in to a language standard is folly)

comment 7y ago · link · parent

This makes interesting reading, as I've been following C++ graphics proposals for a while, and they are one of the inspirations behind piet. I hope for piet to have a role in the Rust ecosystem similar to what Titus envisions - it's certainly not a standard, but hopefully will be the tool people reach for, much like serde is for serialization.

Of course, if I fail, the negative consequences are minor, people just won't use it. By contrast, having bad stuff in a standard library lasts almost forever.

comment 7y ago · link · parent

It's a complicated tradeoff. It's not just performance, the main thing is clear code. Another factor was support across a wide variety of languages, which was thinner for things like flatbuffers at the time we adopted JSON. Also, "clever implementations" like simdjson don't have a high cost, if they're nice open source libraries.

comment 7y ago · link · parent

These numbers are not quite right for a variety of reasons (performance measurement methodology is hard), but to do something more of an apples-to-apples comparison, it's about 50x slower than serde in Rust. That's still a lot, obviously.

comment 7y ago · link · parent

We actually do get 60fps, but JSON parsing on the Swift side takes more than its share of total CPU load, affecting power consumption among other things. So (partly to address the trolls elsewhere in the thread), the choice of JSON does not preclude fast implementation (as the existence of simdjson proves), but it does make it dependent on the language having a performant JSON implementation. I made the assumption that this would be the case, and for Swift it isn't.

comment 7y ago · link · parent

Hadn't seen that particular wrapper, but if we're going to take on an FFI solution, we're more likely to use Rust for this, and implement more logic than just JSON parsing.

comment 7y ago · link · parent

That's one of the things we're considering. But it is by far the most idiomatic way to do things in Swift. One of the alternatives we're considering is implementing the line cache (including the update protocol) in Rust, which would be a huge performance jump.

comment 7y ago · link · parent

Yeah, I've done some analysis, it's creating a ton of objects to conform to the Codable protocol, and a lot of those objects are for codingPath, which is updated for basically every node in the tree. It's not a mystery, we just don't know the best way to fix it.

comment 7y ago · link · parent

This is very cool. Meanwhile, in the xi-editor project, we're struggling with the fact that Swift JSON parsing is very slow. My benchmarking clocked in at 0.00089GB/s for Swift 4, and things don't seem to have improved much with Swift 5. I'm encouraging people on that issue to do a blog post.

[1]: https://github.com/xi-editor/xi-mac/issues/102

comment 7y ago · link · parent

This isn't their first rodeo. In 2008 Google launched Knol, which was a fairly major initiative to provide a service like Wikipedia, but without Wikipedia's problems around unattributed content. The idea was that authors would post with their professional affiliation, and get compensated with ad revenue. They hoped to attract actual medical professionals, as medicine was one of the areas where you want to be able to rely on the information.

It failed miserably. The incentives were favorable to spammers but not to actual professionals. No real expert would invest their time into the platform, putting their reputation on the line, for a few paltry ad dollars. But there were some people who mastered cranking out low quality content.

I'm not making any claims about the new effort, just pointing out that identifying a problem and putting resources behind a solution is often not enough.

comment 7y ago · link · parent

I'm wondering whether any of the Google security team will use this for their "leaving tradition" [1], or whether it's considered cheating, just too easy.

[1]: https://twitter.com/LeaKissner/status/1085624255381827584

comment 7y ago · link · parent

I'd be happy to see benchmarks of that. The problem is that the "shuffling" creates serial data dependencies, while the matrix form doesn't. Sure, the number of multiplications is smaller for direct forms, but that's not what has the most effect on performance.

comment 7y ago · link · parent

Yes, Android then Fuchsia. I agree it's good, overall I prefer it to Github, but by "hacky" I mostly mean it's very much out of step from the way the rest of the ecosystem works. This is much more true for repo / jiri (which is Google's own spin on the submodule problem), but includes change ids.

comment 7y ago · link · parent

Gerrit has had the concept of "draft" for a long time. It's also better at multiple "patchsets" as a "changelist" evolves, some of which can have rebasing without needing a forced update. On the other hand, it's somewhat hacky the way it layers on top of git, requiring a "change id" to link the different patchsets together. Much of the way it works came from trying to deliver a similar experience as Perforce.

Disclosure: worked at Google, have used both systems a lot.

comment 7y ago · link · parent

All this is an excellent ad for sci-hub, which avoids most of the serious drawbacks of publishers like Elsevier. It was interesting how that was relegated to a veiled comment at the end, "or finding access in other channels". But basically if the mainstream publishers can't meet the need, we do need other channels, and right now sci-hub is the only one that actually works at scale.

comment 7y ago · link · parent

Yes, they do explicitly say exactly that. Term 3 in Jon Fine's email is "AMI agrees not to publish" and that directly follows term 2, which is Bezos backing off his assertion that AMI is politically motivated in their coverage. And term 6 means they get to keep the blackmail materials.

comment 7y ago · link · parent

You can get rid of the heap allocation for Mutex by using parking_lot, and there is work to merge this into standard library. The rest of what you wrote sounds right to me.

comment 7y ago · link · parent

It's not as easy as it looks, but probably can be done. The research I was doing was very much pure transducers, but with a couple of twists (the one I'm proudest of is alternating between forward and backward passes, which makes certain things like matra reordering much easier). There is some work in this space by Monotype as well.

comment 7y ago · link · parent

The best way to measure end-to-end latency is an Arduino with a light sensor, with the Arduino programatically injecting USB events. I made an Amazon shopping list[1] a year ago. I hope to rework my code and post a blog soon.

[1] https://www.amazon.com/ideas/amzn1.account.AGSZP5AWBGH7772O3...

comment 7y ago · link · parent

It's not useful advice. One does not simply add complex script support to some simplistic text drawing codebase. You have to take on dependencies to codebases at least an order of magnitude larger than GuiLite itself (wc harfbuzz/src/*.{h,hh,cc} is 86kloc and doesn't include the Unicode functions). Thus, it's a major architectural decision to support complex scripts at all, and to figure out how to do it.

comment 7y ago · link · parent

This is actually a super-interesting problem. The complex scripts require "shaping", which increasingly is done by HarfBuzz. Companies used to maintain their own proprietary implementations, but that's increasingly not a good idea. A problem is that HarfBuzz is a large, complex piece of software, entirely because OpenType is complex and not well specified (there are a ton of edge cases).

I did some research a few years ago on defining shaping by composing several simple finite state machines together, and am confident it could be made to work. The problem is, it doesn't work with existing fonts, the rules for shaping would have to be redone. But for fonts shipping in an embedded device, this would be entirely practical, and would be a lot faster and a lot less code than a solution based on HarfBuzz.

I'd need some incentive to complete this research. If someone wants to pay for it, please get in touch.

comment 7y ago · link · parent

The Tao of programming is Nigel Tao, long one of the main people on the Go team. Not to be confused with the Tao of mathematics, who is of course Terence Tao, Nigel's brother.

comment 7y ago · link · parent

I find the converse of the observation is true as well. I often post things about potentially controversial topics (Rust advocacy, undefined behavior, the suitability of Electron for UI), but I am always very careful to avoid provocative statements. In fact, I usually send around a draft and reword anything that is at risk for being misunderstood. As a result, I often see lower engagement in comments than I would expect for comparable material. Like probably about 0.01% of content creators, I take that as a positive metric.

I also have a very good experience on Twitter, being careful only to tweet constructive things, and curating my feed. (I'm interested in political news, and find that following only Kyle Griffin gives me all the signal and none of the noise).

That said, though I can tune my personal experiences in these ways, I feel like I'm pissing into the wind. All of the digital content business is relentlessly optimizing for clicks and engagement at the expense of everything else, so I think it's increasingly difficult to filter for quality. I try to spend more time with print, but I find it hard to resist the immediacy of digital.

comment 7y ago · link · parent

Absolutely. Two other negative models are the music publishing industry and academic publishing. I was going to write "paywalled academic publishing," but some of the worst ethics are in the predatory open access space.

There's an opportunity. Paying an open source developer a living wage in return for taking some responsibility for security and updates is a reasonable thing, and would obviously benefit everyone all around. Whether we can actually get there is another question.

comment 7y ago · link · parent

My personal sense, from watching developments in this space, is that we are going to have to find some way for taking on an open source dependency to be an economic transaction, with money actually changing hands. With open source, the code itself is free (in both the libre and gratis sense), but there are other places to identify value. One of them is chain of custody - is there an actual, somewhat responsible human being behind that package? Many of the most dramatic recent failures are of this nature.

Other value is in the form of security analysis / fuzzing, etc. This is real work and there should be ways to fund it.

I think the nature of business today is at a fork. Much of it seems to be scams, organized around creating the illusion of value and capturing as much of it as possible. The spirit of open source is the opposite, creating huge value and being quite inefficient at capturing it. I can see both strands prevailing. If the former, it could choke off open source innovation, and line the pockets of self-appointed gatekeepers. If the latter, we could end up with a sustainable model. I truly don't know where we'll end up.

comment 7y ago · link · parent

Though Inconsolata was inspired by Consolas, I wouldn't consider it all that similar. For example, the digits in Inconsolata are much closer to the Franklin Gothic model. Also, Consolas has excellent hinting for Windows, while Inconsolata was originally designed with no hinting at all. They're not drop-in replacements.

comment 7y ago · link · parent

Source Code Pro is a very good font. My only real problem with it is that it's a touch too wide. One of the things I really like about it is the wide range of weight and the true italic.

comment 7y ago · link · parent

You might want to consider adding "image-rendering: pixelated" to your CSS; on a high-dpi monitor, these render with bilinear interpolation, which I think doesn't do justice to the crispness of these icons.

comment 7y ago · link · parent

This. Right now I'm basically on a year sabbatical where I'm doing almost entirely open source software without worrying about funding, but I also know that's not sustainable

I hope you manage to find some good balance that keeps your work funded!

1
525354
63