Live data from Hacker News

The Rust standard library no longer has any scheduling baked into it

mail.mozilla.org

11–20 of 71 posts

Re: The Rust standard library no longer has any scheduling baked into it

#11
post #7
post #5

Earlier quoted context omitted.

On the flip side, though, those assumptions are also what lets a runtime actually do things for you. In the limit, a runtime that assumes nothing is simply machine language. Even C has a runtime, whose assumptions can be violated quite thoroughly by other languages. The less the language actually specifies, the more likely you are to encounter the situation where two Rust libraries can't work together because they ac…

This strikes me a pragmatic decision driven by wanting to reduce complexity and be interoperable with 3rd party libraries (mostly C code). If you read my other comment here, I outlined the problems I ran into with the N:M threading model (although mostly in C land). It strikes me as Rust ran into the same issues. I'm beginning to think that you can't make N:M well unless you take the approach that language X itself i…

"I don't know Erlang's stance on this."

Erlang's stance is probably irrelevant to anyone in the Go/Rust/C/C++ etc community; it does so many things differently that its experiences are unlikely to be useful. I'm pretty sure it's M:N, but, for instance, it also trivially has a NOT-stop-the-world GC, which is something that not many languages can say. Not only that it isn't "stop the world" but that it's also fairly trivially so. It doesn't have synchronization problems because it basically doesn't have synchronization. (In the OS sense. Of course your user code may have various sync concerns, but there's no OS-level race conditions, or memory race conditions, etc.) It pays for these characteristics, but also reaps various benefits.

(It's a pity that I don't know of any great single chunk of documentation on the Erlang VM I can point to; links solicited. It's such a different beast. Someone interested in learning about how it's different without necessarily learning Erlang would probably better just studying the VM itself.)

P.S.: Yo, 'sup.

Re: The Rust standard library no longer has any scheduling baked into it

#12
post #4

I've also have come full circle on N:M / green threads. Now I'm back to thinking they aren't worth the effort / pain. My experience comes from C / C++ land and not Go and Rust but I think same lessons apply. In experience I ended up using a few different framework from libcoro to Mordor to raw swapcontext(). I was initially sold on the N:M model as a means of having event driven programming without the callback hell.…

I read somewhere that Solaris has the best support for non-blocking disk IO. Does anyone know if that's true/know more about that?

Re: The Rust standard library no longer has any scheduling baked into it

#13
post #5
post #3

> libstd is that much closer to being used in a "bare metal" context. It's still aways off, but we're getting closer every day! This is so cool. Most programming language implementations come with a lot of baggage. They assume that the VM can stop the world, or that the VM will be in control of all threading, or that the VM will use global variables, or that the VM can move objects around in memory whenever it feels…

On the flip side, though, those assumptions are also what lets a runtime actually do things for you. In the limit, a runtime that assumes nothing is simply machine language. Even C has a runtime, whose assumptions can be violated quite thoroughly by other languages. The less the language actually specifies, the more likely you are to encounter the situation where two Rust libraries can't work together because they ac…

> The less the language actually specifies, the more likely you are to encounter the situation where two Rust libraries can't work together because they actually work under Rust-Alpha (some twiddling of the knobs) and Rust-Beta (some other incompatible twiddling of the knobs).

We are explicitly trying to avoid this. Libraries should be able to work in M:N or 1:1 mode, or some combination of the two, without having to rewrite code. This change was carefully designed to allow this.

> Do they realize that this was a huge step towards potential fragmentation of the language?

We are very much intending to minimize fragmentation. Projects like alternative standard libraries are discouraged for this reason.

Re: The Rust standard library no longer has any scheduling baked into it

#14
post #11
post #7

Earlier quoted context omitted.

This strikes me a pragmatic decision driven by wanting to reduce complexity and be interoperable with 3rd party libraries (mostly C code). If you read my other comment here, I outlined the problems I ran into with the N:M threading model (although mostly in C land). It strikes me as Rust ran into the same issues. I'm beginning to think that you can't make N:M well unless you take the approach that language X itself i…

"I don't know Erlang's stance on this." Erlang's stance is probably irrelevant to anyone in the Go/Rust/C/C++ etc community; it does so many things differently that its experiences are unlikely to be useful. I'm pretty sure it's M:N, but, for instance, it also trivially has a NOT-stop-the-world GC, which is something that not many languages can say. Not only that it isn't "stop the world" but that it's also fairly tr…

> Erlang's stance is probably irrelevant to anyone in the Go/Rust/C/C++ etc community; it does so many things differently that its experiences are unlikely to be useful. I'm pretty sure it's M:N, but, for instance, it also trivially has a NOT-stop-the-world GC, which is something that not many languages can say.

This is the same as Rust.

Re: The Rust standard library no longer has any scheduling baked into it

#15
post #5
post #3

> libstd is that much closer to being used in a "bare metal" context. It's still aways off, but we're getting closer every day! This is so cool. Most programming language implementations come with a lot of baggage. They assume that the VM can stop the world, or that the VM will be in control of all threading, or that the VM will use global variables, or that the VM can move objects around in memory whenever it feels…

On the flip side, though, those assumptions are also what lets a runtime actually do things for you. In the limit, a runtime that assumes nothing is simply machine language. Even C has a runtime, whose assumptions can be violated quite thoroughly by other languages. The less the language actually specifies, the more likely you are to encounter the situation where two Rust libraries can't work together because they ac…

On the contrary, this decision was solely motivated by the desire to reduce fragmentation. The interfaces libstd provides can work under almost any runtime, and (mostly, but definitely in safe code) don't leak implementation details. Needing a different standard library just to have a different runtime model is unacceptable. A lot of work has gone and is going into ensuring that we do not fragment. We know that fragmentation will kill us.

Re: The Rust standard library no longer has any scheduling baked into it

#16
post #5

Earlier quoted context omitted.

On the flip side, though, those assumptions are also what lets a runtime actually do things for you. In the limit, a runtime that assumes nothing is simply machine language. Even C has a runtime, whose assumptions can be violated quite thoroughly by other languages. The less the language actually specifies, the more likely you are to encounter the situation where two Rust libraries can't work together because they ac…

> The less the language actually specifies, the more likely you are to encounter the situation where two Rust libraries can't work together because they actually work under Rust-Alpha (some twiddling of the knobs) and Rust-Beta (some other incompatible twiddling of the knobs). We are explicitly trying to avoid this. Libraries should be able to work in M:N or 1:1 mode, or some combination of the two, without having to…

This relaxes me. It really was concern about fragmentation.

While both D and Python seemed to have survived their bouts with fragmentation, for instance, it certainly seems to be a dangerous road to travel.

Re: The Rust standard library no longer has any scheduling baked into it

#17
post #11
post #7

Earlier quoted context omitted.

This strikes me a pragmatic decision driven by wanting to reduce complexity and be interoperable with 3rd party libraries (mostly C code). If you read my other comment here, I outlined the problems I ran into with the N:M threading model (although mostly in C land). It strikes me as Rust ran into the same issues. I'm beginning to think that you can't make N:M well unless you take the approach that language X itself i…

"I don't know Erlang's stance on this." Erlang's stance is probably irrelevant to anyone in the Go/Rust/C/C++ etc community; it does so many things differently that its experiences are unlikely to be useful. I'm pretty sure it's M:N, but, for instance, it also trivially has a NOT-stop-the-world GC, which is something that not many languages can say. Not only that it isn't "stop the world" but that it's also fairly tr…

BEAM documentation: I don't think there's anything more concrete than Armstrong's first cut mentioned:

https://groups.google.com/forum/#!searchin/erlang-programmin...

OR:

https://groups.google.com/forum/#!searchin/erlang-programmin...

re: SMP scheduler (there may be other better info on the list, but I can't google it

https://groups.google.com/forum/#!topic/erlang-programming/0...

Re: The Rust standard library no longer has any scheduling baked into it

#18
post #5
post #3

> libstd is that much closer to being used in a "bare metal" context. It's still aways off, but we're getting closer every day! This is so cool. Most programming language implementations come with a lot of baggage. They assume that the VM can stop the world, or that the VM will be in control of all threading, or that the VM will use global variables, or that the VM can move objects around in memory whenever it feels…

On the flip side, though, those assumptions are also what lets a runtime actually do things for you. In the limit, a runtime that assumes nothing is simply machine language. Even C has a runtime, whose assumptions can be violated quite thoroughly by other languages. The less the language actually specifies, the more likely you are to encounter the situation where two Rust libraries can't work together because they ac…

A nice high-level way to express machine code has a lot of value.

Re: The Rust standard library no longer has any scheduling baked into it

#19
post #8

Earlier quoted context omitted.

Half a year ago: "I wouldn't be surprised to see Rust at least abandon M:N soon though once they start really optimizing performance." With Rust I'm sure they'll drop M:N, if not now then eventually, like essentially everybody else in CS history . It seems great on a superficial level, but when you really start caring about performance and latency and fairness it's the pits. My question is when Go will drop it. Imagi…

Erlang has been using M:N very successfully and managed to have good latency and fairness while sacrificing performance. The hard part about M:N is doing it without a VM. EDIT: To clarify I believe you are too harsh about M:N, and that Erlang is excellent proof that M:N has its use cases.

Erlang and it's BEAM VM are so different to other mainstream languages, that I'm not sure that proves that much...

Re: The Rust standard library no longer has any scheduling baked into it

#20
post #2

For context, there's been some discussion over the last two months about whether Rust should use 1:1 or M:N threading or both. https://mail.mozilla.org/pipermail/rust-dev/2013-November/00...

Half a year ago: "I wouldn't be surprised to see Rust at least abandon M:N soon though once they start really optimizing performance." With Rust I'm sure they'll drop M:N, if not now then eventually, like essentially everybody else in CS history . It seems great on a superficial level, but when you really start caring about performance and latency and fairness it's the pits. My question is when Go will drop it. Imagi…

Haskell people seem happy with their M:N scheduler. Is something Haskell-specific helping them?

https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Schedul...

Post reply on HN