It isn't fleshed out and requires more thoughts: again this is just a demo to help the discussion on Discourse.
I used trailing to express that it comes after the op completes (after trailing locations), and also because nothing can come after a trailing comment on the same line.
We don't support /*.. */ comments anyway right?
I don't think anything else can add comments today, but if we added some in the future it shouldn't be an issue, you can accumulate trailing comments (// comment1 // comment2) :)
(assuming this is multiple comments on 1 line) -1 there, that looks clunky (especially if the comments are more than a few characters) and would likely be very unreadable.
That being said, I think right now your documentation leaves it open ended what "after the operation" means; i.e. I guess it could mean on separate line/same line/etc.
I would prefer we don't guarantee that the comment is on the same line as the operation, maybe we try to do that when we can (maybe one line and one comment?)?
Should this just be limited to the operation interface? Why not also add to the dialect interface? In some sense, I expect we may also end up allowing injection of comments from users outside of interfaces (though not important now).
Can you expand this a bit? Giving more detail, examples, etc?
It also isn't clear here if the comment is allowed to span multiple lines (which I guess not right now from the implementation?).
Should we always print comments?
Discussed this with River:
- We want something more general: inject information to be printed as comment before, after, or trailing the operation.
- The interface is restricting us to a single information to be printed per operation. We can have this "print user count" added as an external model and also add another one. We likely want something that composes better.