!9IQChSjwSHXPPWTa:lix.systems

Lix

1102 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms295 Servers

Load older messages


SenderMessageTime
11 Dec 2025
@piegames:flausch.socialpiegames Honestly, why not ban identifiers that end with -[number] while keeping alphanumerics after dashes? 20:24:19
@raitobezarius:matrix.orgraitobezarius
In reply to @aloisw:julia0815.de
NO
My reaction while reading these last messages
20:24:29
@piegames:flausch.socialpiegamesThat would remove the most confusing case20:24:37
@qyriad:katesiria.orgQyriad
In reply to @piegames:flausch.social
Honestly, why not ban identifiers that end with -[number] while keeping alphanumerics after dashes?
agreed
20:24:43
@piegames:flausch.socialpiegamesDo we think this is a footgun big enough to warrant a depraction as of now, or will this wait for langver?20:25:18
@kfears:matrix.orgKFears (burnt out)
In reply to @qyriad:katesiria.org
imo Nixlang2: we simply always require spaces around subtraction
I very recently learned about https://gren-lang.org/ , which seems to do a lot of things right in a similar-ish direction
20:25:47
@aloisw:julia0815.dealoisw* packages.r"1password"20:25:49
@aloisw:julia0815.dealoisw
In reply to @aloisw:julia0815.de
packages.r"1password"
Yeah maybe not, r"" would be nice for regexes.
20:30:23
@charles:computer.surgeryCharles maybe v"" for variable 20:30:52
@charles:computer.surgeryCharles or i"" for ident 20:30:58
@kfears:matrix.orgKFears (burnt out) Double quotes regular strings and singular quotes for verbatim strings 20:32:24
@aloisw:julia0815.dealoisw Or copy Rust's r# prefix fully. Although that's weird with whitespace again. 20:32:33
@piegames:flausch.socialpiegames
In reply to @aloisw:julia0815.de
packages.r"1password"
Why the r" though? Because strings as identifiers literally already work today
20:54:16
@piegames:flausch.socialpiegamesI think y'all are confusing "raw identifiers" with "raw strings"20:54:45
@charles:computer.surgeryCharles

i don't think they do:

nix-repl> "1" = 2
Added "1".

nix-repl> "1"
"1"
21:04:59
@charles:computer.surgeryCharlesyou need some syntax to "dereference" a string as if it were a variable21:05:43
@charles:computer.surgeryCharlesyou can work around the lack of this today with this suggestion though21:06:09
@charles:computer.surgeryCharleslike this21:06:17
@charles:computer.surgeryCharles

e.g. imagine being able to do this instead of the workaround:

nix-repl> "1" = 2
Added "1".

nix-repl> i"1"
2
21:08:48
@helle:tacobelllabs.nethelle (just a stray cat girl)the rules for how strings vs substraction works does need to be easy to teach, so not too much heuristic pleaaaaase21:09:39
@helle:tacobelllabs.nethelle (just a stray cat girl)we wouldgo off on a massive UX and teaching this sort of stuff rant if we weren't feeling nauseous21:10:10
@charles:computer.surgeryCharles

if i were designing a language from scratch and i wanted support for more or less arbitrary identifiers, i would have two kinds of identifiers:

  • literal identifiers, like foo, foo_bar, _foo123, etc; XID_Start followed by >=0 XID_Continue
  • string identifiers, like i"..." to use an arbitrary string of characters and escape sequences to construct an identifier
21:13:16
@charles:computer.surgeryCharles so a-1 would parse as identifer a minus literal 1, not an identifier a-1 21:14:18
@commentator2.0:elia.gardenRutile (Commentator2.0) feel free to ping
In reply to @charles:computer.surgery

if i were designing a language from scratch and i wanted support for more or less arbitrary identifiers, i would have two kinds of identifiers:

  • literal identifiers, like foo, foo_bar, _foo123, etc; XID_Start followed by >=0 XID_Continue
  • string identifiers, like i"..." to use an arbitrary string of characters and escape sequences to construct an identifier
This honestly sounds quire reasonable
21:14:27
@charles:computer.surgeryCharles if you want a-1 as an identifier you'd write i"a-1" instead 21:14:32
@charles:computer.surgeryCharles this way you get the convenience of literal identifiers for the common cases, - behaves in an obvious way, and i"..." is an "escape hatch" for other cases like i"1Password" or whatever 21:16:19
@helle:tacobelllabs.nethelle (just a stray cat girl)so in addition to the formal form, I would always ask, "okay, so you are now teaching someone who just finished introduction to programming and introduction to Java, how would you explain this"21:17:26
@charles:computer.surgeryCharles also i would probably want to define e.g. a and i"a" as syntactically equivalent 21:17:39
@charles:computer.surgeryCharles "if you want arbitrary characters in your identifier then you can wrap it in i"..."" 21:18:12
@helle:tacobelllabs.nethelle (just a stray cat girl)yeah, and when does it become "arbitrary"?21:18:26

Show newer messages


Back to Room ListRoom Version: 10