« first day (1919 days earlier)      last day (1569 days later) » 

4:45 AM
@Stargateur could you elaborate on why you think using Rust even for DAGs is a bad idea?
 
Option<Rc<RefCell<TreeNode>>> is not enough ?
 
That's just the way LeetCode has set it up to be consistent with their other examples. A simple tree with no parent pointers doesn't need to be that complex
 
that doesn't matter
std implement binary tree with vector
every crate I know use a vector
and some do an linked list implement ion but disadvise to use it
rust is just not mean to be linked list friendly and trust me I love this data structure
 
for efficiency yes. but as a pedagogical exercise, i don't think we should scare people off of it. there's a difference between the implementation worthy of being in std and one meant to test someone's prowess of traversal algorithms
 
but it's most of the case not the good thing to use
but Rust complexity will disallow you to learn anything good
linked list is NOT a good thing to learn with Rust
we see too many question about linked list in Rust tag
and every time it's end the same
 
4:52 AM
yes sure i agree that it's not meant to be used with complex ownership patterns, etc. but i don't agree with the other extreme of "Rust complexity will disallow you to learn anything good". What's so hard about: play.rust-lang.org/…
and i mean in the context of learning not for an optimized data structure fit for std
 
guess this present the point of view of a newbie
 
i don't disagree with you there. but that's a doubly linked list not a DAG which is the context of my point
 
and you can see here even if ths post is quite stupid
> So what's the catch here - how is this even possible?

The catch is that we're storing nodes inside a Vec instead of relying on malloc, Box, Rc, or something like that. This way we can access nodes by indexing into the Vec instead of dereferencing a pointer, which gives us a lot of freedom in escaping the borrow checker.

Actually, we're not using a Vec directly, but a thin wrapper around it called Slab.

Q: This is cheating - a real doubly linked list must allocate nodes on the heap.

Why? If you really need to allocate stuff on the heap, just use List<Box<T>>. Alternatively, you can als
the solution is to use a vec in rust
it's better faster stronger
@sshashank124 DAG ?
a linked list is a graph
same shit
 
actually not even a DAG, just a simple tree (no cycles)
 
a tree is a linked list, well at least in the context of this question
all I said still apply
 
4:58 AM
yes but singly-vs-doubly matters a LOT
 
probably
 
definitely
 
 
9 hours later…
1:48 PM
@sshashank124 since you are here, please don't answer duplicates. Just close them as duplicates.
 
2:07 PM
a friend have problem with certificate on internet-signalement.gouv.fr/PortailWeb/planets/…
I look the date...
18:08:22
I was hmmmmmm let look if it a friday
lucky it was a thursday
 
Into<Option<Vec<&'a str>>> eww.
 
A guy gets angry because I can't accept his PR which "improves" too many small parts of the code. Then, later, I bisect to fix a bug. The origin was the previous PR of the same guy, a small refactoring he did to clean the code...
I'll bite
 
haha it's happen
that because you don't have enough unit test
fly away
 
go make unit tests for broot please
 
I can't I'm flying
 
2:16 PM
It happens too often. Always people get angry because I don't like their PR which cleans the code... and don't understand that a PR must be focused
 
agree
well commit must
and PR can be more general but not too much in my opinion
 
BTW I'm annoyed with cargo fmt. Unlike go fmt I can't always just go with it. Too often does it break the consistency of the code. It's 99% good but the 1% it breaks is painful. But it looks like stopping using it is worse :\
 
agree too
 
@DenysSéguret #[rustfmt::skip] ?
 
This would clutter the code when the goal is just from time to time to have slightly more consistent blocks or shorter lines
 
2:19 PM
I mostly use that for giant arrays that I want to organize in a specific pattern (e.g. 2x5)
You got a link to the PR that caused the problem?
I'm always curious about these kinds of things
 
me too
 
And I'd certainly submit a PR that cleans code
 
The bug I'm fixing was introduced here: github.com/Canop/broot/pull/132
Most of it is reasonnable, because my code is far from perfect
 
ah, yeah, I wouldn't like a PR that says "numerous" and is a single commit
 
It's not gigantic though
 
2:21 PM
And I always do rustfmt of existing code in a separate commit
 
but he got encouraged I think because I refused another one this morning which changed 11 files
I'll probably end up making a cargo fmt
I have too many small unconsistencies, like missing spaces
 
dyn AppState I see you Java !
 
Is the bug the loss of status.display(w, screen)?; ?
 
It's the event loop
like all multithreaded code, it's painful to analyze
 
while state.has_pending_task() & !tl.is_expired()
I'm dying
this should not compile
 
2:25 PM
I don't try to be too clever in those things, unless I had a very good night of sleep, which doesn't happen since somebody posted broot on HN
so I do stupid boring loops with breaks
 
yeah the loop is stupid
but & => &&
this angry me
 
Hehe. I liked the loop with the break condition.
 
what does true & true do in rust
this should not compile
 
true & true => non-short-circuiting
&& => short-circuiting
 
@Shepmaster ohhhhh
bug is comming
 
2:28 PM
Heheh. Yeah, he could have short-circuited the is_expired call.
 
the previous version was short circuiting
 
Also, you can use & in a const context right now, but not &&, IIRC
 
What I try to get people to is to come explain me how my code is stupid, not fixing it (and introducing other bugs)
 
Well, I'd say "explain & fix" is the right thing
like, the changes from -> &Box<T> to -> &T are good
 
yeah, most changes are good
 
2:29 PM
grrrr: he remove let mut cmd = cmd; to put mut in parameter
 
And the explanation is basically stackoverflow.com/questions/40006219/…
 
this is not a good change
 
@Stargateur It's a stylistic change. I don't like when people change the style in code they down't own without discussion
 
@DenysSéguret yes, clearly
 
Conversely, I think that the mut in the args is idiomatic.
I'd bet that Clippy reports it
 
2:31 PM
@Shepmaster that would be strange
 
It's an unnecessary re-shadowing of the variable. I'm sure it's optimized out, but it does look like something clippy would lint against.
If there was an inner scope for the mut shadowing, it probably wouldn't lint against it, but shadowing it mutably was the first line of the fn
 
Re: style; I agree about not modifying the style of code you don't own. I wonder if there are settings to enforce your style on rustfmt - I know it's pretty configurable.
 
no it doesn't and I don't agree about "unnecessary "
 
@Zarenor In this specific case, it's not really that I favor one over the other one. It's without importance. But keeping changes to the minimum is a rule for contributors
 
2:35 PM
"unnecessary" isn't opinion-based. You can say you prefer the shadowing style, sure. But there's no need to redeclare the same label as mutable, when you're already taking ownership of the value.
@DenysSéguret I agree 100%. A lot of the changes here look just like 'I ran rustfmt with standard settings'. I agree with some of them, disagree with others. But most of them are just changes from that. They're useless changes.
 
yes, this hide mut from function declaration
 
@DenysSéguret one thing I've done, and always am a little iffy about, is that I'll pull down the PR, do my git-fu to split things up and change / remove modifications, then push back
@Stargateur nope, the mut isn't shown in docs
 
@Shepmaster damm, I still like the shadow mut redefinition :p
 
but definitely the rustfmt changes should be in their own commit (ideally with enforcing it in CI)
 
I think rustfmt should be do by one of the owner of the project
you can't trust unknown contributor
 
2:39 PM
well, you'd review it certainly. Ideally doing the aggressive git diff -b -w and more options to ignore whitespace changes.
 
That's kinda what I'm driving at with trying to configure rustfmt to enforce your style. Then you can integrate it in CI, and never think again if you have to change it/review for formatting style.
 
3:14 PM
@Zarenor Actually let [mut] x = x; does interfere with the optimizer: github.com/rust-lang/rust/issues/58622
 
@mcarton haha xd
 
... That... In that issue, it.. anti-interferes? The fast version is the one with the redeclaration? But it only matters if the print is operating on a reference?!
😖
 
This kind of things is why I run my benchs before every commit
 
@Zarenor well, removing the mut makes it go faster
And in that example, the variable is used both as mut and not
Whereas in this case, it's only ever used as mut
 
3:32 PM
Ahhhh. Hm.
 
3:50 PM
@Shepmaster i couldn't resist
i did one iteration too
i believe this time it worked, i'll update question since it uses channels with dropping
 
@ÖmerErden no worries!
 
have no time to add explanation
i'll just add code and playground link
then edit if you say it is ok
or i 'll remove
 
@trentcl thanks for those edits. Although I make a lot of edits, I generally feel uncomfortable putting too many words in the OPs mouth.
Especially llogiq — they have been around Rust long enough to know how to communicate effectively
@ÖmerErden now, the dubious thing here is that you reused your previous answer, which someone had upvoted, presumably for a different reason
 
4:09 PM
İ believe i can add new answer but this one needs to be removed
 
I mean, I dunno if I'd worry about doing anything this time
but it's something to be aware of
but yeah, in the future, you could have left that one as deleted and added a new answer.
It's also possible the upvoter would have also upvoted the new answer, in which case it's all the same
 
İ totally focused to the question actually, that was unintentionally
 
If anyone wanted to ask questions about Pin, boats is livestreaming. Talking about it's motivation and talking through examples and taking questions.
 
The more important thing, is this one satisfies the question?
 
 
2 hours later…
6:04 PM
@DenysSéguret focused on cleaning the code? runs away
o/
 
 
1 hour later…
7:09 PM
It seemed pretty uncontentious
@Shepmaster argh stupid mobile chat interface
 
8:09 PM
Restructuration at Mozilla too ?
 
@DenysSéguret oh?
 
seen a few tweets of layoffs but I don't know enough to get a clear idea of the size and it's not out in the news
a friend just found this: newsdio.com/…
> Mozilla is still investigating how this decision will affect workers in the United Kingdom and France
So I'll see more tweets, I guess, there are many mozillians in Lyon
 
9:10 PM
There's Mozillions of them
 
Layoffs didn't seem to spare people working on rust
 
9:25 PM
@DenysSéguret oh no
 
 
2 hours later…
11:30 PM
funny because firefox put a hiring job on linkedin recently
 
11:42 PM
@Shepmaster Hey hey
The company I work for are looking to convert some ~10devs to Rust
I know i32llc does training; how does it work?
I wanted to suggest you guys to do it
 
@Stargateur I know, this is just less formal and business-y; If I contact them I'd do it from my work email and then it's like an official thing.
 

« first day (1919 days earlier)      last day (1569 days later) »