09:19 | <HE Shi-Jun> | also Rust's methods are all on the Iterator trait |
09:20 | <HE Shi-Jun> | i'll fix the calendar, not sure where the current deadline event came from |
18:40 | <bakkot> | I think I already commented that several times: Rust (and D) use iterator-like semantic, because these languages use value type semantic on iterator. So they don't suffer the reuse problem. And Rust have a very strong compiler which won't allow u reuse a iterator twice by default (you need to assign it to a separate var and with value type copy semantic, it give u a two iterator instances). Obviously JS do not have that merits. (Even I really hope we could have value type one day, I very doubt we can have value type semantic iterator in JS.) This is true, but the fundamental fact remains: in Rust the helpers are on the one-shot thing. Yes, in Rust the compiler will prevent you from making this particular mistake, whereas in JS you are more likely to get bit by it, so yes, there's a significant downside to using iterators that Rust does not have (though all the other languages I named do - nothing prevents you from trying to re-use a Java stream, e.g.). But the most important question is whether the helpers are usable and clear when used correctly, and on that question, the compiler checks are irrelevant. (And there's similar problems with accidentally re-using helpers on iterables in other non-rust languages, for that matter - see e.g. the second half of https://stackoverflow.com/a/28513908, which discusses the downsides of C#'s IEnumerable design which were explicitly considered when designing Java's Streams. We're all jealous of Rust's compile-time checks but we still have to design a language which works without them.) |
19:03 | <jschoi> | I vaguely remember that someone a few years ago (was it Domenic Denicola?) trying to figure out in a GitHub Issue if we could ever have chained numeric comparisons like x <= y < z —and that sadly the person found that there was no way. Does anyone have a link to that thread? |
21:59 | <snek> | i just heard about the sf js meetup |
21:59 | <snek> | is there anything i need to do to be able to go to that |
23:08 | <bakkot> | snek: assuming you are talking about https://www.meetup.com/jsmeetup/events/287033071/, it says on https://github.com/tc39/Reflector/issues/437 that delegates are not required to RSVP |