« first day (2240 days earlier)      last day (1248 days later) » 

8:15 AM
morning
 
 
1 hour later…
9:19 AM
Morning!
 
9:39 AM
@Jason sup?
 
Not much, I was looking at the Advent of Code, I've never participated in that.
@AndyK And you?
 
@Jason another meeting
 
@AndyK Ah, hope it'll be a productive one :-)
 
9:58 AM
@Jason ha ha 😂 wishful thinking
 
@AndyK Such is life :-)
 
it reminds me of that song
 
 
1 hour later…
11:06 AM
@AndyK It's quite nice!
 
@Jason it is. bunch of London guys. Nice stuff.
 
 
3 hours later…
2:54 PM
@Shepmaster :+1:
 
They seem pretty different to me. I find the toolchain commands pretty opaque, and I'm not actually sure either answer is as clarifying as I'd like, either, FWIW. Maybe I'm being thick.
This is to say - for someone who doesn't deal with these all the time (and I presume that's who'd look for these questions), I can see there being an answer that satisfies both questions, but I don't think it's either of these accepted answers.
(Or any of the other, worse answers on these Qs)
 
3:36 PM
@Shepmaster huh, possibly my newness makes me miss the obvious, but there does not seem to be the "multiple different versions of rust" in the first question, simply of the different toolchains, but not say, the same msvc nightly for different rust versions?
 
@FĂ©lixGagnon-Grenier The thing is that Rustup can handle both. And the accepted answer in the second question answers the first question.
 
it does indeed
 
@FĂ©lixGagnon-Grenier I'm not sure what you mean by "the same msvc nightly for different rust versions"
 
me neither tbh
 
:-)
 
3:40 PM
my understanding is something along the lines of "there are different versions of rust, each of them having stable msvc and gnu toolchains"
so in that (possibly wrong) regard, could be a 1.7_stable_gnu alongside a 1.8_stable_gnu
unrelatingly, I am recently out of a job, so full of time to mess around in rust!
 
@FĂ©lixGagnon-Grenier that's correct, but there's no version associated with msvc / gnu
so you have 1.48.0-windows-msvc and 1.48.0-windows-gnu (or whatever the actual name is)
(opposed to your example that has two versions in one thing: "Stable" and "1.8")
 
oohh. stable and nightly being aliases of sorts to an actual version number
so one could "lock" a version in a rust-toolchain file instead of stable or nightly
 
@FĂ©lixGagnon-Grenier yes.
@FĂ©lixGagnon-Grenier And that's what you usually would do, if you need to lock it
The aliases are called "channels" by rustup.
And the most recent release adds new channels called "1.42" / "1.30"
so that you can use the most recent patch automatically.
 
@Shepmaster huh. for some reason just now reading that made me think of git branches
 
Or semver.
"stable" ≈ "^1"
 
3:54 PM
well, that was very informative thanks. I think I should revise my original intuition, first question do seem like a dupe candidate :)
 
4:42 PM
@Shepmaster or elkver, "stable" not found
 
5:17 PM
Now I'm wondering how exactly we're supposed to use the wontfix label in issue trackers.
I had assumed it was designed to spite a particular request, even though there could be legitimate interest in the feature or correction.
 
5:35 PM
@E_net4ischilling is this question caused by anything in particular
 
@Shepmaster Found a maintainer creating issues immediately with this label.
The repo
(It's one of the GitHub GameOff 2020 submissions)
 
@E_net4ischilling ... I do this.
 
@Shepmaster So after all, people use it to suggest "I won't be working on this, but other people can"?
 
@Shepmaster But that's different. You are not creating those issues.
Also, a bit frightening to know that Rust 1.48 broke a specific thingamajig in the winit dependency used by amethyst..
 
5:44 PM
@E_net4ischilling I ran into some issues with Amethyst on Wayland quite some time ago github.com/amethyst/amethyst/issues/1846 It would only work with WINIT_UNIX_BACKEND=x11 :-(
 
 
1 hour later…
6:50 PM
@E_net4ischilling link?
 
it's amazing, campany send information about problem, I ask what is 11/21 and say to use iso format date, people on the discord saying "omg you stupid it's November 21" and say I'm toxic
the amount of US campany who assume people all use US standard is amazing
and the amount of people that can't understand why iso format is better is also amzing
 
I am very much onboard with that specific pet peeve
 
7:12 PM
> At 11:30 am PT
they strike again
 
7:45 PM
@E_net4ischilling how do you know it's rust ?
 
8:26 PM
@Stargateur 1. The game panicked in a Rust way. 2. It's GitHub GameOff, so the source code of all submissions is pushed to GitHub.
@Stargateur Oh, you mean whether it's the compiler's fault? We don't know for sure, but it does help to use a different toolchain.
 
yes it was my question
 
There's a link to a Rust PR that caused the change.
I'd say it's probably winit's "fault"
but it's also for an older version of winit
 
8:41 PM
So do you guys just unwrap results when dropping?
Seems like the most logical course of action
What else could I possibly do?
If the destructor is failing then we're going to burn, no way around it
At least that's how we did it in C++
 
8:58 PM
@EnnMichael avoid it if possible, but yes.
Some times you can have a function that takes ownership or otherwise checks the error
the highlighter highlights "TODO" in comments. cute
> Coming from C++, my natural instinct is to create some sort of global reference to one of the Bullet objects in the bullets field
nooooooooooo
 
@Shepmaster Ha, my first thought was "What's wrong with using an index?"
I've had to write too many carousels and sliders using JavaScript

 
@Jason now, there are problems to using an index
especially when mutation is involved
 
9:13 PM
@EnnMichael aa destructor must not fail
as shep said, use consume pattern
 
@Shepmaster I'm not sure if others feel the same way, but I felt that there was this giant push towards immutability among JavaScript developers due to some of those reasons.
 
@Jason Oh, I adore immutability in JS. immer.js + reselect all the way
 
isn't all immutable in javascript ?
 
technically yes, but nothing prevents you from rewrinting on identifiers, or changing nested properties
 
Are we talking about the same "JavaScript" or "mutability"?
const star = { name: true };
-> undefined
star.name = false
-> false
 
9:25 PM
@Shepmaster I love how making something const still allows you to do that.
 
const prevents you from writing on star symbol ;)
star.property, on the other hand...
 
yeah, it's locally reasonable, but when you mix it with other languages (esp. Rust) it gets confusing.
 
oh yeah, I got used to it but I'm pretty sure I've been angsty at this in the past
 
Right
star = 42;
Uncaught TypeError: invalid assignment to const 'star'
 
@Shepmaster As far as I know—JavaScript works in mysterious ways, so perhaps there is a way—one can't rewrite it to a different type let's say Number, but it's still odd and confusing, I think.
 
9:27 PM
@Shepmaster So if the user really cares they can call that function?
And otherwise the error is ignored silently?
Am I following
 
@EnnMichael "silently" is up to you, but yes.
you could also choose to panic
 
@Stargateur No
 
I think that depends on what the error is
 
I'm trying to release a USB interface
That is, I have a struct that claims it on new and releases it on drop
 
@EnnMichael yes
 
9:30 PM
No because you don't know my requirements and because if I use the consume pattern then I'm back to C again
SDL_DestroySurface
 
C isn't 100% wrong :-)
 
yeah
 
I find it completely acceptable to just crash in this case
 
that also a solution
but I would disadvice it
 
Yes, you are both right, what I said is stupid
 
9:31 PM
you can also restructure such that Drop isn't involved.
e.g. using a closure
 
when using canonicalize, does the transformation happen at compile time?
 
yep
 
Oh that is really interesting
I forgot that was an option
I saw it used once before
 
@FĂ©lixGagnon-Grenier no (that's impossible if you ruminate on it a for a bit)
 
yeah I was slowly getting to that realisation, or rather finding it hard to be in any way useful if I hardcode E:\Someath in an executable
 
9:33 PM
you can clearly do the drop that unwrap, and the consume method
allow to never forget to drop and still be able to handle error
 
@EnnMichael it's no silver bullet, as you force some indentation
 
@Shepmaster Oh come on
 
and you can't just move a value around quite as easily
 
I would avoid the closure
 
Why
@Shepmaster You can inside the block, right?
I don't really see the downside... maybe because I don't have a concrete example
 
9:38 PM
not nice to use
 
@EnnMichael I'd give it a shot and see what you think.
And the two approaches aren't exclusive.
You can create both.
You can do all sorts of things :-)
e.g
struct Device(Option<RealDevice>);

impl Device {
    fn close(mut self) -> Result { self.0.take.close() }
}

impl Drop for Device {
    fn drop(&mut self) {
        if let(d) = self.take() {
            let _ = d.close();
        }
    }
}
and
fn with_device(f: impl &RealDevice) -> Result {
    let rd = RealDevice;
    f(&rd);
    rd.close()
}
or max flexibility:
struct Device { inner: Option<RealDevice>, panic_on_drop_error: bool }
 
@Shepmaster I like this idea... but I think f isn't typed correctly :)
I don't know, that one seems the simplest to me, actually
Which would you do? The last one?
 
9:54 PM
@EnnMichael indeed. That's what I get for typing directly in the chat (f: impl FnOnce(&RealDevice))
@EnnMichael that's my point, you can do all of them :-)
at the same time
and use whichever best fits the specific case.
but I might start with the function + closure one
as it's simpler than Drop
 
you could also include some UNSAFE
 
 
1 hour later…
11:06 PM
Unsafe could be used if you wanted to have a Drop implementation but also a method that took ownership to close without using an Option.
 

« first day (2240 days earlier)      last day (1248 days later) »