»Schedule // Talk
Friday, October 10
16:15–16:45
Side Stage

What actually are attributes?

Attributes are a super versatile tool. They can add metadata to almost any part of rust’s syntax. This is great for designing new features in the language: if their syntax can just be an attribute, the parser and therefore high-level syntax doesn’t need to change. And that’s not just useful inside the compiler; Rust gives that power to users through attribute macros, so they can add their own syntax to the language. Think of serde to add serialization, or tokio’s attribute that lets main be async. Of course, with attributes around, every new feature’s syntax looks like an attribute-shaped hole, leaving us with critical parts of the language being just attributes, instead of having proper syntax.

Over the past year, I’ve worked on refactoring the parts of the compiler that processes attributes, and this talk is about some of the things this taught me about language design. About how they are both critically necessary, and an absolute pain to have. And to motivate that, I’ll show some funny bugs I found in the compiler while refactoring them.

Speaker

Jana Dönszelmann

Hi! I’m Jana (she/her). For the past years I taught embedded systems, in Rust, at the university of Delft. Now I work almost full-time on rustc in the compiler team as part of Hexcat, and co-organise Rust meetups and conferences.

When I’m not doing that, I’m probably playing guitar or board games.

Get tickets