« first day (1961 days earlier)      last day (1529 days later) » 

12:32 AM
Hmmm... using an atomic variable inside a closure with move doesn't help because they don't have copy.
 
12:51 AM
24
Q: How can I pass a reference to a stack variable to a thread?

Ned RuggeriI'm writing a WebSocket server where a web client connects to play chess against a multithreaded computer AI. The WebSocket server wants to pass a Logger object into the AI code. The Logger object is going to pipe down log lines from the AI to the web client. The Logger must contain a reference t...

@SephReed this is why we beg plead fight yell at people to produce minimal examples. And yet here we still are.
 
Look, I'm really trying. Creating a minimal example requires a bit more understanding than I have. I'm on day 1.
 
1:07 AM
Is `do spawn` real code? I can't find it anywhere but this SO question.
https://stackoverflow.com/questions/17887065/sharing-mutable-variables-between-threads-in-rust
NVM. Figured it out.
This was the docs I was looking for: doc.rust-lang.org/book/ch16-03-shared-state.html
 
@SephReed not saying you should, just that the question you linked must not be minimal enough.
 
Ah. Sorry. I also shared some not yet minimal enough code.
Finally got it though.
I'm using this to create a block so the mutex will release immediately after setting:
```
if (true) {
let mut pitch = m_pitch.lock().unwrap();
*pitch = 500.0;
}
```
there's obviously a better way to make a block, but I'm not finding it.
 
I will edit the question you just linked, but it’s from 2013; before Rust 1.0. So no, that’s no longer valid syntax.
 
It's super helpful the edits you do. I've seen them everywhere.
 
@SephReed just make a block: {}
 
1:20 AM
I tried that!
Am I crazy...
needs a semi-colon or newline before it.
 
You can also one-line it and the mutex will be dropped immediately
Since it’s never stored anywhere
 
Awesome. Thank you.
Heck yeah. Today I made the lamest synth in existence. You hit "h" and it makes a super sub-par 808 kick sound. But I did it!
Next step, to see if this code will run on an RPi. Then I'll have a proof of concept.
 
 
8 hours later…
9:34 AM
@LukasKalbertodt Are you writing an answer to this one ? stackoverflow.com/questions/60409710/…
 
9:47 AM
@ÖmerErden Nope
 
Ok then asked becuase of your comment "Looking forward to an answer for this one"
 
 
3 hours later…
12:19 PM
Sigh, and that’s a dupe.
 
And i believe your answer is much better than the existing ones ^^
 
12:33 PM
Couldn’t tell that based on the votes 😜
@ÖmerErden FWIW, that phrasing would normally indicate that they are looking forward to reading an answer because they don’t know it.
 
@Shepmaster let's say at least better than mine : P
@Shepmaster Hmm, "an" emphasizes that meaning?
 
@ÖmerErden that seems right. If they had said “looking forward to my answer” or something, it might have indicated they planned on answering.
 
I read that comment with a bias, since it was from Lukas, i thought he'd probably know the answer, because he was the first who introduced the RFC on that post or even on SO, and the RFC itself has the answer in it.
 
1:09 PM
@ÖmerErden @LukasKalbertodt is pretty cool. I just learned he was the one who enabled private docs by default for binaries.
 
Is there a convention or something to mark in your doc that some part of the API is experimental and may change or disappear ?
 
@Shepmaster <3
Glad someone is happy about that change
 
@Shepmaster github.com/rust-lang/cargo/pull/7593 i believe this is it, gratz @LukasKalbertodt, btw i wasn't trying to be offensive, i was thinking the same that's why i had bias on that comment ^^
 
@DenysSéguret <h1>This API is experimental and may change or disappear</h1> :-)
@DenysSéguret but more usefully, you could put it behind an "experimental" feature flag
 
@ÖmerErden Don't worry, I didn't understand any of your comments as offensive :D Rather funny to assume "Lukas knows the answer" :D
 
1:22 PM
@ÖmerErden I don't see anything you said that could be seen as offensive ;-)
 
Wait is linked PR already on stable?
 
@Shepmaster A feature flag wasn't something I considered but now that you mention it, it seems more and more like a solution which makes sense
 
Oh, it is
 
@LukasKalbertodt :tada:
@LukasKalbertodt It's even already on Stack Overflow
 
@Shepmaster Nice!
The accepted answer there is very outdated, right?
 
1:37 PM
@LukasKalbertodt As is the way of things.
But the other 3 are more up-to-date
 
So I would add a outdated warning to that answer. I usually do that
But since you didn't do that already, I wanted to ask first ;-)
 
@LukasKalbertodt The question asker was active 6 hours ago
so I added a comment suggesting they review.
I also flagged the comment containing an answer, as it's in an answer.
 
@Shepmaster Ah great, that's better even.
 
 
3 hours later…
4:45 PM
o/
 
5:12 PM
\o/
 
Assuming there are French people here and they like Rust and open-source and dev tools. This awesome team is looking for another remote dev: octobus.net (you can tell I send you). The goal is for example to continue improving mercurial and replace python with rust
 
5:42 PM
Thought's on rolling back this revision? stackoverflow.com/posts/60351862/revisions
 
I think it would be better in an answer, I agree with a rollback, possibly along a comment to OP about putting that in an answer
 
 
2 hours later…
7:44 PM
Poor @mcarton was robbed of the accept
 
@DenysSéguret ... mercurial is still alive ?
 
expected `Request<Body>`, found `Request<Body>`
erm
 
@FélixGagnon-Grenier stackoverflow.com/q/44437123/155423 help?
 
... that was quick lol
I was wondering if that could be about version mismatches, I'll be reading that :)
 
7:54 PM
@Shepmaster I don't have any problem with git, I just through git have replaced mercurial because it was newer
@FélixGagnon-Grenier it's a classic
 
@Stargateur can't get rid of all the old things that easy
(like me!)
 
@Shepmaster cargo tree highlighted which version of hyper juniper_hyper was using, thanks!
 
@Stargateur It's very alive in some big companies (some of them rich enough) which appreciate it
 
Nice
 
7:56 PM
I just looked git and mercurial have been created in 2005
 
Mozilla use mercurial, for example
 
They're the same generation, quite comparable
git's lead comes from Linus and GitHub but I can't say which one is better
nobody can deny git is a little difficult to use sometimes
 
handwaves in git rebase
 
everything but svn :p
@DenysSéguret I step up on git skill
 
7:58 PM
@Stargateur you're young. Think about the poor guys who used cvs :(
 
@DenysSéguret I'm in this picture and I don't like it
 
(I got the message, shep)
 
I mostly wanted it to link to a specific message, not the at-mention
 
8:15 PM
Working hard on essential work
 
is the game public ? :p
 
yes but the interesting levels aren't yet
Either you play the included one or you create some
An exemple of level in the editor:
I have some work to do on integrating campaigns, saving what level was done, etc.
There are interesting things in the game (IMO), like infinite maps, different kinds of pathfinding (djikstra and a*), autonomous actors, sub character animations
 
@DenysSéguret this makes me angry, but probably not for the reason you might guess.
 
how do you do to have time to do all this
 
8:24 PM
@Stargateur I don't
I don't sleep enough
 
I'm angry because your kids probably speak better English than I do ("frenetically"? really?) and they definitely speak better French :-p
 
and I've postponed too many things on half a dozen open source projects on which I'm currently working
@Shepmaster hem... they don't read that much
but kids only need a few explanations from their parents, the rest is obvious
 
rustup update time 2020-01-30 I late on my windows
 
@DenysSéguret this is beautiful
now you gotta figure out how to get square tiles ;-)
 
@Shepmaster ^^
ok, if somebody wants to test the displayed level, the current version is at dystroy.org/pub/islands.json
it can be launched with lapin edit islands.json
!!afk
 
8:31 PM
@DenysSéguret heeeey, did you steal the horizontal slide idea from me for your CV? ;)
anyway, something completely off (as in, not related to the above):
I'm thinking about asking a question which on the surface seems very much like an opinion-based one, but actually it is looking for the most objective guides one possibly ask for. It is more or less the following: When designing an architecture of an application, how should one decide between traditional multithreading and async without investing heavily into both and profiling them?
The main problem is, the two requires very different designs and it's not easy at all to switch between the two. Maybe the question should be asked as: What are the classic problems which are genuinely better to be solved with async, and what are the ones which are better to be solved with classic multithreading? Does this make sense? Should I ask this kind of question?
 
@PeterVaro that way more easy to transform async to sync that sync to async
actually the latter is impossible
Also, giving actually rust status I will 100% advice async world
 
@PeterVaro heh, there was a similar Q on the Discord. It's a tough one.
@PeterVaro I think it's right in line for softwareengineering.stackexchange.com
 
@Shepmaster but do you think it worth asking on SO?
 
@DenysSéguret 404 not found
 
I mean I think it is an interesting and important question..
but not sure about the format and the platform..
 
8:43 PM
I think it's a question for rust forum
 
@Shepmaster hmm.. interesting.. for some reasons (couldn't put my finger on it) I never liked that corner of the SE platform..
 
@Stargateur I wouldn't disagree, but it's not a Rust-specific question either
 
@Stargateur Rust forum is not nearly as highly ranked in search results as SO (or other SE sites)
@Shepmaster I'm more interested specifically in the Rust implications and Rust related problems
 
e.g. C# (and C++, probs) should have the same design decisions
 
(albeit this is probably true ^)
 
8:45 PM
@PeterVaro that not the point :p
 
@Stargateur ..slightly it is, no? ;)
 
I've found (though it's probably more opinion based) that things that have nice, small-ish packets of work, and may rely on some long-ish wait (for something from disk, for example) work well as async. Wheras continuous workloads (number-crunching or analysis on data already in memory) works more nicely multithreaded, usually.
 
@PeterVaro A thing I've done when I needed to go beyond SE is to post it on SE to start with, then cross-post to e.g. URLO (or IRLO, Discord, Reddit, Zulip, etc). If the best answer is in one of those sources and they don't want to post back on SE, I'll clean it up, post it, and give attribution.
 
The difficulty is that most analysis or number-crunching work relies on some consumer threads being fed the data to operate on, and if that's the case, you might as well try to break it into units of work, in which case async wins again, because a good async scheduler will work-steal to load balance.
 
well, async => real time application, server so
sync => local application
 
> edit: This answer is incorrect. It remains here for posterity.
????
 
yeah, just noticed that
 
@Stargateur That's not... That's not true. You can perfectly well write multithreaded real-time applications. For things that have tight time constraints (like realtime audio processing), you cannot use async, because there's an unbounded amount of time the task may wait to be woken if it yields for something.
 
@Zarenor actually sound is very very very very hard to handle
If I correctly how thing work, sound have its dedicated processor in modern computer
like GPU
BTW: do you know the game lib quizz ?
someone tell a lib name and other try to guess what it is
for example: parking_lot
if you know you don't play ofcourse :p
 
Hahaha. That sounds fun. I haven't ever played it.
@Stargateur Yeah, it's all trying to get the right buffers in the right places frequently enough. And what 'the right buffer' is and what 'frequently enough' is all depends on the hardware and what level of abstraction you're working at. It's a lot to think about.
 
9:15 PM
@PeterVaro yes, totally. I didn't mention it as my CV is currently ugly
@Stargateur fixed
 
@DenysSéguret I'm a bit proud of myself now. I became an influencer ;)
 
@PeterVaro your page is beautiful
 
@Shepmaster SImilar questions though do exist on SO -- some are even language independent. I spent the last few minutes on searching for these. Anyway, I'm a bit embarrassed of my ignorance, but what are URLO and IRLO?
@DenysSéguret <3
 
@Shepmaster :thumbs_up:
@Zarenor there are other considerations as well, some say whether something is IO bound vs CPU bound, whether the tasks should communicate with each other or they could act as independent daemons..
 
9:20 PM
@PeterVaro I'm not saying it would be wrong to put it on SO, per se, just that it's a high bar and you are subject to the vagaries of arbitrary reviewers
One thing you could do is write up the question in a gist
and we could provide early feedback
 
there are many, many different aspects -- and I'd like to see someone, who's really, really good at this to put a lot of effort into writing a kickass article about this topic
 
then you can copy-pasta it wherever you decide
 
@Shepmaster yeah, I actually thought about that.
@Shepmaster that sounds like a brilliant plan -- let me do that first, let's see you actual reactions, and then we could decide how to move forward
happy, happy, joy, joy
 
And you aren't gonna lose any work to do that
well, other than changing markdown for whichever place you post
because markdown
 
9:39 PM
@PeterVaro Oh, I realize. I've done what I would call 'some' work in both (async and multithreaded) environments - nothing very intensive. I would love to see someone with a deep understanding of this really write on it.
 
graph: Object(Object { key_value_list: [("characters", Scalar(String("bob")))] })
neat, an graphql \o/
 
@Zarenor Me too, in many languages, though in Rust specifically, I've only done multithreading and lately got my toes wet in the ocean of the async. But as we know, pattern recognition is a huge part of software engineering and I'm not afraid to admit, I don't have that much practice in these to recognise all sorts of patterns which definitely require one solution over the other.
 
9:55 PM
Yes, this is it @Shepmaster . Applying your suggestion (minus changing System to AllocRef by accident) also yields a more helpful compiler error: error[E0034]: multiple applicable items in scope. This answers my question, thanks @Shepmaster and @Stargateur ! — Tonnz 1 hour ago
"my job is is done! but you did nothing. fly away"
@DenysSéguret omg don't use json for that you breaking my heart :p
 

« first day (1961 days earlier)      last day (1529 days later) »