« first day (2169 days earlier)      last day (1302 days later) » 

2:12 AM
 
3:11 AM
Does anyone understand what this user is asking? stackoverflow.com/questions/63981048/…
I'm thinking there's a language barrier, but even so, I can't really make heads or tails of the question
 
 
4 hours later…
7:09 AM
@Shepmaster rule number one, you can't control people
 
7:49 AM
I just have a genius idea for a crate
tell you more when I dig a little more :p
key word: safe union hashmap enum
 
@Stargateur please ping me when you're in the hole
 
8:28 AM
where is the hat ?
 
Please don't leave a picture of me so upscaled like that.
I only bring the hats on specific occasions.
 
@Shepmaster Is it not? I believe all of us have limited amount of time to work on projects / side projects, no? If they focus on one thing they are not be able to do so with another thing, unless I'm missing an obvious step here..
@Shepmaster Not sure I understand the distinguishing -- for me, "error handling" is an umbrella term, but that could be a problem in my definition.
@E_net4thecloserasduplicate I quickly skimmed your article, and if I'm not mistaken you point out that there are problems with error handling libraries that you used in the past and now you switched to a different one which is better at what it supposed to do and now life is great. This does not prove or disprove that the existing error handling facilities of Rust are incomplete or need further refinement. It only proves that people are idiots and don't know how to use errors
 
@PeterVaro FWIW the people in the error handling group were already heavily involved in the ecosystem around error handling, so it's not like they're wasting time organizing their efforts.
 
(i.e. writing error-handling libraries)
@E_net4thecloserasduplicate They are allocating time to work on error handling -- which means they divide their resources, no?
 
8:45 AM
@PeterVaro Those are strong words for mistakes in error handing/type design with could happen to anyone. I just checked the relevant section of the book and the docs on std::error::Error again, and neither one talk about these concerns: proper error chaining without just letting From do the magic, good Display impls for error types, backtraces,... so, the stuff I mentioned in the post.
It's more idiotic for someone to have to learn this by making the mistakes firsthand IMO.
 
Agreed that it is not great that we have to figure this out ourselves over and over again. All I was trying to say -- which I said many, many times before not necessarily related to errors -- is that we need a "best practices" place, a book if you like, about common Rust idioms and patterns. Which is far more advanced and in-depth then Rust-by-Example. One crucial and early topic it should touch would be errors.
I think the approach of "looking it up in the book" is not so great either. (I'm not blaming you, I do this all the time when I try to explain or justify something to someone.) Because the book (albeit very well written and essential) is just a learning material, which would guide your first steps
 
@PeterVaro Yes, sure. And one of the necessary steps towards that is to define those idioms and patterns. We are not quite there here.
 
but then I believe you would need something more substantial and in-depth, covering corner cases and whatnot
 
@PeterVaro One is the book, the other one is the standard documentation, and quite often the Rust API guidelines go third.
 
@E_net4thecloserasduplicate True, but those are still not "patterns". For me, patterns are like put these atomic blocks together. The book I have in mind would dig into problems at a higher level (regardless of the size of the problem or levels of abstraction), explain possible solutions at a higher level, and then picks one (adequately explains why that one was picked) and implements it down to the lowest levels
 
8:56 AM
@DenysSéguret imagine, http headers, key value, problem I have an enum that represent these headers, one solution have a hashset to stock all theses enums, problem need to wrap it to use discriminent of the enum instead of comparing header value, another problem you need to unwrap it after get the value so you match twice. solution 2 use a vec, long to find value, still need to unwrap, solution 3 have a big structure so you can access directly all value, create a big structure, annoying to maintains
 
I think the need for this kind of "pattern book" is coming from the fact that Rust has such a different approach that most of the known patterns do not fit / work very well when people try to migrate them from other languages
 
here my solution 4 use union, have a hashmap<Discriminant, MyUnion>, so I have a smaal structure still fast access and don't need to unwrap the type after get it.
and I find I could create a crate with a proc macro to do this
unfortunately, this currently use nightly for non copy field
 
In some cases, like the errors, the patterns are needed, because the language provides such a flexible and at the same time minimalistic / bare-bone tools that otherwise you have to figure out what to do with them.
 
@Stargateur My solution (for broot skins): use a macro to maintain a giant structure. So that there's no lookup, no magic strings in code, a verified compilation
(I'm not against a generic solution, of course)
 
@DenysSéguret well yeah I did this but without the macro, but I think it's not a good solution because at the end SIP protocol have like 250 headers type...
This will be very bad at the end and maintain it doesn't look nice
@DenysSéguret My idea should be safe using manualdrop
and so generic without cons
but I don't know use procedural macro and I have no time for this know so I will just implement it at thand for now
but I will add it to my todo list
 
9:15 AM
@Stargateur Just in case. This macro block defines the structure, defines a method to initialize it from a hashmap (i.e. from conf) and sets default values. There's some ugly macro behind but the structure is very easy to read and maintain, involves no lookup during usage and all usages are statically verified
No lookup usage:
panel_skin.styles.flag_label.queue_str(w, &format!( " {}:", flag.name))?;
panel_skin.styles.flag_value.queue(w, flag.value)?;
 
 
3 hours later…
11:59 AM
@E_net4theaccountreporter Thanks man.
 
 
1 hour later…
1:14 PM
posted on September 21, 2020 by The Rust Core Team

We will be closing the collection of blog posts on October 5th. As a reminder, we plan to close the survey on September 24th, later this week. If you haven't written a post yet, read the initial announcement. Looking forward, we are expecting the following: Roadmap RFC proposed by mid-November Roadmap RFC merged by mid-December We look forward to reading your posts!

 
 
3 hours later…
3:44 PM
it's compile and... it's working after 6 hours of hard work
unsafe overflow today
 
make sure to run it in Miri and Valgrind, if you actually have unsafe code :-)
 
 
2 hours later…
6:10 PM
Aww
> Thanks Rust Kerby Mod for your hard work
3
 
6:29 PM
😂
I tried doing some wasm today. It hurt me a bit.
 
@E_net4theaccountreporter what kind?
 
@E_net4theaccountreporter In what way? The last time I played with it (building a VT100 emulator), it was a rather nice surprise. The only thing I loathed was the fact that I still needed some HTML and JS overhead to make things work :/
 
@Shepmaster had some trouble turning a vec of bytes into web ImageData via wasm-bindgen.
 
 
4 hours later…
11:06 PM
What's the idiomatic way to consume n elements from an iterator?
Currently I just loop 0..n and call next().
@E_net4theaccountreporter My experience with Rust and wasm so far has been more than great
 
11:18 PM
@EnnMichael Perhaps you're looking for std::iter::Iterator::skip (or nth, or take depending on your use cases)
 

« first day (2169 days earlier)      last day (1302 days later) »