Language Design: Fixing Rust's mistakes – Syntax
(soc.me)
from soc@programming.dev to programming@programming.dev on 25 Apr 15:27
https://programming.dev/post/49377987
from soc@programming.dev to programming@programming.dev on 25 Apr 15:27
https://programming.dev/post/49377987
#programming
threaded - newest
This was a worthwhile read, even if my reactions were either “why tho?” or “please don’t” for most of the points lol
Agreed on all points except possibly semicolons. Automatic semicolon inference has a very big language footprint, similar to the range syntax that the author disliked.
That said, I don’t think the vararg suggestion belongs in this list of syntax changes. For this feature to be useful, it has to be at least powerful enough to replace
format!, but the current type system isn’t even remotely expressive enough to do this. I imagine this would require something like C++-style templates or comptime reflection, which goes well beyond syntax changes.I added the author’s other texts to my reading backlog too. Looks interesting.
Thank you for letting me know your thoughts!
Maybe not “very big”, but I agree with your point in principle.
The reason why I think it is worthwhile (compared to e. g. range syntax) is that we are paying for it anyway already:
Good error reporting hinges on parsing not strictly the language that’s defined, but understanding the language that people actually write – and people forget
;all the time.So from my POV I’m turning an error reporting step (that I’d have to implement anyway) into something more useful.
To be honest, if all the fancy formatting stuff requires a macro, so be it.
I just don’t want to need macros for creating a list and so on.