Modernizing Compiler Design for Carbon Toolchain - Chandler Carruth - CppNow 2023

Channel:CppNow · Length:1:35:12 · Published:2023-08-17 · Views:70900

Watch on YouTube

Summary

Chandler Carruth's CppNow 2023 talk on modernizing compiler design for the Carbon toolchain, using data-oriented design and modern hardware assumptions. It covers lexing, parsing and compact data structures aimed at compiler performance.

Why HN recommends it

Recommended as a recent take on rethinking compiler architecture, and cited in discussions of flattened ASTs and fast lexers.

I recommend a watch of this for a recent take on trying to change how we think of these. — HN, 2023

C, C++, Rust, Go & systems languages · Software performance & optimization · Compilers, interpreters & program analysis

Subtitles (excerpt)

My name is Chandler Kuth. I'm here to talk about some fun things that we're trying to do with compiler designs. Um, I know there's been a whole bunch of discussion of like carbon and successor languages. Um, you may be kind of fed up with that. You may want a little bit more C++. I promise I'm actually going to try and keep the carbon parts of this to an absolute minimum. This is mostly talking about here. Let me do this while I'm talking. This is mostly going to be about uh how to build a compiler and some interesting things we think we can do building a compiler and that we're kind of experimenting with on carbon. I am going to mention that and there's some interesting interactions but there's also going to be a lot of C++ code. This is stuff that hopefully works with any kind of uh uh compiler design that you might want to have. Um also just so you know there is uh a link here to the slides. I hope the slides are live. Uh if they aren't don't tell me now, tell me later. uh we'll fix it. Uh we also are going to have some live demo. Uh there's a lot of flexibility. Um it's going to it's going to be a really informal kind of talk. So I'd love to have questions, love to have discussion anytime.

On Hacker News

No but it is endemic to how we think about compilers up to now, and especially when the rust compiler arch was massively developed, more than 10 years ago. I recommend a watch of this for a recent take on trying to change how we think of these. It is an open research field [VIDEO] — di4na, 2023-08
Is lexing ever a bottleneck though? Even if you push for lexing and parsing 10M lines/second [1], I'd argue that semantic analysis and codegen (for AOT-compiled languages) will dominate the timings. That said, there's no reason not to squeeze every bit of performance out of it! [1]: In this talk about the Carbon language, Chandler Carruth shows and explains some goals/challenges regarding perform… — norskeld, 2025-07
Chandler discusses it in this video though! [VIDEO] You get some traversals for free with this layout (preorder, reverse post order). Can search for subtrees with string searching algorithms or more complex things with regex. — wrsh07, 2025-01
Cache the position of quotes/apostrophes, etc. Optimizing for your edge case would require everyone writing and reading code to conform to this extra thing, which seems completely unnecessary. Machines are pretty fast. [VIDEO] Modernizing Compiler Design for Carbon Toolchain - Chandler Carruth - CppNow 2023 — pas, 2024-08

Related videos