In Lua they have a really cool syntax for comments that gives you the following benefit:
(From https://www.lua.org/pil/1.3.html)
"
A comment starts anywhere with a double hyphen (--) and runs until the end of the line. Lua also offers block comments, which start with --[[ and run until the corresponding ]]. A common trick, when we want to comment out a piece of code, is to write the following:
--[[
print(10) -- no action (comment)
--]]
Now, if we add a single hyphen to the first line, the code is in again:
---[[
print(10) --> 10
--]]
In the first example, the -- in the last line is still inside the block comment. In the second example, the sequence ---[[ does not start a block comment; so, the print is outside comments. In this case, the last line becomes an independent comment, as it starts with --.
"
Is it too late to do something like this? Or is not enough of a benefit ? Or are we all using editors that do this well enough with any comment syntax and some hotkeys? Trying to get a feel for the ideas stream.
Roc uses # as the comment sigil to enable shebangs at the beginning of the file
Likely we want to keep that
So the question would be if we can add something like #[[ for block comments.
Brendan Hansknecht said:
Roc uses
#as the comment sigil to enable shebangs at the beginning of the file
Good point, really this is about adding multiline comments, which i vaguely remember wasn't included to keep things simple, but is this on/off debug functionality enough to outweight the complexity added to the language?
In my mind any editor can automatically comment out a block of code so it really shouldn't matter, but idk.
Brendan Hansknecht said:
In my mind any editor can automatically comment out a block of code so it really shouldn't matter, but idk.
Typically, but suppose you're in a headless environment working with a text editor you don't know particularly well like nano or something.
I think when there are multiple ways to do comments, this will lead to arguments about which is the right one.
Last updated: Jun 16 2026 at 16:19 UTC