Stream: ideas

Topic: ✔ Covering nominal/opaque types in tutorial


view this post on Zulip Aurélien Geron (May 11 2026 at 20:42):

Hi folks!
After going through the Roc tutorial for the new compiler, I was confused about the [].{} syntax and the difference between :: and :=. I now understand that it's type def syntax and :: is for opaque types. I feel like the tutorial should cover this, at least in passing, because it's hard to search for information about it when you don't know what it is. It's not like you can search for "opaque" if you don't know what :: is, and searching for "::" or ":=" is tricky.
That said, it might be a sign that the syntax should be more beginner-friendly. For example:

Color := opaque type [...].{...}

Note: this is just a random syntax example to get my point across, not a suggestion for an actual syntax.

view this post on Zulip Richard Feldman (May 11 2026 at 23:42):

yeah, for sure! I need to do a thorough revamp of the tutorial once the new compiler is fully operational :smile:

view this post on Zulip Aurélien Geron (May 12 2026 at 02:24):

The :: and := and [].{} syntax is definitely the scariest part of Roc's syntax to me. Perhaps it's ok if it's not needed too often.

view this post on Zulip Rick Hull (May 12 2026 at 12:22):

I agree; coming from the outside, it doesn't "read well". It reminds me of Nix in that way. My sense is that the "purity of expression" requires that we chew through a little bit of bread to get to the meat of the sandwich. It would probably be very helpful to explain what the bread is and why it's there.

view this post on Zulip Anton (May 13 2026 at 08:33):

I agree, I would also prefer adding opaque somewhere and using := instead of ::.

view this post on Zulip Richard Feldman (May 13 2026 at 15:45):

I'm open to revisiting this syntax design but it's a big design can of worms I don't want to open right now. At the moment I want to focus on getting the new compiler usable to the point where it can be announced :smile:

view this post on Zulip Notification Bot (May 13 2026 at 16:45):

Anton has marked this topic as resolved.


Last updated: Jun 16 2026 at 16:19 UTC