News for hackers. Stuff that matters.
Re:Evergreen: A Provably Safe Systems Language by kreco on Wednesday November 04, 2026 @12:15PM (#50368591)
Sorry for the non constructive comment:

I wish we would stop xxx::yyy::zzz for namespace.

It was horrible in C++ from day one, and is still horrible in Rust.

It had some reason to be this way in C++ but not in any other newer language.

Real negative part: it looks to me that the authors of those languages are parroting other languages rather than understanding the reason of those language choice.

This simply worries me because I judge the level of expertise and makes me not consider the language in the first place.

(I know C++ and Rust are alive but they share their fair share of poor design choice)

Re:Evergreen: A Provably Safe Systems Language by aeve890 on Wednesday November 04, 2026 @12:20PM (#50368657)
Hard agree. PHP did it right with backslashes.
Re:Evergreen: A Provably Safe Systems Language by jordan_bonecut on Wednesday November 04, 2026 @12:47PM (#50369033)
That, sir, is a hot take
Re:Evergreen: A Provably Safe Systems Language by bigbuppo on Wednesday November 04, 2026 @01:33PM (#50369649)
I'm assuming it was a joke. I'm hoping it was a joke. Please assure me it was a joke.
Re:Evergreen: A Provably Safe Systems Language by aeve890 on Wednesday November 11, 2026 @04:25PM (#50458905)
Yeah it was a joke :)
Re:Evergreen: A Provably Safe Systems Language by edf13 on Wednesday November 04, 2026 @12:32PM (#50368824)
Any links to the historical reason for C++ using ::?
Re:Evergreen: A Provably Safe Systems Language by kreco on Wednesday November 04, 2026 @12:45PM (#50369000)
I don't have a link but you can search on the web. I have the .pdf on my computer).

From "A History of C++: 1979− 1991".

> In C with Classes, a dot was used to express membership of a class as well as expressing selection of a member of a particular object. This had been the cause of some minor confusion and could also be used to construct ambiguous examples. To alleviate this, :: was introduced to mean membership of class and . was retained exclusively for membership of object.

It was taken from Algol68.

Then, this was reused for namespaces for consistency reason.

Re:Evergreen: A Provably Safe Systems Language by jordan_bonecut on Wednesday November 04, 2026 @12:38PM (#50368904)
This is good feedback. I will chew on this…
Re:Evergreen: A Provably Safe Systems Language by kreco on Wednesday November 04, 2026 @01:43PM (#50369787)
Don't think too much about it though, it was to express a personal opinion.

I just like "dots" for everything, and there are some reasons to distinguish package/module qualification, struct/class member access (.), or static member access (::).

Re:Evergreen: A Provably Safe Systems Language by mantomat on Wednesday November 04, 2026 @12:46PM (#50369020)
> It was horrible in C++ from day one, and is still horrible in Rust.

I don't get it. Is it syntactically horrible or are there real reasons that I'm missing?

Re:Evergreen: A Provably Safe Systems Language by ModernMech on Wednesday November 04, 2026 @01:05PM (#50369275)
For me, I guess it’s just that foo/bar is standard and fewer characters so it’s the obvious and ergonomic choice. But we can’t use that because of infix math, which is also a choice. So why are the choices made that way? “We made it easier to write mathematical notation at the expense of making it worse to talk about every namespace” isn’t the best trade off all the time.
Re:Evergreen: A Provably Safe Systems Language by kreco on Wednesday November 04, 2026 @01:44PM (#50369806)
No it's just a personal opinion. I like the UX of using dots for everything.
Re:Evergreen: A Provably Safe Systems Language by packetlost on Wednesday November 04, 2026 @12:52PM (#50369107)
My favorite namespacing syntax is ironically Clojures. module/func or fully.qualified.module/func or just func if you explicitly import the symbol. I vastly prefer shallow namespacing (module/func) most of the time.

I write Rust mostly for my day job (and it's also my preferred language on the side these days), so I usually end up explicitly importing all the symbols I actually use because module::func is just additional noise in an already pretty verbose language and is what's considered 'idiomatic'.

I don't really get the issue with :: being the separator used here. It's slightly ugly, but it's visually distinct from . for field access, which I do appreciate.

Re:Evergreen: A Provably Safe Systems Language by roarcher on Wednesday November 04, 2026 @01:02PM (#50369228)
> it looks to me that the authors of those languages are parroting other languages rather than understanding the reason of those language choice.

I don't mean this to sound combative, but I think you are the one who doesn't understand the reason for the language choice. I assume you're objecting to the fact that these languages use different operators for module/namespace paths (`::`) and object member/method access (`.`), not the `::` symbol specifically.

You seem to assume that Rust blindly imitated C++, but that's not the case. The `::` syntax allows the compiler to know which paths can be resolved statically, before type inference and other analysis. This is important because macros are invoked between these stages, and can in turn introduce more static names which must also be resolved before any further compilation.

You might be able to introduce a rule that any `.`-path that can be resolved statically will be, trumping any non-static members (or maybe not, it might cause ambiguities I'm not thinking of), but Rust's design philosophy has always favored explicitness.

Re:Evergreen: A Provably Safe Systems Language by kreco on Wednesday November 04, 2026 @01:34PM (#50369670)
I assumed Evergreen blindly imitated Rust.

However, I believe Rust purposely imitated C++, for reasons. And I still don't like it.

A lot of language are doing fine using dots. And if you are going to use '::' you can have your reasons. I would still find it annoying to type and read.

Most of the languages I used are doing fine with dots.

Just to add precision: I critic the syntax (which is very subjective), and I critic the parroting, as two separated arguments.

Re:Evergreen: A Provably Safe Systems Language by roarcher on Wednesday November 04, 2026 @01:45PM (#50369818)
> A lot of language are doing fine using dots.

I have implemented one such language, and while it is indeed doing fine, the dots-everywhere syntax really does complicate name resolution. It only uses it because the distinction between two different operators would be lost on its intended less-technical audience. It is a (in my opinion unfortunate) tradeoff made for a specific reason.

And one thing those languages all (as far as I know) have in common is that they do not have Rust's macro system. It may well be impossible to implement that without a distinct operator.

I have no opinion as to whether that operator should be `::` or some other arbitrary symbol, but I believe that no matter what symbol they chose, someone would complain that it doesn't fit their personal taste. Can't please everybody.

Re:Evergreen: A Provably Safe Systems Language by Joker_vD on Friday November 06, 2026 @04:21AM (#50390070)
> I have implemented one such language, and while it is indeed doing fine, the dots-everywhere syntax really does complicate name resolution.

Can you share an example? In my experience, this only happens with serious reuse of names across both types and values, e.g. with something like

    struct a { 
        struct x {
            typedef int y;
            y x;
        };

        struct y {
            typedef double x;
            x y;
        };

        static x y;
        y x;
    };


    a a;
after which the unified syntax "a.x.y" could either mean a typedefed int from struct x, or a double field from struct y... but why would you even want to support such scenarios? C++, for example, prohibits namespaces from sharing the names with types and values in the same scope, and even though it uses "::" for namespace lookups, it still had to introduce "typename" keyword to explicitly disambiguate the type names from values anyhow so...