Remix.run Logo
verdagon 2 hours ago

I'm often skeptical of the desire to create a lot of passes. In the early Vale compiler, and in the Mojo compiler, we were paying a lot of interest on tech debt because features were put in the wrong pass. We often incurred more complexity trying to make a concept work across passes than we would have had in fewer, larger passes. I imagine this also has analogies to microservices in some way. Maybe other compiler people can weigh in here on the correct number/kind of passes.

pfdietz 31 minutes ago | parent | next [-]

Yes, and a similar question is the organization of the thing being acted on by the passes. If I understand correctly, this is in scheme and the things being acted on are trees with pointers. A performance optimized compiler, on the other hand, will probably use some sort of array-based implementation of trees.

There's also a question of data about the trees (like, a flow graph) being recomputed for each nanopass. Also expensive.

soegaard 9 minutes ago | parent [-]

Nanopass uses structures internally to represent the programs.

The Nanopass dsl just gives the user a nicer syntax to specify the transformations.

onlyrealcuzzo 2 hours ago | parent | prev | next [-]

Do you have an article on lessons learned?

I'm creating a language/compiler now, and I'm quite certain that I did not have enough passes initially, but I hope I'm at a good spot now - but time will tell.

jnpnj an hour ago | parent | prev [-]

I wonder if there's some implicit wisdom that layering/modularizing incurs some communication cost that can cancel all the benefits.

jasonjmcghee an hour ago | parent [-]

This is a question folks are asking about in terms of organization building too.

Bottlenecks are changing and it's pretty interesting.