Skip to content

Conversation

@jvanburen
Copy link
Member

Adapt ppx_base to work in the compiler codebase. This will produce faster and smaller equality/comparison code than the hand-rolled ones, and it will make the codebase smaller and more readable.

@jvanburen
Copy link
Member Author

this adds ppx_base as a dependency though, which we'll need to mention + update github actions...

@mshinwell
Copy link
Collaborator

I don't think we should do this, for at least the following reasons:

  • there will never be acceptance of ppx upstream (correctly in my opinion) and so using it in flambda-backend is going to increase obstacles to upstreaming
  • ppx is likely to make it harder to work on the compiler when it itself needs to be debugged, e.g. for the current arm64 warnings.ml problem. I believe this outweighs any concern about time spent manually maintaining these functions
  • it will mean that the semantics of the compiler starts depending on the semantics of ppx
  • the argument about the legibility and performance of the boilerplate functions isn't really a strong one in my opinion: in particular, it seems unlikely these are serious performance bottlenecks. Algorithms with poor time complexity or repeated IR traversals seem more likely suspects
  • AI systems can now easily be used to write the boilerplate functions, which significantly reduces effort for new ones.

This seems likely to be related to #3914, but we should just fix the code generation if it is actually a problem.

@Gbury
Copy link
Contributor

Gbury commented Apr 30, 2025

I agree with @mshinwell : I don't think the benefits of using/addping ppx in the compiler outweighs the (many) drawbacks it would inflict on us.

@jvanburen jvanburen closed this Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants