This is a question that's a bit beyond the scope of 0.1.0 or the specific question here, but do you think it's fair for Roc to just require more explicit annotations in certain cases? I come from the bias that I basically require my agent to write lots of type annotations. So I don't really benefit from the compiler's ability to infer types. Instead, I just pay for compiler complexity when I'm more than happy to have verbose code.
Steve Howell said:
do you think it's fair for Roc to just require more explicit annotations in certain cases?
well it's obviously a downside
my view is that it's on the negative side of a tradeoff, and if the positive side is sufficiently large, it can potentially outweigh that
those tradeoffs have to be weighed on a case-by-case basis, and I think this is one set of tradeoffs that should be weighed sometime after 0.1.0 :smile:
Is part of the pitch for Roc that you don't have to bother writing annotations? I had very much the same question while I was writing Elm. Out of curiosity, are there any close cousins to Roc that are more strict?
more strict in what sense?
annotations not optional
if I remember right, I think Gleam has an ML-family type system and requires annotations on all top-level functions
I wouldn't say that "no type annotations" is a critical part of the pitch for Roc, but I do think it's a benefit that should not be given up for little gain
I guess my position is that I don't really see the gains in the kind of work I do. It's just a data point, to be clear. I haven't ever used Roc as a "scripting" language, though, and I know that's part of your vision. (or correct me if I'm wrong)
I think not requiring type annotations makes Roc more approachable and attractive when people check it out.
11 messages were moved here from #announcements > breaking changes: operator desugaring and shadowing by Anton.
re: the announcement: I hope the more explicit numeric types remains on the horizon as a thorn as stated, rather than temporary-permanent status quo. I find total type inference goal absolutely beautiful (and the fact that language having a nice number of syntax features and still doesn't require explicitness).
just to clarify, what do you mean by "the more explicit numeric types"?
The clarification is I misread your announcement, sorry for confusion :sweat_smile: I was thinking of something else.
Arithmetic operators that act on different types are enticing, so I'm sure it will come up later naturally. The a, a -> a is a very reasonable limitation for now :)
Yeah, I think for the long tail, people doing physics for example always use units in equations if possible instead of bare unit-less numbers. When teaching/learning that’s a good help to check your equation formulas. Your time duration example is typically the "unit" situation. I could see this being useful in games too to differentiate frames of reference, like in-game units VS viewport units. That’s one obvious use case I see where supporting different types for numeric operators would be useful.
I think is an interesting data point where requiring annotations would prevent a certain level of confusion. I'm not claiming it's more important than the approachability tradeoff. I already basically enforce that agents use annotations, so take this with a grain of salt.
I actually code in annotations now with agents. I don't use a code editor, but I will often tell Claude that I want a function with the type signature of (Position, Position) -> Distance. This somewhat relates to what @Matthieu Pizenberg bring up in terms of units. I actually have scripts that produce me excerpts of Roc that are primarily annotations. I trust Claude on functions innards, but Claude often gets the types wrong when I am sloppy about expressing requirements.
Richard Feldman said:
if I remember right, I think Gleam has an ML-family type system and requires annotations on all top-level functions
I was curious. It turns out Gleam only requires annotations for external functions. source: googled "gleam mandatory annotations". More info on google.
Last updated: Nov 26 2026 at 20:35 UTC