News for hackers. Stuff that matters.
Re:Xz: Can you spot the single character that disabled Linux... by naikrovek on Saturday March 30, 2024 @07:07PM (#39879542)
> white space as a delimiter is why i never use python.

Whitespace is a delimiter in (almost?) all languages humans use.

Whitespace determining which scope you’re in is one of the many problems of making whitespace significant.

Re:Xz: Can you spot the single character that disabled Linux... by ratmice on Saturday March 30, 2024 @08:02PM (#39879910)
Regarding your almost query. There was a debate over Ogham space mark in unicode. It is considered whitespace though, with the rationale that it is sometimes visible, but sometimes invisible. Depending upon whether the text has a stem-line. That doesn't make the set of non-whitespace delimited languages empty. Perhaps there is one with an always-visible delimiter that didn't get the whitespace justification, but does at least give one human language delimited by a printable character (which happens to be whitespace).
Re:Xz: Can you spot the single character that disabled Linux... by eru on Saturday March 30, 2024 @10:17PM (#39880741)
> That doesn't make the set of non-whitespace delimited languages empty.

Well, there's also the opposite: Goldman Sachs's Slang allows space as part of identifiers.

Re:Xz: Can you spot the single character that disabled Linux... by skissane on Sunday March 31, 2024 @06:19AM (#39882959)
> Well, there's also the opposite: Goldman Sachs's Slang allows space as part of identifiers.

Many SQL implementations permit whitespace in identifiers, but then you need to use quoted identifiers.

Re:Xz: Can you spot the single character that disabled Linux... by eru on Sunday March 31, 2024 @06:21AM (#39882968)
That's reasonably sane of SQL. In Slang, you don't need to quote. (The syntax is still unambiguous. In principle, eg Python could do something similar, because they don't have any existing syntax where you just put two identifiers next to each other with only a space in between. But C could not, because variable declaration is just two identifiers, one for the type and one for the variable name, next to each other with a space in between.)
Re:Xz: Can you spot the single character that disabled Linux... by skissane on Sunday March 31, 2024 @06:44AM (#39883090)
In Slang, are “x y” with different number of spaces in the middle different identifiers or different spellings of the same identifier? SQL standard says different identifiers

> eg Python could do something similar, because they don't have any existing syntax where you just put two identifiers next to each other with only a space in between

The interaction with keywords would cause some issues. For example, right now, “if” is not a valid identifier (keyword), but “if_” and “_if” are. However, with this proposal “x y” could be a valid identifier, but “x if” would introduce ambiguity

> But C could not, because variable declaration is just two identifiers, one for the type and one for the variable name, next to each other with a space in between

This is one aspect of C syntax I have never liked. I always wish it had been Pascal-style `x:int;` instead of `int x;`

Re:Xz: Can you spot the single character that disabled Linux... by eru on Sunday March 31, 2024 @11:26AM (#39885103)
> In Slang, are “x y” with different number of spaces in the middle different identifiers or different spellings of the same identifier? SQL standard says different identifiers

Sorry, I don't remember, and I can't seem to find it out online. I could ask my friends who still work there, if it's important. (For what it's worth, I never remember anyone complaining about mixing up a different number of spaces in their variable names. So either all number of spaces were treated the same, or perhaps multiple spaces in a row in an identifier were just banned (via linter or via language?).)

> The interaction with keywords would cause some issues. For example, right now, “if” is not a valid identifier (keyword), but “if_” and “_if” are. However, with this proposal “x y” could be a valid identifier, but “x if” would introduce ambiguity

Yes, you would need to sort out these details, if you wanted to add this 'feature' to Python.

> This is one aspect of C syntax I have never liked. I always wish it had been Pascal-style `x:int;` instead of `int x;`

I'm glad Rust made the same decision.

I do like using the 'space operator' to denote functions calls, at least for a language like Haskell or OCaml.

Re:Xz: Can you spot the single character that disabled Linux... by tomoyoirl on Saturday March 30, 2024 @07:32PM (#39879692)
“The thing that controls scope is the count of certain nonprinting characters, which happen to come in multiple widths” is reasonably insane, yes
Re:Xz: Can you spot the single character that disabled Linux... by eru on Saturday March 30, 2024 @10:16PM (#39880734)
Which non-printing characters are you talking about? Whitespace characters are very much printable.

Yes, I agree that Python should just forbid tabs. As a second best, you can tell your linter (and/or formatter) to forbid tabs (and any weird unicode whitespace). That's basically the equivalent of compiling your C with -Wall.

Re:Xz: Can you spot the single character that disabled Linux... by takeda on Sunday March 31, 2024 @02:44AM (#39881994)
This was an issue in Python 2, where for some dumb reason it allowed mixing tabs and spaces and equated tab to 8 spaces (I think). Python 3 doesn't have that issue.
Re:Xz: Can you spot the single character that disabled Linux... by capitainenemo on Sunday March 31, 2024 @03:41PM (#39887361)
Of course, if one was coding an exploit, one could still use python2. It is still commonly available due to a long tail of legacy scripts and in some cases (like a script I use routinely but didn't write) the difficulty of porting it to python3 (I've asked over a dozen pythonistas over the years, they kept running into same problems)
Re:Xz: Can you spot the single character that disabled Linux... by WirelessGigabit on Saturday March 30, 2024 @11:10PM (#39881027)
Human language is also way more ambiguous. One of the reasons I love coding is a massively reduced vocabulary and a way more strict grammer.