RSSAmplifier

Blog

Abubalay

abubalay.comRSS feed ↗6 posts

Latest posts

A universal lowering strategy for control effects in Rust

The Rust language has incrementally grown a set of patterns to support control-flow effects including error handling, iteration, and asynchronous I/O. In The registers of Rust, boats lays out four aspects of this pattern shared by Rust’s three effects. Today these effects are typically used in isolation, or at most combined in bespoke ways, but the Rust project has been working on ways to…

From recursive descent to LR parsing

Recursive descent parsers are attractive for their simplicity. A collection of functions, one for each part of your language, looks at the next token to decide what to parse next. The structure and control flow of the program matches the structure of the grammar, so you can write a parser by hand in your favorite language and use familiar tools for testing and debugging.

The problem of safe FFI bindings in Rust

Google has published a document on Rust and C++ interoperability in the context of Chromium. It describes their criteria for the experience of calling C++ from Rust — minimal use of unsafe, no boilerplate beyond existing C++ declarations, and broad support for existing Chromium types.

Safe Cell field projection in Rust

I&rsquo;ve just published the dioptre crate, the newest addition to Driveyard. Dioptre is a lightweight proc-macro for struct field reflection. The subject of this post is a trick built on top of this functionality&mdash;Cell field projection, going from Cell<Struct> to Cell<Field>.

Soak: a struct-of-arrays library in Rust

Arrays are a natural way to work with collections of objects. They have relatively effective cache utilization, they make iteration and random access easy, and they tend to have good language support. In Rust, arrays lay out each individual object&rsquo;s fields together in memory, as an &ldquo;array of structs:&rdquo;

Writing a recursive ascent parser by hand

I&rsquo;ve been exploring various ways to write parsers. For a long time, I&rsquo;ve used hand-written recursive descent for its straightforwardness, flexibility, and performance. There is another way&mdash;parser generators like Menhir, LALRPOP, or the venerable Bison use the bottom-up LR algorithm.