|
PlesantDilemma posted:When Rust was first getting attention I remember a lot of discussion about it having built in support for concurrency like the Go language. Recently when I hear about the language everyone talks only about the memory safety aspect of the language. Does Rust still have built in support for concurrency, or am I not remembering things correctly? They dropped that cooperative green threads system so that it's only merely a library, instead of being something inseparable from the language (or more substantially, inseparable from the rest of the standard library). There's still aspects of the language that pay homage to concurrency, though, like how you can only have one mutable borrow at a time (if I'm not mistaken). sarehu fucked around with this message at 02:36 on Jan 31, 2015 |
# ¿ Jan 31, 2015 02:34 |
|
|
# ¿ Apr 28, 2024 09:16 |
|
Oh. For some reason I was only thinking mutable borrows on multiple threads would be a bad idea because I did not consider how coarse-grained borrowing would affect other things. If only they had typestate so that you could express borrowing more precisely...
|
# ¿ Feb 2, 2015 19:04 |
|
Looking at some linked list code, such as http://doc.rust-lang.org/0.12.0/src...t.rs.html#37-41 or some other linked list I saw, I notice that they wrap the unsafe pointers in a Rawlink<T> type. What is the purpose of doing this? Right now I assume it's so they only have to say "unsafe" in one place, or some bogus pretense at safety by making the value accessible only via an Option type as if null pointer dereferences were the danger and not use-after-free. Am I wrong?
|
# ¿ Mar 4, 2015 16:04 |
|
A reason to do that is to avoid making virtual function calls. If the behavior of the solver was not entirely defined by the type, you could pass in the solver as a function parameter of type T (or reference to T or something) and still get that advantage. Reasons not to do that: compile time, executable size, performance costs of code bloat. Edit: If virtual function call performance is not a concern, I'd go with the version that uses virtual function calls. Either way, at the call site you're going to be parameterizing the behavior of the function, either as a template parameter or a runtime parameter. It is perfectly reasonable for a thing parameterizing the behavior of a function to be an "object". sarehu fucked around with this message at 02:00 on May 5, 2015 |
# ¿ May 5, 2015 01:56 |
|
Whether a macro is complicated or the function is complicated, it's still just as complicated. It's really fruity that they don't have a non-macro version, though, but probably that would operate on bytestrings and not unicode strings, or static-lifetime string slices or whatever the gently caress a string literal is.
|
# ¿ May 16, 2015 19:34 |
|
Apparently write() returns a Result<usize, Error>, and unwrap() will panic if the result wasn't a success. Also I get warning: unused result which must be used, #[warn(unused_must_use)] on by default if you omit it -- it doesn't mind that the usize returned by .unwrap() is ignored.
|
# ¿ May 17, 2015 05:49 |
|
I think the official docs are awful, and some of the surrounding media is bad too, and some random blog articles are good. It doesn't help that the language has been unstable, so a lot of older docs keep getting updated like Wikipedia. "Consume" is something you'll see C and C++ people use to refer to invalidating an object or pointer (in particular, taking ownership of it), the usage here is nothing new. (It's probably terminology used in other languages, like the way Lisp's (NREVERSE X) would be said to "consume" X, but I can at least testify to C/C++ usage.)
|
# ¿ May 17, 2015 23:00 |
|
Jabor posted:Seems less useful than if Result<> just behaved like a proper monad IMO. It does.
|
# ¿ May 18, 2015 01:40 |
|
Have them draw lots, the loser gets hormone therapy.
|
# ¿ May 18, 2015 22:02 |
|
They didn't kick him out, they acted passive-aggressively towards him until he stopped contributing. After he left, a certain contributor would close issues that he'd opened with bothering to understand them, giving reasons that didn't actually engage with the issue. With Rust, it's like, instead of just disagreeing with you, a core team member will pop in and insinuate that you're lying. Edit: Basically me : Rust :: michaelochurch : VC's sarehu fucked around with this message at 02:27 on May 19, 2015 |
# ¿ May 19, 2015 00:29 |
|
You don't have to tone police the docs, thank you.
|
# ¿ May 22, 2015 08:05 |
|
Lunixnerd posted:Rust seems really cool and interesting but this: https://www.rust-lang.org/conduct.html is loving cancer. I hate it that this tumblr level safe-space bullshit is invading CS topics. It encourages outrage and taking offense while simultaneously discouraging being an adult and hardening the gently caress up. It also serves to minimize the contributions of people that don't have a place in the reverse hierarchy of 'privilege' that tumblr likes to go on about, sorry I'm not a disabled, mayonnaise gendered, polysexual, fartkin gypsy black woman quadriplegic, I hope my pull request gets some attention nonetheless because I'm trying to add value despite being a cis-het white male AKA literally hitler. Sorry you're not a rape victim/breast cancer haver. quote:We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic. Translation: Hail Hydra.
|
# ¿ Feb 7, 2016 22:21 |
|
quote:We interpret the term "harassment" as including the definition in the Citizen Code of Conduct; Never mind building, you can't even read their code of conduct without downloading an external dependency.
|
# ¿ Feb 7, 2016 22:31 |
|
piratepilates posted:You've got some real problems if you read that and parse it as anything other than "be nice to people, don't be a dick" Seriously? Online forums have had "rules" that are about "be nice to people, don't be a dick," since forever, for example, and they read a lot differently when they aren't full of dog-whistles and designed to reinforce a certain political thesis about how the world is.
|
# ¿ Feb 7, 2016 22:57 |
|
Yeah it's funny how much effort they go through for that when C++ gets it just by overloading.
|
# ¿ May 11, 2016 01:24 |
|
Or the end user could understand what's going on. You should be able to "see the allocations" -- they're as visible as they are in C++.
|
# ¿ Jun 9, 2016 03:42 |
|
I went to a Rust meetup a couple days ago. Seven people showed. One guy was a C guy asking questions who seemed to have shown up with no idea what Rust was for. He asked what is it for. He also asked if it had as good a prepocessor system as the C preprocessor. Another seemed to know quite a bit about Rust, and other things. Another guy spent the entire time editing some Medium post. We spent the time doing an exercism.io exercise where an object has a mutable String field. But, as a result, I wrote my actual first self-originated line of Rust code, so there's that! Edit: On that note, is there any way to make a match pattern redundantly declare the type of a variable? Take for example code:
sarehu fucked around with this message at 08:09 on Aug 19, 2016 |
# ¿ Aug 19, 2016 07:43 |
|
San Diego.
|
# ¿ Aug 19, 2016 18:12 |
|
Well I'm going back, which is something I can't say about Haskell or ACCU meetups I went to. Maybe I'll sperg about the mutex API next time.
|
# ¿ Aug 22, 2016 04:38 |
|
What's the best GUI api for Rust right now? And by "best" I mean "least likely to be broken." On Linux or Windows. Edit: Like all I want to do is paint on a window. Edit: Got gtk-rs examples working so I'll run with that. sarehu fucked around with this message at 00:06 on Aug 26, 2016 |
# ¿ Aug 25, 2016 23:45 |
|
I went to another Rust meetup. The pizza got delivered early so it was cold, had to be reheated. Some dude showed up with a 1600x1200 T60p, then another dude pulled out some old 4:3 X-series tablet. I had a VPCZ1 Vaio Z, and some other guy had a Dell. A big improvement from the everybody-but-me-uses-Apple situation. crazysim forgot his laptop (self-owned!).
|
# ¿ Sep 8, 2016 07:06 |
|
The former is not immune, I think the implementation is just too dumb for it. Another example is that Option<Option<bool>> could use 1 byte.
|
# ¿ Sep 23, 2016 04:20 |
|
|
# ¿ Apr 28, 2024 09:16 |
|
Yeah, it would have solved a problem I had before, where something expected a T: FnMut(..), but I had no way to return anything but a Box<FnMut(..)> to pass up to that. (But come to think of it, maybe I could have passed a wrapper of the boxed function?) But now you won't get successively deep wrappers of stuff like that.
|
# ¿ Nov 11, 2016 19:17 |