Stream: compiler development

Topic: zig compiler - code gen optimizations


view this post on Zulip Richard Feldman (May 20 2025 at 15:33):

I wanted to write out some thoughts I've had (but haven't captured anywhere) about how we should do optimizations in the new compiler

view this post on Zulip Richard Feldman (May 20 2025 at 15:34):

for example, today we compile tag unions down to one of several (very) different representations for the sake of optimization

view this post on Zulip Richard Feldman (May 20 2025 at 15:34):

this obviously makes things run faster, but it has made it really hard to generate glue for different targets

view this post on Zulip Richard Feldman (May 20 2025 at 15:35):

for the new compiler, I think we should avoid doing any of these optimizations - at least at first

view this post on Zulip Richard Feldman (May 20 2025 at 15:44):

so the basic strategy would be:

  1. Get code gen working with as few of these optimizations as possible
  2. Get glue working for the different target languages we want to support (e.g. C, Zig, Rust)
  3. Then incrementally add new optimizations while making sure to update all the glue at the same time

view this post on Zulip Brendan Hansknecht (May 20 2025 at 23:43):

This is specifically for optimizations that touch host to app communications?


Last updated: Jul 06 2025 at 12:14 UTC