Should we go ahead and create an issue for moving from whitespace application to Parens and Commas application syntax (PNC)? And land it ahead of Static Dispatch?
This is work I'm _very_ interested in tackling, so if we have consensus, I can begin in earnest over the next wekk
I think it's basically orthogonal to static dispatch, so that sounds good to me. We'll need to support spaces and parens to start with.
Sam Mohr said:
We'll need to support spaces and parens to start with.
That's gonna get messy pretty quick, but we can explore. We might have to have a "PNC" detector pre-parse phase or something to put the parser into PNC mode
And then have a MIgrationFlag to move WSA(Whitespace application) to PNC
I don't think for a single file we want a mix of WSA and PNC
What is PNC? :sweat_smile:
Georges Boris said:
What is PNC? :sweat_smile:
Sorry, added clarification in the first message
Anthony Bullard said:
I don't think for a single file we want a mix of WSA and PNC
We've had good success with doing Tasks or Purity Inference based on the start of the file, and I agree there should be no need for both parens and space application in the same file
For the most part, I don't think PNC conflicts with space-based calling
If we can avoid having two different modes for the parser, that sounds preferable to me
To expand on that a bit, in order to support both of these cleanly, we need to be a little bit picky about whitespace around parens (at least temporarily)
a(1, 2, 3) is a PNC function call with three args, and a (1, 2, 3) is a space-style function call with one arg (that just happens to be a tuple).
yeah it's very helpful if they can coexist for some period of time because it means the formatter can convert from one to the other
Sounds good. I’ve always thought that a space between function name and the args (gnu style) is a thought crime
I had no idea anyone used that style in C land
Read this if you want to cry/vomit: https://www.gnu.org/prep/standards/html_node/Syntactic-Conventions.html#Syntactic-Conventions
Sounds like there are no dissenters to creating the issue. Will do that now
(deleted)
https://github.com/roc-lang/roc/issues/7415
Anthony Bullard has marked this topic as resolved.
As an outsider, i would say the white space is a unique selling point of Roc. I understand it may not matter much in structure, but syntax matters too. Conciseness of the code does not necessarily make it more readable, on the contrary. To me it looks similar to how ReasonML tried to make JavaScript out of OCaml, making it Just Another Programming Language.
ReasonML has largely failed for many other reasons - mostly that the OCaml/ReasonML/REScript tooling and story was complicated and hard to navigate. Not to mention a couple different competing standard libraries, and too much focus on winning over React devs.
I personally can say ReasonML is the first time most people I know every looked at a ML-family language seriously
Syntax does matter, but many people just don't like syntaxes that feel "weird" to them. See Elixir over Erlang as one example, or Java/Kotlin/Scala all being much more used than Clojure despite Clojure being a _very_ good language.
Then again, for those who do like the weird Clojure syntax, it is a blessing there is a language for them. There are many c-like languages out there. Roc becoming one of them will make it less significant. Roc as that one ML syntax based language that got it right would have.
I think the significance of a language is in the semantics, but I won’t speak for Richard here
Eelco Hoekema said:
There are many c-like languages out there. Roc becoming one of them will make it less significant. Roc as that one ML syntax based language that got it right would have.
the goal is to make Roc a great language for making delightful software, not to score points on the language syntax scoreboard :big_smile:
I think it's totally fair to prefer one syntax over another - everyone has preferences, myself included! - but I think "Roc should have whitespace calling because that's not mainstream and Roc should help make it mainstream" would be the wrong reason to make that syntax decision
That is a bit ridiculising it. My fear is the opposite, that with this change Roc trades delight for mainstreamness. Which, i think, would be a terrible reason to make a syntax decision. It is disappointing, but then again, i am an outsider, it is your language.
If you read a lot of the initial discussion, this is trying to unlock a new form of delightfulness. One direct example is that you get . completion with chaining. That is much more delightful than pipelining qualified functions when making a chain of transformation. While space calling convention is awesome for DSL, it can often fall short for regular code.
This design is not chasing mainstreamness. It can be maybe seen as a nice side effect that it is more mainstream, but the focus is on improving roc capabilities and tooling.
Personally, I have thought about this a lot, and was originally quite against this. Space calling convention was one of the pieces of roc that made it unique and special to me. It definitely is a large part of the feel of roc. Kinda feels like part of the heart of roc to me. At the same time, after a while of thought and discussion, I think this is the right way for roc to go. dot calling convention enables better tooling and readability in a number of very common cases.
Got it, thanks. It is a tradeoff, valuing writeability over code clarity. Still makes me sad.
Last updated: Jun 16 2026 at 16:19 UTC