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

Not sure exactly what you're asking, that sounds pretty much like what that is. See in particular https://github.com/google/music-synthesizer-for-android/blob...

comment 8y ago · link · parent

Sure, it's https://github.com/google/music-synthesizer-for-android . You probably want the "webaudio" branch.

comment 8y ago · link · parent

I'd love to hear more about what technology was used to make this. I actually have a web port of my DX7 emulator, but I don't promote it much. I've also been experimenting more recently with a Rust code base for synthesis and am considering picking that up again.

comment 8y ago · link · parent

Indeed. I'm open to the idea of even joining forces, but if the goal is to explore technology choices, it does make sense for them to do their own thing. In the meantime, xi is making progress, and I think will be a pretty viable choice for people who prefer native to Electron.

comment 8y ago · link · parent

I don't think that's true, though I fully admit there's some sample bias (including the fact that I'm senior, as croshan points out). I know a lot of people that do drugs, I had no trouble observing that when I was in grad school, and people talk to me quite a bit about life issues.

comment 8y ago · link · parent

I'll add a data point, though it's almost entirely negative. I've been at Google over 10 years and have yet to come across a person using illegal hard drugs. I can think of three people with serious drinking problems. There's been a drinking culture (many offices have beer on tap), but I see that changing, as people are more conscious of the negative effects. A bunch of people use marijuana, but off-hours.

I haven't seen people seriously discussing stimulants (such as Adderall and modafinil) as performance enhancers; I've come across a number of people using these, but all in the context of diagnosed ADHD. I've also not seen anyone experimenting with microdosing LSD.

There's a surprising amount of openness and support for talking about mental health issues in general. I think this is a really good thing. The stigmatization we see in broader society is not actually helpful.

Obviously this is all my personal observation, but I think I would know; I definitely saw some serious drug use when I was in grad school at Berkeley.

comment 8y ago · link · parent

A reminder of a recent discussion here that goes into a lot more detail about why reinforcement learning works well for specialized domains like Go but is having a very hard time generalizing to more "real-world" types of tasks: https://news.ycombinator.com/item?id=16383264

comment 8y ago · link · parent

One thing to try, especially with Glucose: turn off the preprocessing. The preprocessing seems to help with really "hard" instances like you see in SAT competitions, but takes time and doesn't really help with simpler ones.

We use SAT solvers extensively in the Phil[0] crossword construction tool, to figure out when the grid is overconstrained, and which letters have only a single value in all possible solutions. We ended up running Glucose (compiled to wasm and running in the browser) because the simpler solvers couldn't solve many instances quickly, and with preprocessing off but most other parameters at their defaults. I didn't do a careful evaluation of all solvers, but it might be interesting.

I really need to write this stuff up.

[0]: https://github.com/keiranking/Phil

comment 8y ago · link · parent

Absolutely. It's very subtle humor. Students of computer architecture consider x86 to be one of the least elegant architectures around. Its many warts include segment registers (originally a hacky workaround to stretch 64k of memory to 1M), and an extremely complex instruction encoding employing prefix bytes. Many of the legacy issues (such as not having enough registers) have been papered over, leaving traces behind. Many people felt that the complexity would doom the architecture, and that a cleaner, leaner RISC approach would win out.

However, Intel has used their advantage in process technology to throw massive amounts of transistors to make up for the problems caused by all this complexity, and has done well. RISC has done well in the mobile space because those transistors tend to be power-hungry, but everywhere else x86 is today almost the only game in town.

One reason it's especially funny is that "HLT" is one of those legacy instructions that has pretty much no use in a modern system, yet takes up a whole slot in the byte encoding, while common operations like MOV or ADD often require extra prefix bytes to specify the size of the operands.

Hope that helps!

comment 8y ago · link · parent

The phrase 'For example, on the popular and elegant X86 architecture, the single byte 0xF4 is the "HLT" instruction' slays me every time.

comment 8y ago · link · parent

Were you perhaps on a debug build? This would be quite surprising in a release build.

comment 8y ago · link · parent

Yes, and I'm quite proud of how that turned out. It's using linear sRGB color space, so colors are blended with correct gamma, and dual source blending for the LCD subpixel stuff. It's all handled inside the graphics hardware; if you look at the code it's pretty simple and accessible.

comment 8y ago · link · parent

That is correct. I'm measuring scrolling at low to medium speeds, where the majority of the text hasn't changed (this also corresponds to most editing tasks). I don't want to make the claim that I'm keeping up when scrolling at very high speeds. I think my assumptions are reasonable for an editor, but for a terminal scrolling at high speed is much more common. I have certainly considered fast-pathing monospaced font rendering (it would certainly be easy in the current architecture, and in fact we're doing that for the gutter numbers), but it hasn't seemed absolutely necessary, and going forward I want to make sure that rich text and i18n aren't treated as second class wrt code.

comment 8y ago · link · parent

Definitely the standard modeless text editing model (with multiple cursors though) as the default, and vi-compatible modes as an option. The issue for the latter is linked elsethread.

comment 8y ago · link · parent

The xi-gtk frontend is in pretty good shape, but overall the editor is not _quite_ at the point where I'd recommend it for daily use. I don't want to make a promise of a particular date, but I'm hoping fairly soon.

comment 8y ago · link · parent

I'll have to try this out. My experiments indicated that DirectWrite could not keep up with drawing on a 4k monitor at 60 Hz, though was ok at a smaller window. I think it might depend a lot on driver too. I'll see if I can instrument the xi-win prototype to give performance numbers. I do note that your lines aren't very wide, but still, in my tests I wasn't seeing anything like 500fps. DirectWrite does at least seem to use the GPU, while Core Text appears to rely entirely on software rendering.

Skia is definitely capable of good performance, as it resolves down to OpenGL draw calls, pretty much the same as Alacritty, WebRender, and now xi-mac. One thing though is that it doesn't do fully gamma-corrected alpha compositing, so it's not anywhere near pixel-accurate to CoreText rendering.

Doing proper measurement is not easy, but seems worth doing.

comment 8y ago · link · parent

Indeed. I was hoping to put more effort into xi-win than it's gotten, but for a variety of reasons have decided to focus on the macOS front end for now, as there's quite a bit of work remaining to get a daily-usable editor up on one platform.

comment 8y ago · link · parent

I haven't started measuring it yet, but plan to. The idea of keeping the UI component light and doing all the heavy lifting in the core _might_ work well in Electron (as opposed to having all the logic in JS), and xi-electron is a good testbed for exploring that.

comment 8y ago · link · parent

At the rate we're going, it will be a while. It takes time, and I'm trying to get the right answers rather than racing toward shipping. It's a very different environment than a product-focused startup, and I'm happy about that.

comment 8y ago · link · parent

Not specifically, but I did dig deep into the state syncing literature in general, both Operational Transforms and CRDT's. The problem we're trying to solve is a bit different than mosh, because we don't need to compensate for network latency in particular; RPC should be very fast.

comment 8y ago · link · parent

I don't want to knock either, they're both obviously great editors. My main goal is to build something that feels entirely like a native app. Also, I'm hoping that the async model for plug-ins will preserve responsiveness even when there are a lot of plug-ins and they do nontrivial work.

comment 8y ago · link · parent

Nope, it's Arc for exactly that reason, though we're not currently using it across threads right now. The fact that it can support immutable semantics safely is one of the really nice features of Rust.

comment 8y ago · link · parent

Hey, stay on thread! Thanks for the kind words though.

comment 8y ago · link · parent

"Easy" is not the right word for this, but it's possible. One challenge is that browsers don't export an interface for "shaping". For Latin script, that means kerning and ligatures, and for complex scripts, it means being able to render it correctly at all. Currently, alacritty doesn't really deal with this, but xi-mac does, using the interfaces provided by Core Text.

comment 8y ago · link · parent

I wanted something short, and it felt kinda futuristic. The similarity to "vi" was also intentional.

comment 8y ago · link · parent

It's still a work in progress, we're revving the plug-in protocol. I'm looking forward to the time we can point people to a stable interface, but sadly it's not there yet.

comment 8y ago · link · parent

I believe xi-rope counts as a persistent data structure. We have plug-ins in separate processes now, for isolation, but might explore having them in-process but in separate threads. The underlying data structure should support that just fine. Is there something I'm missing?

comment 8y ago · link · parent

You mean Rust? Yes. However (and I didn't get into this in the talk), I actually feel that if I figure out proper async _protocols_ that express rich functionality in neatly composable modules, then that protocol is likely to outlast any given implementation. So if in 10 years somebody figures out a way to make ATS-style dependent types easy to use, I wouldn't be surprised if there's a core written in that.

comment 8y ago · link · parent

Universal out-of-the-box support in almost every language. The actual performance impact is subtle - for most core/front-end interactions, the messages are very small (because we put so much effort into minimizing the deltas). It's also the case that there are ridiculously fast JSON implementations out there. We did discover that Swift's is not one of them though. I have a prototype of a faster one using Codable; I'd consider upstreaming it to Swift but just need to find the time.

I'd consider a different serialization format, but it doesn't seem to be on the critical path for either performance or functionality, so I feel there are a lot of other things ahead of it.

comment 8y ago · link · parent

Presenter here, feel free to ask questions.

Also thanks to the awesome Recurse Center for inviting me to speak and making the recording, and the audience for their great questions.

1
575859
63