Nim's term-rewriting macros are wild: https://nim-lang.org/docs/manual.html#term-rewriting-macros (you can leverage Nim's side-effect analysis or enforce canonicalisation!)
miniblog.
Related Posts
I occasionally see people debate whether important functions should occur first, or helper functions first.
I've not seen it enforced though. It's hard to programmatically enforce.
OCaml takes a side: you have to put helper functions first!
Apparently sqlite does not enforce foreign key integrity by default! That's incentive to use something else even for prototypes/small apps.
https://stackoverflow.com/q/15301643/509706
I think it's only a matter of time before we have programming languages that hard enforce a standard formatting.
For example, suppose a compiler only accepted formatted code when it's optimising.