News for hackers. Stuff that matters.
Re:Why Discord is switching from Go to Rust by calcifer on Tuesday February 04, 2020 @05:10PM (#22241575)
> You have to distinguish between the features available to a Go program as the user writes it and the implementation of the language.

I do, I'm just objecting to "Go is implemented in Go".

Re:Why Discord is switching from Go to Rust by dodobirdlord on Tuesday February 04, 2020 @11:35PM (#22244060)
This reminds me of the ongoing saga of RUSTC_BOOTSTRAP[0][1]

The stable compiler is permitted to use unstable features in stable builds, but only for compiling the compiler. In essence, there are some Rust features that are supported by the compiler but only permitted to be used by the compiler. Unsurprisingly, various non-compiler users of Rust have decided that they want those features and begun setting the RUSTC_BOOTSTRAP envvar to build things other than the compiler, prompting consternation from the compiler team.

[0] https://github.com/rust-lang/cargo/issues/6627 [1] https://github.com/rust-lang/cargo/issues/7088

Re:Why Discord is switching from Go to Rust by estebank on Wednesday February 05, 2020 @01:15AM (#22244429)
This is not entirely correct. These things that "can only be used by the compiler" are nightly features that haven't been stabilized yet. Some of them might never be stabilized, but you could always use them in a nightly conpiler, stability assurances just fly out the window then. This is also why using that environment variable is highly discouraged: it breaks the stability guarantees of the language and you're effectively using a pinned nightly. This is reasonable only in a very small handful of cases.
Re:Why Discord is switching from Go to Rust by giornogiovanna on Wednesday February 05, 2020 @01:53AM (#22244596)
Yep. Beyond that, there is at least one place[0] where the standard library uses undefined behavior "based on its privileged knowledge of rustc internals".

[0]: https://doc.rust-lang.org/src/std/io/mod.rs.html#379

Re:Why Discord is switching from Go to Rust by dodobirdlord on Wednesday February 05, 2020 @02:25AM (#22244718)
I don't see what is incorrect? Perhaps I was insufficiently clear that when I said "the compiler" I meant "the stable compiler" as opposed to more generally all possible versions of rustc. The stable compiler is permitted to use unstable features for its own bootstrap, example being the limited use of const generics to compile parts of the standard library.
Re:Why Discord is switching from Go to Rust by _ph_ on Wednesday February 05, 2020 @02:01AM (#22244639)
But on what basis? What part of Go isn't implemented in Go?
Re:Why Discord is switching from Go to Rust by calcifer on Wednesday February 05, 2020 @04:14AM (#22245206)
I gave an example a bit further up, here [1].

[1] https://news.ycombinator.com/item?id=22240223

Re:Why Discord is switching from Go to Rust by _ph_ on Wednesday February 05, 2020 @04:43AM (#22245384)
But this isn't a contradiction to the statement, that Go is implemented in Go. If you look at the sources of the Go implementation, the source code is 99% Go, with a few assembly functions (most for optimizations not performed by the compiler) and no other programming language used.
Re:Why Discord is switching from Go to Rust by calcifer on Wednesday February 05, 2020 @07:50AM (#22246286)
That's not correct. The implementation of "make", for example, looks like Go but isn't - it relies on internal details of the gc compiler that isn't part of the spec [1]. That's why a Go user can't implement "make" in Go.

[1] https://golang.org/ref/spec

Re:Why Discord is switching from Go to Rust by _ph_ on Wednesday February 05, 2020 @08:11AM (#22246406)
In which language do you think is "make" implemented?
Re:Why Discord is switching from Go to Rust by scott_s on Wednesday February 05, 2020 @10:38AM (#22247651)
If I may interject: I believe you are both trying to make orthogonal points. calcifer's is trying to say that some features of Go are compiler intrinsics, and cannot be implemented as a library. You are making a different point, which is that those intrinsics are implemented in Go, the host language. Both statement can be true at the same time, but I agree that the terms were not used entirely accurately, causing confusion.