« first day (1728 days earlier)      last day (1981 days later) » 

06:08
@Shepmaster you mean you're shocked, because people can learn? ^^
 
2 hours later…
07:57
2
Q: Select from a list of sockets using futures

kreoI am trying out the yet-unstable async-await syntax in nightly Rust 1.38 with futures-preview = "0.3.0-alpha.16" and runtime = "0.3.0-alpha.6". It feels really cool, but the docs are (yet) scarce and I got stuck. To go a bit beyond the basic examples I would like to create an app that: Accepts...

is this code runnable, one of the crates using reserved keyword -"await" with 2018 edition, or at least nightly compiler gives me error about it. looks like it is std await
08:10
default toolchain was set to msvc and the version was 1.36
lol :/
 
2 hours later…
10:07
who wants to give the death punch? stackoverflow.com/questions/56932418/…
done
but it is still alive
@ÖmerErden You don't have the privilege to vote to close. :(
10:28
@E_net4isoutofcommentflags just flagged :(
@ÖmerErden That does not help much once it already has a close-vote.
posted on July 08, 2019 by George Shuklin

It’s a double challenge: I’m learning Rust (but I can say I more or less know the language by now), and I’m trying to use GTK in Rust. I’m a complete beginner in GTK, and even if I know Rust, it does not mean I can use it properly. So I’ll learn a huge library (written in C) by using it in a complex and hard language I just learned. Well, well, good luck, me.

@E_net4isoutofcommentflags i have one more helpful flag anyways :P
@ÖmerErden Want a bunch of free helpful flags, I assure you that there are faster ways. :P
@E_net4isoutofcommentflags haha just kidding i don't really mind about those statistics but i am ready to listen if you want to tell me :P
10:42
For one, the SOBotics Heat Detector detects heated comments and reports them in the SOBotics chatroom, which you can flag. But it's best to read the rules and guidelines before you do anything.
And trust me, helpful flags is not something worth grinding, much less by seeing most of the toxicity on the site.
wow SOBotics, heard for the first time
It comes to no surprise that the community conceived bots to assist moderation.
looks cool, i'll give it a try
11:01
350/500 helpful flags
I flags comments very often, so I get that going for me :)
@hellow What are those numbers? posts/comments? helpful/total?
@E_net4isoutofcommentflags Next badge: 350/500 Marshal
Do you think that's a good idea to put some ptr helpers into the ffi module? gitlab.com/Boiethios/goa-rs/blob/master/src/ffi.rs#L88
Where would you put this kind of stuff?
@FrenchBoiethios yes
I guess that some people would advocate to only put the extern "C" content into the ffi module
@FrenchBoiethios hmm, true. Maybe you could remove the pub from the C functioncs and make only your wrapper accessible
or really split it into a -sys crate and a "rust" crate
which is typically done for C wrappers, look at crates.io/crates/libudev-sys crates.io/crates/libudev
@hellow That's an idea. But that must be done with bindgen, I guess, and I find it difficult to use.
11:52
@FrenchBoiethios really? I use it very often and find it very pleasing as long as you stay on the std side ^^
Do you have an example?
(Real-world example)
@FrenchBoiethios don't you like the bzip example?
@FrenchBoiethios not really, I used it for a stm32 HAL
@hellow He doesn't use bindgen
@FrenchBoiethios it doesn't need bindgen
11:57
@Shepmaster If a create a sys crate, I wanna do it right, ie with all the functions. And I will not write the hundred of them by hand.
@FrenchBoiethios well, then you can choose to use bindgen, sure
I guess it depends on your intent
Is there an alternative that automatically generates the binding from the C headers?
I wouldn't be sad to create a foo-sys crate with just the functions I need. If other people need new functions, they can add them. If it keeps growing, can use bindgen.
@FrenchBoiethios isn't that exactly what bindgen is?
I'll give it a shot, then
Anyone looking for a job and "in Menlo Park, California or Lake Mary, Florida or want to relocate to either" ?
@FrenchBoiethios thoughts on How do I add two Rust arrays element-wise? as a dupe?
12:10
@Shepmaster Everybody wants to be remote, now
@DenysSéguret Indeed.
As a rule, wouldn't it be good to systematically unstar jokes and not useful posts after one day, so that valuable posts stay visible ?
For what it's worth, it's not my job, just one from a business contact. I figured it wouldn't hurt to share though.
@DenysSéguret nah x)
@Shepmaster Why not
@DenysSéguret You dare to say that the jokes are not useful?
12:16
no, I don't, I'm a coward
@Feeds I don't think that that is a good writeup :|
@FrenchBoiethios found a better one
@Shepmaster Oh, that's exactly the same. I'll delete my answer once you mark it as a dupe
@FrenchBoiethios You can't :-) It's accepted. I don't think there's any harm in leaving it tho.
BTW, I saw in the other answer that I can remove the & sigils. Why?
12:36
@FrenchBoiethios Because impl<'_, '_> Add<&'_ f32> for &'_ f32
That doc generation should probably be fixed to omit the <'_, '_>
There is an id, but you can't get it by clicking an element AFAIK
Thanks for the link, tho
aah, neat
I'll keep that in mind
12:52
@DenysSéguret less transport less pollution
@Stargateur Yeah, that's totally why
Less transport = more time for the job. I have 3h/day of transportation, I'm not that motivated when I arrive at work.
@FrenchBoiethios That's clearly a huge point
And also because I'd like to have a Rust job :P
that too
My colleagues left me alone for 3 weeks... and they left assuming I'll be showing them a new software to sell in 3 weeks... I'm already tired...
12:55
lul
remote is good but not full time, work in team increase the motivation
I don't work well alone
My manager is much more realistic: he assumes that nothing is done when he leaves
@Stargateur Not everyone is the same
well is not the good word, I just don't work alone :p
@FrenchBoiethios That's a bummer. I'd be extremely reluctant to have a job requiring that long a daily commute.
But then again, large distances are even larger in my book. Being from a small country and all.
@FrenchBoiethios :46705397 The reason I'm free to do anything, including open-source, is that my company is used to me coming up with results when not disturbed. So I'll really try to solve my design problem and build that f.... software
Too bad I decided it was too risky to build it up from scratch in rust and I'm coding in Java & Javascript :(
13:13
@DenysSéguret what do you need to do ? In short if possible :p
I make a software which efficiently and with a very cool web graphical parameterization lets steel people configure computations, qualification, etc. of steel products. It deals with sensor signal computations, surface defects, geometrical problems, numerical optimization, models, etc. One of the reasons it works well is its data model is precisely done for the world of flat products, plant sensors, product genealogy (including the problems of welding, coiling and cutting products).
But it's more and more used outside its initially intended domain. For other kinds of products. And other companies want it to handle their computations, for example combining ML computations.
So I'm trying to build a generic enough thing whose engine and GUI can be easily used in different kind of systems. And It's way more complicated that what I might have let appear. Or way simpler, depending on how you look at it.
@DenysSéguret Hmm. Lots of data engineering, then?
yes
If I were the owner, I would probably have rebuilt everything again in Rust. But I know there's too much risk when the codebase is so big and when the existing customers are real. So I only do some new parts in rust... and not much right now
@E_net4isoutofcommentflags I agree, but the average daily rate was good, and more importantly, I learned a lot of stuff, so...
And furthermore, I spend the transport time sitting, so I can develop, read, etc.
@FrenchBoiethios This changes everything. My boss spends almost 3 hours per day driving his car to go to work and back home
13:23
Youch.
I drive less than that on a weekly basis.
@DenysSéguret He needs a driver. I was about to say that he needs a Tesla, but in France you cannot use the autopilot...
The steel industry doesn't pay well enough
No industry pays enough. That's why I stick in the tertiary
13:55
Ah well.
We didn't need any more evidence to the fact that we have many unjustified upvotes, folks can stop now. :>
@Shep the "Typo/Cannot Reproduce" is the usual close reason in these situations.
@E_net4isoutofcommentflags I thought about it, but it wasn't exactly either of those. shrug
i think my pc is byte-addressed, so that's 2 addresses away, and each address contains one byte, so im pretty sure its 2 bytes away — zakaster 58 secs ago
Too bad they doubled down.
I don't have license driver
There's a guy who seems seriously confused about memory
@Stargateur Driver's license. Yeah, I only got mine a bit later than average. Kept postponing it until I felt I could really use it.
14:02
@E_net4isoutofcommentflags I don't want it
I'm enjoying the efficient dupe hammers today. :)
I don't feel the need to have this license, but my wife urges me to get it...
I wouldn't mind that much if public transportation was good enough. But it just ain't.
In Paris, it's still much better than to drive
Yes, those big cities are usually well equipped.
But just from university to my hometown is a nauseating two hour trip by bus, whereas I can make a 40-minute trip by car.
14:07
these questions about memory and pointer are always pointless
@E_net4isoutofcommentflags Sure, I would pass the license in that case!
@Stargateur Looks like those who ask them could use more pointers. ;)
@Stargateur you just wanted to make a pun, right ?
@DenysSéguret They're never enough. You can leave them dangling if you don't like them. ;)
damm I didn't see it XD
14:13
love too see advertisements in chat
also @E_net4isoutofcommentflags I fixed the PR uwu
Hmm yeah, we could use that. Shall we give it a Rust-y name?
Onvm, you used an existing trash.
still not sure why the doctests say "error" then work tho
> error: no global memory allocator found but one is required; link to std or add #[global_allocator] to a static item that implements the GlobalAlloc trait.
14:20
yeah but
they all pass
and I'd expect at least one error like that per test executable and there's only one before any of them?
Weird stuph
Can you check whether other folks have had the same issue?
>This error should not occur in the first place.
confirmed false negative
I've just started with rust recently.
I'm trying to understand the community preferences, I installed the futures package so I can try async await functionality from nightly
I'm suprised it installed like 10 dependencies when I installed futures instead of one
Does rust & cargo encourage hyper modularity ?
10 dependencies doesn't look like much when you comes from the npm world. BTW it would be interesting to see a comparison of the ecosystem on that kind of metrics (I have no idea of the result)
Well, Rust trait are design to share behavior, if everybody do their own Split trait that would not be very practical. But I will not say that cargo encourage hyper modularity, that just how thing are done. Every is free to do what they want. BTW, future are in std now doc.rust-lang.org/std/future/trait.Future.html
14:32
@Raynos Yes, I think the community is on the side of finer-grained dependencies. There are sometimes technical reasons that prevent more crates (see orphan rules), but in general, yes.
And since a crate is a compilation unit, more crates = possibly a better compilation time
@FrenchBoiethios well amethyst is not very fast to compile with its +400 crates
14:48
There's nothing too easy about game engines. That hopefully includes everything you'd need.
There was a time where more crates meant better recompilation time, but since incremental builds I don't think that's as much of a worry
I think that a single crate uses multiple cores to build, but multiple crates is more likely to get the perf benefit
Compiling parity blockchain stuff takes like 30 minutes
Amazingly slow.
I really hope there's a concerted effort to reduce duplicate crate versions at somepoint
Building syn 6 times in a single program is suck
Really? There's nothing for that? Wow
We need to get better at testing minimum versions and having wider allowed versions
Oh, you mean that the version is different?
@FrenchBoiethios The problem is that one crate says syn = 0.1 and another says 0.2
even though both could use the same version
14:54
I don't know what the compiler could do. If that's not the same version, it cannot assume anything, I guess
@FrenchBoiethios Yeah, it's not the compiler's job here. I mean some tool that would look at a Cargo.toml and try to expand the dependency versions.
For example
That crate works with almost every version of rand because the part of rand we use hasn't changed.
this is another reason that it's good to have lots of crates; you can have varying stability guarantees on each
That may well be one of the incentives to bring maturity to the ecosystem. Once it's at v1, we expect it not to break as much.
@Shepmaster I will use that more often
@E_net4isoutofcommentflags It's related, but not 100% aligned. crate A may be able to use either crate B 1.0 or 2.0 for the same rationale.
@FrenchBoiethios it may also be useful to test your minimal versions too
I usually type foo = "1", for example, so it can chose what it wants
@Shepmaster Oh sure, otherwise that could break in some people's build
15:00
@FrenchBoiethios yep, and that's a good default, but it might be a lie :-) Unless you tested with version 1.0.0, you might not actually work there.
cargo add specifies the exact version, so you get foo = "1.2.3"; so at least you get your bug fixes
but for "real" crates like SNAFU, I'll bump it down to "=1.2.0" and test, then "=1.0.0"
@E_net4isoutofcommentflags quotes mean "crates that I really want people other than me to use"
there is no way to convert a point to a reference using as ?
perfect
@Stargateur pointer to reference, you mean? It's by deref: &*pointer.
@E_net4isoutofcommentflags ah thx
I will never get used by this magic trick
15:15
It helps to think that references in Rust are special. Making an invalid reference is UB even if you don't read or write anything to it, IIRC.
related: there's no way to get a pointer to a field of a pointer without creating an intermediate reference, which might be UB
aint that a kick
haha ^^
@Stargateur That's truly magic since you can bypass the borrow checker :)
15:38
not very magic xd
15:51
Nope, it's just unbounded references. Rust Dark Arts 101

« first day (1728 days earlier)      last day (1981 days later) »