Modern languages come with excellent auto-formatters which can make the code look nice at just about any line length. What we need to do is integrate the auto-formatting into the editor (likely via a language-server) so that it can adjust to the width of the editor dynamically instead of running it directly on the files at some width that's forced to be the same for every user of the codebase in every setting.
(I think this is a terrible idea, but also got me thinking if there's something interesting there)
Why is this terrible? Syntax errors would no longer exist, it would allow editors to work directly with the AST and not text... I think this is a fine idea personally.
Our current editors already try to do this - letting you work with syntax and not text - via smart completions, boilerplate templates, and syntax highlighting. Working with an AST directly is only taking it a step further (and better, it removes the reliance on context-insensitive regex based tooling in the editors).
smalltalk is storing the code together with the compiled result in an image, so it could do the same, but i am not aware of any implementation that does that.
Four years ago I wrote a stackoverflow question about this and included some pictures:
https://stackoverflow.com/questions/31414385/is-it-possible-...
I got a link to a dusty now-9-year-old issue in Jetbrains' tracker: