Stream: beginners

Topic: Readability/explicitness/glancability of proposal


view this post on Zulip Adroit (Apr 23 2025 at 17:40):

I'm just catching up on Roc's progress, and only just read the Abilities proposal followed immediately by this methods/static dispatch/mainstream syntax proposal - so pardon if this has changed since or if this opinion has been thoroughly expressed before.
image.png
This side-by-side is the before/after from the syntax proposal. I have the most experience with js-style "mainstream" syntax like most people, but Elm is my favorite language, so that's my bias.

The gist of it is:
The old code (left) is beautiful, glanceable, explicit, and reads like I would say it in my head. I can't say the same nearly as much for the new code on the left.

Whitespace makes it so easy to separate the individual pieces of a line that I can even do it subconsciously for the code that's outside of my fovea - I can even do it without the syntax highlighting (which relies on colors). But it sounds like whitespace would be deprecated or removed (removed is probably best). Much of the lines on the right are long unbroken strings of solid characters, and their separation is denoted with... more solid characters! It's a good thing this syntax highlighting scheme puts the parens in muted colors - the syntax highlighter is doing all of the heavy lifting on the right side.

(I can imagine whitespace still working with the new syntax if the dot chains don't have to be touching each other, maybe there's a way to support that? Like this.then.that -> this .then .that which I know currently means two different things)

It's also all the operators in general.

Thing is, I really like the actual features of the new proposal, normal functions as methods seems like the right way to go, and the "." operator is nicer all around than the "|>" operator. Perhaps in implementing this proposal there's no avoiding the loss of the old Elm style syntax (which reads more like poetry to me, the new appearing more like a randomly generated password), but I just wanted to take a minute to put this perspective out there for those doing the great language design work.

view this post on Zulip Anton (Apr 23 2025 at 17:50):

Hi @Adroit,
This trade-off has been discussed in depth in #ideas > ✔ reflecting on static dispatch... and discussing removin... @ 💬
I used to be on the whitespace side but after some experience with the new style I am completely used to it.

view this post on Zulip Adroit (Apr 23 2025 at 17:53):

Ahh okay thanks, yeah I have 19796 unread "recent conversations" in this Zulip so it's hard to know where to find the discussion that's still relevant

view this post on Zulip Anton (Apr 23 2025 at 17:54):

No problem, I'm happy to help people find stuff :)


Last updated: Jul 06 2025 at 12:14 UTC