« first day (2604 days earlier)      last day (886 days later) » 

2:59 AM
@E_net4thecurator hmmm... one of the security settings in my browser is blocking that website's access to local storage. maybe third-party cookies being blocked, but I'm kinda lazy to test it out
... I decided to stop being lazy and could confirm that yes indeed
I could also have read the transcript. but, alas.
 
3:30 AM
@DenysSéguret At least it's clear dtolnay XD
 
 
3 hours later…
6:38 AM
He doesn't seem good at recognizing errors
 
6:56 AM
maybe that explain why I'm seem blocked from interacting haha
Even if I don't remember having any problem with dtolnay
funny cause based on the quote he use, he should have upgrade the minor
that remind me warp use anoying trick to allow breaking change github.com/seanmonstar/warp/issues/742
I can't even understand why rustc allow this
 
 
5 hours later…
12:06 PM
@Stargateur I believe that message should also be linked in the places where they always suggest "use anyhow"
I didn't read the full issue though but that message really doesn't look good
 
posted on November 30, 2021 by Mark Rousskov

The 1.57.0 pre-release is ready for testing. The release is scheduled for this Thursday, December 2nd. Release notes can be found here. You can try it out locally by running: RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup update stable The index is https://dev-static.rust-lang.org/dist/2021-11-30/index.html. You can leave feedback on the internals thread.

 
12:45 PM
@Feeds try_reserve(_exact)?, hooray!
2
 
Hum... I should probably try to see where to add #[must_use] in my APIs (added one for now)
 
I have one in DICOM-rs IIRC, for a special writer.
Not that I had to, but creating the writer and not using it makes no sense.
 
I love the quality of the comments on PR. This kind of description here that even noobs can read and understand is outstanding
 
That PR and follow-up regression issue were particularly nice to read.
 
12:58 PM
yes
 
1:32 PM
> Allow panicking in constant evaluation.
nice
 
3:03 PM
@DenysSéguret and @JohnKugelman pops in here every so often as well ;-)
> experimental backend for codegen with libgccjit.
> Folks, this crate is made for me to use
I'm surprised by that coming from dtolnay
wonder if he was having a bad day when he wrote that.
 
 
1 hour later…
4:43 PM
@Shepmaster the whole message is very bad IMO, the "don't care don't use this crate", "if you not happy go help rust compiler" aka "you critic but do nothing"
and I think he block me cause of this thread github.com/rust-lang/rust/issues/48043
I don't really agree I deserve it just for that but meh, his loose
BTW, I will probably remove all bad thing I say on warp, I just understand how to use it and I shame I didn't understand before, even if in my defense the doc is a small
 
5:13 PM
fascinating, a whole aspect of unicode I'd never heard about that literally dwarfs all my current knowledge of it: Warning: Text run is not in Unicode Normalization Form C.
 
There's a lot of things in Unicode
(I had to deal with the various normalization forms and finally did as everybody: I gave up on the fine details)
Here's a quizz for people here who studied Mathematics.
How can this line (https://github.com/Canop/termimad/blob/3c143bddefa20988f621beb78256ce7c775ce1d1/src/tbl.rs#L214) result in "index out of bounds: the len is 10 but the index is 10"
 
@DenysSéguret I'm interfacing with a FileMaker system and it appears it's not as tolerant as web browsers with un-normalized strings.
 
FileMaker ? The thing from last century ?
 
indeed
I've worked on Hypercard.
 
I made games on Hypercard
 
But... there was no Unicode at that time
 
I played Scarab of Rah on mac classics?
The original One box computer
 
I don't remember this game. My mother had a Mac 128 before they were officially imported in France
A classic is a recent Mac :)
/me has no shame boasting being old
 
@DenysSéguret depends on what type widths is. could do something funky with impl Index ;-)
 
@Shepmaster It's defined a few lines up. vec![0; nbcols]
 
5:25 PM
@DenysSéguret there should literally be none
 
@DenysSéguret yeah yeah, but I was only looking at that one line
 
Story time: my first programming gig was assisting my father rewrite a Hypercard application he'd written and maintained for 17 years to a PHP/MySQL web application
The hairiest part was emulating Mac OS 9 on Mac OS X, since it'd since had died away
 
The problem when skipping unrelevant lines:
 pub fn fix_columns(&mut self, lines: &mut Vec<FmtLine<'_>>, width: usize) {
        let mut nbcols = self.nbcols;
        let mut widths: Vec<usize> = vec![0; nbcols];
	// skipped lines
        let widths_sum: usize = widths.iter().sum();
        if widths_sum + nbcols < width {
            // it fits, all is well
        } else if nbcols * 4 < width {
	    // skipped
        } else {
            // crisis behavior: we remove the columns which don't fit
            nbcols = (width - 1) / 4;
            cols_removed = true;
 
@DenysSéguret nbcols = 10; width = 45
what's the 4 about anyway
 
How comes I looked at this exact cases a few time and even wrote a loop to test all combinations and didn't find this case ?
So there's a logic error here:
    for nbcols in 1..20 {
        for width in 0..200 {
            if nbcols * 4 >= width && (width - 1) / 4 > nbcols {
                dbg!((nbcols, width));
            }
        }
    }
@Shepmaster because of the margin, it's for fitting a table
Thanks @Shepmaster
 
5:35 PM
@DenysSéguret was I actually right with those numbers?
 
in fact I don't think so: it would go in the nbcols * 4 < width branch
 
I just did the math backwards: in for ic in 0..nbcols if ic is 10, then nbcols >= 11. Then 11 * 4 + 1 (undo (width - 1) / 4)
I hadn't actually thought through the ifs before that
but the nature of integer division gives some wiggle
 
Yes, but I don't think I'm flirting with the far borders of computer science here
Can I assume that the vec allocation would have panicked in case of failure (there was a full disk on time of crash) ? Is it possible to have a too short vec because there's not any memory left ?
(I'm using the standard allocator)
 
@DenysSéguret no
unless a VERY BIG bug in linux
the code is very hard to follow
 
@Stargateur I won't pretend it's nice. Never could write a code balancing columns which was at the same time nice, fast and not buggy. And it looks like I didn't even achieve not buggy...
 
5:48 PM
@DenysSéguret I think it would have terminated the program, not a panic.
 
obvious thing for me is nbcols = (width - 1) / 4; is suspect, width is a parameter and nbcols was in &self why do you assume (width - 1) / 4 <= nbcols
 
Because of the previous if branch
 
widths_sum + nbcols < width here you prove nothing
 
I mean the else if nbcols * 4 < width
 
and here nbcols * 4 < width.... let me think
 
5:50 PM
As the error report made me doubt, I wrote this: chat.stackoverflow.com/transcript/message/53557181#53557181
(and it logs nothing)
 
I fail to imagine the error report is fake
 
Hum... is it true that 39 / 4 is 9 in Rust, with usizes ?
 
yes of course
oh
haha
ofbvious
the op have a VERY BIG width
9*4 < 500
500 - 1 / 4...
except by far the array side
 
If the width is big, we're in the second branch, not in the crash branch
 
I didn't sleep
but there must be something
maybe an overflow
or underflow ???
width == 0 ?
@DenysSéguret ^
 
6:04 PM
yeah, that should be checked as it leads to 0-1
 
yes
(it's checked elsewhere)
 
a zero is hidden here
also make sense linux probably say "I don't have any place 0 width disk is full"
 
@DenysSéguret Yeah, I tried play.integer32.com/…
(might have to run it locally for bigger ranges)
 
7:08 PM
> Usage of Reference Counters is impossible for me
a bold claim
 
7:19 PM
> @Shepmaster What do you think about changing the title of the duplicate? This question's title is a lot better IMO.
> @JohnKugelman I'm ambivalent / slightly negative on it. The dupe's title is pretty generic, but it also matches the error message (which has been similar since circa Rust 1.0, even!). I'd be up for changing it, but somehow still keeping the wide applicability. This question is a specific instance of that problem (e.g. the loop isn't relevant, but OP called it out).
> If it were made a dupe, then SO will do it's thing and redirect from A to B, getting SEO juice from both. OP has even altered the question while we've been talking, so this title may need to change.
 
@Shepmaster Works for me. I hope I can convince the OP to leave their question alone so it can be marked as a duplicate.
 
1
Q: Why does the borrow checker raise an error when I keep a reference to an element in a vector that is appended to within a loop?

arunanshubI have two structs, Holder and Held. Holder holds a reference to Held. Held holds an i32: struct Holder<'a> { val: &'a Held, } #[derive(Debug)] struct Held(i32); I want to create 10 Holders in a Vec<_> named holders. Since Holder takes a reference to Held struct, I also create a Vec<_> name...

48
Q: Cannot borrow as mutable because it is also borrowed as immutable

Shulhi SapliI am learning Rust and I don't quite get why this is not working. #[derive(Debug)] struct Node { value: String, } #[derive(Debug)] pub struct Graph { nodes: Vec<Box<Node>>, } fn mk_node(value: String) -> Node { Node { value } } pub fn mk_graph() -> Graph { Graph { nodes: vec!...

so, what kind of ideas you got for the older question's new title?
 
The new question's title is perfect. I wish the original question had been formulated so clearly. I really like it when questions are about what the person is trying to do and not the diagnostic their compiler spit out.
But it doesn't need to be renamed if the new one points to the old one. That avoids having to worry about invalidating other links to the older question.
 
I'm much more aggressive about editing titles nowadays. Back then I was a bit more timid.
> invalidating other links
do you mean that literally? like the URL?
cause https://stackoverflow.com/questions/47618823/this-text-means-nothing-at-all
 
not literally
in spirit I mean
there could be links to it that aren't about vectors
 
7:27 PM
I hoped so, but figured I'd rule out the easy case ;-)
We can see the links within SO, at least
 
that's a ton. I'm not reading through all that :P
 
just the titles though
 
unrelated.... I've mentioned rust a bunch at work. my coworkers are actually interested. their eyes don't glaze over. I've half-jokingly said we should use it on a new project. to my surprise they are considering it
now I'm finding myself backing down. I'm sad. I can't bring myself to seriously propose it, cause nobody knows it, and I'm pretty sure it was a mistake to use it on my last project cause nobody could maintain it after I left
 
@JohnKugelman <self-promotion> integer32.com
> Rust Training

We offer custom training to help your team hit the ground running in understanding, extending, and maintaining your company's Rust code
 
ah yes. I was just reading through your site the other day
what's your feeling on introducing rust to a company? with my project manager hat on it's hard to swallow the cost/risk
 
7:34 PM
We've had some calls with people where we've straight up said "nah, Rust isn't a good fit for this {project,team,time}"
We don't want to over-promote Rust and have people get a bad taste of it
it'd be like a higher-order RIIR nastiness
so, as always, the answer is "it depends"
what the problem being solved is, why rust is (not?) a good fit for that problem
 
ok this is weird to write but.... do you think average developers can be successful with rust?
 
weird but prescient. I think the general answer is yes (just assume I add "it depends" to every sentence, reall)
 
I always feel like everybody in the rust community is top tier. the average poster on URLO is damned good
 
Is your average dev going to write some wildly deep generic trickery? probably not. but they can likely use some generic trickery that someone else wrote and the compiler will stop them from doing the wrong thing
when I talk about concurrency, my trite saying is "the compiler will stop you from doing the wrong thing, but won't always help you find the right thing"
 
I anticipate them being completely flummoxed by borrow checker errors
 
7:40 PM
which language(s) as background?
 
I'm not imagining anybody in particular. or... I'm trying not to
 
but what programming language(s) are used for current work?
 
the guy I'm working with most, we do mostly python and C++
 
Those who do C++ might feel at home with Rust. Can't say exactly the same about Python.
 
I feel like C and C++ devs are the most bi-modal people coming to Rust
more love or hate responses
 
7:43 PM
there've been pain points around when to raise/handle exceptions, for instance. nothing difficult there (to me), but he didn't quite get why I asked him to move an exception handler up the call stack. or in C++, he can do pointer stuff and use the STL but doesn't understand them deeply
so I can just imagine the number Rust would do on him...
 
I think average developers could be OK in Rust, when not in technical leadership at least. I mean, there are a lot of things possible when the basis are laid and there's an "expert" ready to solve the difficult data design problem
But it's yet to be proven
 
yeah, the pointer example is a good example of the split I'm thinking. Likely, Rust would say "you can't do that". Then it's up to that person to appreciate that they figure that out at compile time vs debugger time
 
maybe it can work if there's always a guru around who can field the tough questions?
 
@JohnKugelman I think so
 
I think that's more close to a "guarantee", yeah
 
7:46 PM
this is where shepmaster's plug comes in hehe
 
I was thinking about an "expert", not an *expert*
(meaning myself or your common technical leader, not shep)
 
And, specifically for i32, we want to create more of those experts. We want Rust to (appropriately) take over the world, and that's not going to work if we just made teams reliant on us
 
yeah if we need shep we're doomed. if I can do it, there's a chance...
 
@JohnKugelman says the person with the most commits to rust-lang/rust in the next version
 
maybe, but I still don't know what 'a: 'b means so don't worry you got me beat by a mile
 
7:52 PM
@JohnKugelman Ahaha. A little up in the chat, we were speaking in awe of your recent admirable work
 
@JohnKugelman knowing what it means is useful, but PROTIP — I've yet to find a place where that specific syntax was actually needed or wasn't outright incorrect.
 
@DenysSéguret there's my work and then there's, say, Pin. two different planets. different galaxies
 
I also say that Pin (and related concepts) are likely the single most complicated things in the stdlib
 
Sorry, my sight can't let me see so distant stars so I only look at the bright near ones
 
So I'll I'm hearing you say is "I'm not 99.9999%, only 99.999%"
 
7:56 PM
lol in seriousness, and to connect back to where we started, this is why I can't bring myself to envangelize rust at work, except "jokingly"
it's no good if it dies if I leave
maybe if people try it out on their own and it's not me pushing it, maybe then...
 
It is a true thing.
Why do you not trust them for the middle?
You push it, and then they honestly say yes or no?
 
@JohnKugelman TBH this is exactly why I didn't switch the big soft at work to Rust.
(and it was maybe a loss for the company because I ultimately decided to leave because I didn't want to go on with a Java career)
 
> the big soft
This also suggests trialing it for smaller things, which I think is reasonable
 
@Shepmaster We cut it in little parts, progressively. Some small ones in Rust. One of them even open-source.
 
@Shepmaster they're pretty easy going. I don't expect resistance if I push
but that was the situation at my last job. I pushed for rust, they said ok, we RIIR'ed... and I left
I bet it's abandoned
oops meeting ttyl
 
8:18 PM
@JohnKugelman It's not a trivial thing, but I'd encourage you to empower people a bit more
See if there are problems that they have / care about
and get them invested
 
> How to let the timer go ahead in rust?
What does that mean ?
 
This kind of question usually comes from users with 1 rep
But it's not a common high rep user:
Speaking of that, congrats @Shepmaster for crossing the 300K today!
 
8:36 PM
@DenysSéguret almost
 
today, I said
(now go answer this timer question so that I'm not wrong)
 
 
2 hours later…
10:08 PM
do you all get notifications when you're mentioned? I scrolled back and saw that @Shepmaster pinged me a couple of times but nothing popped up on the SO main page
I'm poking around trying to see if I have something misconfigured
 
10:49 PM
@JohnKugelman yep
it shows up in the notification box as "chat reply" (instead of "comment", "answer", etc.)
 
11:02 PM
But you wouldn’t have gotten that one I sent.
You have to have visited the chat room recently enough. You hadn’t, so I typed your name by hand.
It’s a way to avoid harassment/spam I assume
 
oh I see, you can't summon me out of the blue
 
11:24 PM
And yet here you are
 

« first day (2604 days earlier)      last day (886 days later) »