Replies: 6 comments 20 replies
-
I like this 👀 Not so sure about the For best multiline comment, I personally love Lua's So this could be Or get inspired by markdown's backquote repetitions.. |
Beta Was this translation helpful? Give feedback.
-
Does the above imply a shebang on line 1 would be a syntax error too? #!/usr/bin/env kdl |
Beta Was this translation helpful? Give feedback.
-
I agree that this is quite a change to justify a v3 so quickly, but also... I like it? Relying on # as the general meta-dispatch character for everything is pretty clean, and it means our single-line comments match Python rather than JS, which is a perfectly acceptable lateral move. (It also matches YAML and TOML.) As I say in another comment here, I think we'd accompany this move with a declaration of |
Beta Was this translation helpful? Give feedback.
-
On one hand, I agree that the ship has sailed. On the other hand, this is a really nice solution that I like more than any of the solutions I proposed, and I think if enough of the users/implementers think this is worth it, it could be worth the friction to make KDL more ergonomic? For one, most URLs would be valid bare identifiers. |
Beta Was this translation helpful? Give feedback.
-
Another thought I had about this. Consider these two examples:
So our choices seem to be:
My main concern with 3 is that it's a very subtle nag that requires a bit more detailed knowledge of the language. It would work in like 99.9% of cases. I'm just worried about how materially frustrating and disruptive the other cases will be, and whether this means users will make a habit of scanning their URLs for Thoughts? |
Beta Was this translation helpful? Give feedback.
-
I'm… not convinced this is a good idea. We now have four significant characters in the syntax: As an example, we explicitly require space between all values, but not between values and comments.
That's a few steps back from what we currently have
Another example, I'm working on a document
and I want to comment
is a valid document. The same can't be said for me forgetting the If I wrote
did I forget to add a This doesn't feel like an improvement to me. Yes, it buys us the |
Beta Was this translation helpful? Give feedback.
-
I... I really am not sure this is a good idea, but I thought I'd put it here just for funsies:
We could remove
/
from reserved characters if we took advantage of the fact that#
is reserved now, and is treated as a dispatch character:(EDIT: single-line comments would be
#!
, as suggested below)Single line comments would be
#!
, multiline would be#* *#
, and slashdash would become hashdash#-
.With that in place, the following would become legal:
but:
Note that this only addresses
/
, so Windows paths are still screwed, but Windows supports correct slashes these days so it's probably fine.And don't get me started about how this ship has absolutely sailed. It's probably not a ton of work to update parsers with this change but gosh it feels like some annoying logistics to suddenly push out a v3. And we should probably have a better commitment to long term stability anyway.
Previously, with credit to jax: #409
Beta Was this translation helpful? Give feedback.
All reactions