Replies: 11 comments 39 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: https://example.com#!anchor
random-string#!oops I forgot a space before #! 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 node #"value"#/* comment */#"value too"# Another example, I'm working on a document node "value" \
#"raw\ value"# and I want to comment node #"value" \
#"raw\ value"# 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.
-
Hi, new here, just found this discussion :) It seems that you've come to the conclusion that this is not a good idea? What about the original idea to at least allow single / in identifiers? That would still make most paths possible. |
Beta Was this translation helpful? Give feedback.
-
i don't have skin in this game, but as a survey of what other languages do - clojure uses maybe that fits into kdl? you could have e.g. |
Beta Was this translation helpful? Give feedback.
-
Having had to deal with cross-platform path handling a lot recently, I would personally err on the side of not bothering. What I love about KDL is how human-parseable it is. File system paths on all platforms (but especially Windows) are so full of weird things that trip humans up, it's crazy.
To be clear, I'd be fine either way, but I do think KDL 2 is particularly elegant in its simplicity. |
Beta Was this translation helpful? Give feedback.
-
A couple thoughts, but apologies I'm a language person coming out of left field a bit having only dabbled with kdl. I helped create Nushell, so I've worked in systems that had to spend a lot of energy supporting bare word strings. We tried a good handful of things, but if you're half-way to what a shell already thinks (that Multiline comments are something you could consider, but honestly in practice most editors can turn comments on and off if the whole lines are comments, making the older reason for including them in the language a bit obsolete these days (unless you have aesthetic reasons). |
Beta Was this translation helpful? Give feedback.
-
I've since found a workaround for my Open Sound Control use case (replace all Maybe have some way to replace special characters at a per-document level? For example, if I wanted to use
or
Downsides:
Upsides:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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