Description
This issue is for bikeshedding the spelling of the topic reference’s token in Hack pipes, branching off from #75 (comment).
The table has its own editable page on the wiki. Please read this table first before contributing to this issue.
Please also keep discussion on topic: bikeshedding the topic reference. For other topics, search for other existing issues. Thank you!
Old obsolete questions
For more context, see the Hack pipes proposal and the wiki home page.
These currently are the most topical bikeshedding questions that I see now:
-
What is the optimal tradeoff in writability (easily typed ASCII soup, e.g.,
?
, or easily typed privileged valid variable, e.g.,$
) versus readability (less easily inputted non-ASCII syntax, e.g.,■
)? -
Related to question 2: Can non-ASCII Unicode syntax characters be considered for the pipe placeholder, or must they be categorically excluded?
A list of all possible
Pattern_Syntax
Unicode characters is available. -
If question 3’s answer is that non-ASCII Unicode syntax may be excluded, which non-ASCII syntax character would be visually understandable and/or less difficuldifficultt?
Many non-ASCII symbols are easily inputted in certain OSes. For instance, in macOS, several dozen typographic characters are directly typable using Option or Option + Shift (image of keyboards with various active modifier keys via Macworld article. It may be worth determining if there is an intersection of these easily typable non-ASCII characters across the default keyboard layouts of many OSes.
-
For nullary operators vs. valid variable identifiers: How important is it that the placeholder be statically analyzable?
A nullary operator can be always be statically recognized in the RHS. In contrast, a valid identifier can be statically recognized only if the rule is: “Tacit function calling may occur only when the RHS is a bare identifier, rather than allowing the RHS to be any arbitrary expression without a placeholder.”
-
Operator vs. identifier again: How often would someone want to use an identifier from an outer lexical context of the same name as the pipe placeholder?
If the placeholder is
$
, how often would a programmer want to use jQuery’s$
or another externally defined$
in a pipe’s RHS, as well as the pipe placeholder? How often would they be surprised if they could not, without defining a dummy variable for the outer$
? How bad of a footgun (i.e., bug by programmer-unexpected behavior) would this be? -
How much should the pipe placeholder stay compatible with @rbuckton’s higher-order functional operators, which possibly would use
{…}
? -
@rbuckton proposed a partial-application placeholder that may be explainable by multiple topic placeholders. In other words, the pipeline syntax might be completely unifiable with the PA syntax with the right enhancements.
Assuming a future shorthand “pipe-function operator” like
+>
(which would be an abbreviation forx=>x|>
), then @rbuckton’s proposal’sf(?, 3)
would instead be+> f(?, 3)
, which in turn would be shorthand forx=>x|> f(?, 3)
.Creating non-unary functions could be done
by adding numbers to placeholders,
such as?0
,?1
,?2
, etc.
For instance,example.sort(+> ?0 - ?1)
would meanexample.sort((x, y) => x - y)
.
(?0
would be equivalent to plain?
.)Which placeholders would have any problems with staying forward compatible with such a future proposal?
As of 2025-04-07, I most like #
, followed by ^^
or ##
, then more distantly #_
, @@
, and %%
.