« first day (1829 days earlier)      last day (1662 days later) » 

12:37 AM
@Stargateur I edited as you commented, in case you missed it
"I tried to add & but to no avail, would appreciate any help to fix this, thanks!." fix what ? You didn't say what you want, please take time to learn to to ask question, see How to Ask or other ressource — Stargateur 40 secs ago
 
@Shepmaster doesn't really change a thing
there is still no real question
the compiler already tell the obvious answer "move occurs because u1.last has type std::string::String, which does not implement the Copy trait"
 
@Stargateur sure, just in case you wanted to change what you quoted, which I deleted half of
 
12:56 AM
Does this seem like a reasonable Q to ask (in an expanded form)...
"How can I integrate a computationally-expensive operation with futures if I have complete control over the operation?"
Another phasing:
"Can I 'yield' in the middle of a computation so that other futures may make progress?"
 
 
1 hour later…
2:08 AM
@Shepmaster I read that heavy computation doesn't fit with future model of tokio
like something "future should not take too long to compute"
@Shepmaster also, this future wait for ressource to be availeble so you can't yield without wait something
like in 99% I assume an other future
I don't actually know how one should proccess heavy computation
TL;DR: work in progress, use a special thread pool for blocking operation
 
 
6 hours later…
8:38 AM
Is SO slow for everybody or just for me ?
 
8:55 AM
@Shepmaster Thanks for the link
@DenysSéguret It is for me as well
 
thanks
 
9:29 AM
it looks like it's back to normal
 
9:40 AM
posted on October 16, 2019 by Alexander Clarke

Over the course of my internship at the Microsoft Security Response Center (MSRC), I worked on the safe systems programming languages (SSPL) team to promote safer languages for systems programming where runtime overhead is important, as outlined in this blog. My job was to port a security critical network processing agent into Rust to eliminate … An intern’s experience with Rust Read More »

posted on October 17, 2019 by Aaron Trent

It's been about 51 days since I first announced Raygon, a WIP high-performance CPU path tracer written in the Rust programming language, which will feature state of the art light transport integrators, including path tracing, bidirectional path tracing and VCM. In this post I'll go over some of the features implemented or improved, and show some recent renders, then talk about the future of Ra

posted on October 17, 2019 by Yoshua Wuyts

People seem to like Rust a lot! But if you're coming from JavaScript, not everything may make a lot of sense at first. But no problem; this guide is for you! Because I think Rust and JavaScript are really similar in many ways; to the point that if you know JS it's mostly a matter of getting the hang of some of the nuances before you can more or less get the hang of Rust.

 
9:50 AM
@PeterVaro oh you know mate... SSDD and all that... how's things with you?
 
@JonClements Ah, never better pal, never better. Huh, SSDD? What's that all about?
 
@Peter oh you know... the bottom definition on en.wikipedia.org/wiki/SSDD :)
 
@JonClements Hehe, splendid! Nice to see you are still active on SO!
 
Good to see you're still around even if it's not in Room 6 :)
 
Yeah, I kind of miss the old gang, davidism, Kevin, Martijn, Pizzy, and you of course..
 
10:00 AM
Oh - apart from Pizzy (who I miss as well) we're still mostly about :)
 
I should pop in then I guess
 
you're always welcome
 
Why thank you, will do at some point then!
Right, it's time to get back to work, I suppose
have a lovely one, ol' chap!
 
same here and you too matey... see you around :)
 
 
2 hours later…
12:09 PM
I like serde.
 
Do you remember? I've asked about an hypothetical async destructor. Here we go: boats.gitlab.io/blog/post/poll-drop
 
12:39 PM
The tilt is real right now
openapi-codegen generates rust code
the hyper variant only generates server-side code
the reqwest variant doesn't know or care about the async mod within reqwest
 
1:11 PM
@FrenchBoiethios That is an interesting read, and shows that an asynchronous drop is more complicated than we thought.
 
@E_Bob4 Yep. The solution is clever, but clearly not as ergonomic as a simple async fn async_drop(&mut self)
 
 
2 hours later…
2:55 PM
Hi guys, I'm a bit stucked right now in an important decision.
I have a client the listens via websockets for updates. Some of them need to be responded without delay, so I would send a reply back automatically.
Others, need to be further processed by a different thread.
Right now, to get the correct message type, I'm relying on serde's deserialization because I receive untagged json as messages.
Once I deserialize, if i send it to the other thread to process, I would need to re-deserialize on that thread as well... I'm out of ideas trying to avoid that second de-serialization...
 
@Flashito why would you need to deserialize on the other end? Do you not have a way to pass the deserialized output?
If you have a fixed/small number of possible message types, use an enum and a custom Deserialize to have serde to both the tagging and the deserialization for you, BTW
 
I'm using the enumerations indeed. Sadly, I can't decide the servers messages format
Once I deserialize in the client, I could create my own "enumeration in the middle" so that the processing thread would be able to deserialize using the tag
But I don't think that's a very appealing solution
 
Why not?
Beats double deserialization
The point of a middle layer is typically to remove all the insanity/kludge from something, and this is an ideal case for it
the fact that the server sends you a message in a specific format does not mean you have to honour its exact format internally; that's a mistake a ton of people make
 
Wouldn't that be a double desrerialization anyway?
I have many messages formats
so, the processing guy should also be able to match the correct middle struct
making that a second deserialization (And adding a serialization from one struct to the other in the middle now)
 
The network-level part transforms the messages into an intermediate format, and then a middle layer turns this intermediate format into concrete actions
the only costly deserialization is in the message->intermediate format
everything else will, hopefully, be optimized properly
 
3:03 PM
I see
 
If you want a good example of this, look at a library dealing with raw TCP frames, it's the same thing
 
Sounds like I should try that then
 
a TCP frame can contain a whole bunch of things, the only thing you're sure of is that it has a header of a fixed format
 
sure, but that frame will eventually contain the payload. Which doesn't have to be deserialized
 
that's the beauty of an intermediate format, you're in charge of what goes in it
 
3:05 PM
While in my example, I still have to deserialize it + serialize to the middle format + deserialize that middle format
 
Hold on
I still don't get why you're serializing the middle format
What requires you to change it from an owned struct to a serialized format?
(As long as your owned struct is Send you can pretty much shoot it off to another thread as much as you like)
 
nothing really... I just assumed that in order to send the message via the channel, it would have to be serialized somehow
 
My bad for not testing this though
 
Only has to if you're actually passing it through something that doesn't have access to the memory
i.e. you're shooting it off to another box via TCP, for instance, then you'd need to serialize
 
3:06 PM
it would only be memory indeed
 
for mpsc channels, the only condition is Send
well, and Sized but that's obvious
 
Then of course it would only need the correspoding match to get the correct enumeration
 
Correct :-)
 
oh my...
 
this is why I recommended the enum to start with, it makes everything clear
 
3:07 PM
All of a sudden, this became clear :)
Nice
Thanks a lot for your tips !
I'll use them wisely!
 
Anytime. Don't hesitate to ping me if you're stuck on anything else; I write a lot of API interop code so there's a fair chance I've run into anything you might struggle on
:-)
 
Whatch out with that. I'm just starting with Rust, and I'm a whole bag of questions right now
 
Is that a problem?
 
Thanks for the offer
 
We've all started somewhere
The point of knowledge is to share it
 
3:09 PM
Indeed. I'll probably come back to you with more stuff then
Let's see if I go and implement this solution. I'll let you know how it went
 
4:01 PM
@Shepmaster Question for you
openAPI to rust network-level code, yay/nay?
 
4:20 PM
11 years on SO, doesn't know to do a minimal reproducible exampleStargateur 1 min ago
yes I lost my cool
 
5:12 PM
@SébastienRenauld I've a feeling there's subtlety to the question, but if the quality and features are what you need, I don't see why not.
 
Background: I'm essentially about to PR the openapi foundation with a rust module for the code generator
 
@SébastienRenauld I'd like to use something like that for the playground to go between the Rust backend and TS frontend
 
there's two modules atm, one using hyper for server-side, one using reqwest synchronously for the client side
I'm going to PR an async reqwest module
question was related to how far I should go
 
The playground currently uses Iron, which is sync (been waiting for the situation to stabilize a bit before picking a new framework)
@SébastienRenauld what does "far" mean in this case? Would your new module only support some parts of the spec?
 
Right now it supports all of it, since I've based it off the "original" reqwest module
Or at least I assume it does - it also wasn't backed by a test of any sort
@Shepmaster I'll have a look on the server module for what you're doing, but it'd be hyper, not iron
 
5:23 PM
@SébastienRenauld and to be clear, I'm not saying you need to do anything for me / the playground ;-) Just that I'd like to try the concept of using a shared description of the API for frontend and backend.
 
I mean, you could try openapi-generator as it is right now and see if the server hyper module works
the obvious advantage is a client and server generator so you only need to worry about the actual important stuff
(+ verifier through dredd)
 
The nebulous thing I need to check is that I don't control all of the endpoint definitions. There's a few that I have to maintain forever due to backwards compatibility with the Rust docs and other websites.
So I need to learn if OpenAPI lets me fully control all aspects of the endpoint definition
 
It does
You're in complete control over the definition and return of the endpoints and that's where it stops
openapi will give you structs back containing the resources sent by the client and handle everything else in between
 
5:48 PM
this, this solved with much "less info", and that is not even looking. The question is very clear: how deserialize this enum with serde. — mamcx 8 mins ago
I'm going on a rampage
 
6:07 PM
@Shepmaster would appreciate your skills at cv'ing stuff right now
you tell the guy the question is missing details and he goes "no it doesn't"
 
6:22 PM
@SébastienRenauld "skills"
 
Diplomacy has failed
although @Stargateur doesn't know the word
;-)
 
@SébastienRenauld diplomacy is compromise
I want good question
I don't want meh question
I don't want bad question
I don't want compromise
 
That one was never going to be a good question; you know it, I know it
him expecting an enum of all types to magically parse an entire CSV was the only hint you needed
 
I cast my vote
tired of "CEO & Developer of" and "maker of the POS for the iPhone BestSeller."
 
6:43 PM
?
 
written on his profile
 
 
3 hours later…
9:35 PM
@teknopaul Actually. Something just hit me - what makes you think this is different to java? Mutex is essentially synchronized, since the underlying behavior is the same. Primitive updates can be done lock-free with std::sync::Atomic primitives, which are exactly the same as their java equivalent. The only thing you cannot do in Rust that you can do in java is volatile. — Sébastien Renauld 33 secs ago
fun times
 

« first day (1829 days earlier)      last day (1662 days later) »