zlacker

[parent] [thread] 12 comments
1. ramon1+(OP)[view] [source] 2025-12-03 15:32:11
I actually liked @T because you would pronounce it as "At T".

You could say "The address at T". Curious why people hated it, I might be missing something.

replies(1): >>stevek+Cr
2. stevek+Cr[view] [source] 2025-12-03 17:32:19
>>ramon1+(OP)
@T had a number of issues. The first was just that it was weird. People tend to not like weird things. Rust developed a reputation for "that language with a bunch of pointer types that are all weird."

The real reason it was removed in the end was just that it elevated a library concept into syntax. Today's Arc<T>/Rc<T> split isn't really possible in an @T world, for example. Shared ownership is a good concept, but you don't need special syntax to indicate it.

replies(2): >>zozbot+Fu >>MangoT+kt1
◧◩
3. zozbot+Fu[view] [source] [discussion] 2025-12-03 17:47:42
>>stevek+Cr
> The real reason it was removed in the end was just that it elevated a library concept into syntax.

Rust still does this in all sorts of silly ways, such as the ! type. What's the point of wasting an entire symbol that could have plenty of alternate uses on something that's so rarely used and could easily be defined as either a library type (empty enum) or at least be given a custom keyword, such as `never`? (Introduce it over an edition boundary, if you must preserve backwards compatibility.) The fact that it involves some compiler magic is no excuse; that's why Rust uses "langitem" markers within its core library.

replies(1): >>stevek+Lv
◧◩◪
4. stevek+Lv[view] [source] [discussion] 2025-12-03 17:52:22
>>zozbot+Fu
The standing joke for the last few years is that "the never type is named after its date of stabilization."

I certainly don't disagree that Rust has flaws, for sure. I think this particular one is pretty far down the list, though. I'm not sure what else I'd want to use ! for, and by virtue of it not being used so often means that it's much less of a pain than @T would have been, though I would also argue that 2012 Rust used ~T and @T far more than contemporary Rust does (I still remember pcwalton's mailing list post about how you didn't have to use ~ for comparing strings!) and so was even more painful at the time than would be now.

replies(1): >>iknows+ZQ
◧◩◪◨
5. iknows+ZQ[view] [source] [discussion] 2025-12-03 19:36:10
>>stevek+Lv
Swift and TypeScript use ! sort of like .unwrap(). Probably a better use of it than "never" tbh.
replies(3): >>stevek+801 >>bryanl+C91 >>ramon1+Ex1
◧◩◪◨⬒
6. stevek+801[view] [source] [discussion] 2025-12-03 20:17:17
>>iknows+ZQ
I'm not completely opposed but I'm also not sure syntax sugar for unwrap is a great idea.
◧◩◪◨⬒
7. bryanl+C91[view] [source] [discussion] 2025-12-03 21:02:06
>>iknows+ZQ
If ! was just used as never it could still be used as an operator, because those are different contexts AFAICT. However, its use in macro invocations seems likely to be more difficult to differentiate from operators.
◧◩
8. MangoT+kt1[view] [source] [discussion] 2025-12-03 22:45:25
>>stevek+Cr
> The first was just that it was weird.

Compared to what?

replies(1): >>stevek+Kv1
◧◩◪
9. stevek+Kv1[view] [source] [discussion] 2025-12-03 22:58:12
>>MangoT+kt1
People just found the trio of &T, @T, and ~T to be strange and confusing. Lots of Perl comparisons, many people really dislike punctuation of any kind, it seems.

Most languages only have one kind of pointer, and they tend to use & and * as operators for them.

replies(1): >>MangoT+Vz1
◧◩◪◨⬒
10. ramon1+Ex1[view] [source] [discussion] 2025-12-03 23:10:07
>>iknows+ZQ
We actually use this version of never a lot in our code at $WORK

```

export function never(message?: string): never {

  throw new Error(message ?? 'Reached an impossible state');
}

const [foo = never()] = dbQueryThatReturnsOne();

```

I guess it's en par with .unwrap()

◧◩◪◨
11. MangoT+Vz1[view] [source] [discussion] 2025-12-03 23:26:12
>>stevek+Kv1
Sure, but people also find pointers and references confusing (& certainly their distinction). Literally all programming is considered weird if you talk to the right person.

I would argue as a rule of thumb, anyone who focuses on syntax over semantics has little to contribute until they write ten thousand lines in the language. Perl is a great example of how it still fails after this test passes. Rust feels a lot more like java and c++ now, and not in a good way. It could have done more to improve on basic readability than where we ended up, and people still bitch about basic tenets of the language like "lifetimes" and "not being enough like java".

replies(1): >>stevek+TA1
◧◩◪◨⬒
12. stevek+TA1[view] [source] [discussion] 2025-12-03 23:32:43
>>MangoT+Vz1
You can stand on principle, or you can recognize that semantics is important, and syntax isn’t really, and therefore, accepting feedback about syntax is a fine thing to compromise on.

I also agree that you can’t listen to everyone, but this feedback was loud and pervasive.

replies(1): >>MangoT+KP1
◧◩◪◨⬒⬓
13. MangoT+KP1[view] [source] [discussion] 2025-12-04 01:30:26
>>stevek+TA1
> and syntax isn’t really,

Of course syntax is important. Otherwise people wouldn't complain about perl or C (eg wrt lack of operator overloading). It is just important in balance with semantics. And while I understand why rust compromised on this, IMHO it was a mistake that causes confusion about rust's memory management strategy. It looks too much like java and not enough like a language built around specific memory management paradigms. This compromise has backfired.

[go to top]