« first day (2048 days earlier)      last day (1444 days later) » 

 
7 hours later…
9:18 AM
@Shepmaster O_O
 
9:47 AM
Time to contribute then. *builds rustc*
 
 
1 hour later…
11:13 AM
Nice document.
Well guess what, this particular problem is gone upstream due to a refactor I made 4 months ago.
I suppose it is time for a new release.
 
Is there a way to tell the compiler to ignore the type during monomorphisation? So, if I would have something like this:
pub struct X<T>(T);

impl<T> X<T>
{
    pub const VALUE: i32 = 1;
}
then instead of always writing: X::<...>::VALUE;
I want to be able to "contain" the generic nature of my type because it does not effect my const value
and instead of writing channelling through the generic type in every function and method that uses X
I just want to say X::VALUE
(I know I could just pass in a specific type since it doesn't matter and the compiler would shut up, but I don't think that qualifies as a nice solution.. :D)
 
11:31 AM
@PeterVaro That would be a kind-associated constant, right? :)
 
@E4netisheretodownvote Aye
 
I'd probably move that to a separate struct or into a parameter-less trait.
Other than that, I don't know of any plans to introduce that from of higher-kindedness. Other than GATs.
 
That's the "problem" when you basically program at the "type-level" (which is why we love Rust). When you would want to express everything at that level with maximum genericity then GATs are unavoidable. Thus, I honestly don't understand how 1.0 of Rust releaseed without it -- 'tis such an elementary feature of the language, well, it should be at least..
(I hit this wall every 2 weeks basically.. sometimes even more frequently..)
 
The reason often said is that was just a trade-off between community building and striving for purity of concepts. Had 1.0 been blocked on GATs, specialization, and so on and so forth, it definitely would have less enthusiasts and projects using it now.
Not claiming that this was a bad/good reason, just stating that it's indeed a grey area.
@Shepmaster But yes, thank you very much for keeping me informed. :) I have already reported my investigation on that PR.
 
@E4netisheretodownvote Oh I understand that, and TBF mine was more of a theoretical question. I got the practical aspect of this. Probably I would've asked the questions: Why didn't this come up earlier and more frequently? For the last 5 years, why did we focus on async and other big chunks of work, when GATs are easily more important than those..?
 
11:43 AM
@PeterVaro That is a much more interesting question!
Perhaps the intensive blooming of Rust towards web environments made it seem more lacking in asynchronous constructs.
As in, most mature web frameworks out there have and rely on async I/O, and that could be perceived as a regression in some use cases. This is also something I might need to look into for DICOM-rs.
Still, this doesn't explain why GATs are stuck the way they are now, as if only a "cliqued" yet small portion of the community often trip on the lack thereof.
 
Perhaps.. I don't know.. I definitely do not think that web frameworks should be considered as a priority for a systems programming language over its expressability, correctness / conciseness, and comfortability.
(The rest will come easily after one made those work..)
@E4netisheretodownvote not to mention this, yes.
 
Ah well, another mystery of life left for those without boats.
 
@E4netisheretodownvote I'm not familiar with this phrase / expression, 'for those without boats', what does it mean?
 
12:28 PM
@PeterVaro yes, it was a bit of an obscure reference. :P This tweet ought to clear it out.
 
So its 'withoutboats' and not 'without boats' ;)
Still bot convinced though this is a reference anyone would understand beside you :P
aaaaand I bumped into yet another problem that couldn't be solved without GATs.. this day began so great.. :(
 
1:09 PM
@PeterVaro That's the word play.
 
Suuuuuuure.
 
@PeterVaro False. It's a reference me and Shep would understand. ;)
 
:rolling_eyes:
:D
 
@PeterVaro O boy
What're you up to? :)
 
@E4netisheretodownvote Basically I'm implementing a VT100 screen emulator targeting WASM. I created something similar in pure JS 5-6 years ago and I thought it would be a nice candidate to port it. Aaanyway, there are many, many challenging bits in there, the most interesting one is to express the screen (i.e. channels, pixels, regions, grids, characters, glyphs, etc.) in a generic way, so that static buffers, dynamically sized screens, and "double-spaced" glyphs (this is specific to VT100) could be
used interchangeably. And because the program needs to both write and read to the screen this makes things quite a bit complex to express with lifetimes and traits without GATs
 
1:15 PM
Ah, trait handshaking can get tricky indeed.
 
2:11 PM
Aand now I'm fucked. While I was able to introduce my own iterator-type which is specific for a given lifetime because I could use a while-let easily over a for-loop (not ideal, but still doable and clean), I can't do the same thing with io::Write, unless I want to reimplement everything from scratch.. This is the third time today where I would need GATs.. :(
 
*head scratch*
 
unless I'll use unsafe at the top level, where I guarantee the safety by-usage over by-compile-time-constraints I can't see any other alternative.. Hey Rust core devs, we need GATs, now more than ever, can you hear us?
 
2:23 PM
Well, it might comfort you to know that we've never been closer to being able to use GATs. This has been merged, which suggests that future nightlies might support GATs behind a flag.
Or it could seem to work but break outstandingly.... Doesn't matter had GATs.
 
@E4netisheretodownvote Well, that sounds awesome, and obviously a huge thumbs up for that, but I try not to do anything with nightly -- it shouldn't be treated as a viable option for any project IMO: it could change whenever it needs to without worrying about breaking code that uses it. So, still miles away, but at least one step closer..
 
That is fair. I also prefer being able to day care horses.
 
3:02 PM
@E4netisheretodownvote wow that a trailer of a trailer
 
 
7 hours later…
10:18 PM
@E4netisheretodownvote truth
 
@PeterVaro this limits your ability to provide feedback however. I understand not wanting to rely on it, but wouldn’t throw it away entirely.
@PeterVaro also I run nightly as my daily driver and stable in CI. I find it a good mix most of the time.
 
@PeterVaro well there is "nightly will crash 9/10 if you try to use it"
and there is "nightly, we don't want to make this feature stable but it's very safe to use it"
 
10:43 PM
allow_failures is cool
Also, I did good this weekend. +778 −195 in 24 hours
 
John is fighting Rust compiler hard ^^
 
11:02 PM
@Stargateur there's got to be a simpler way lol
Box::leak(k.to_string().into_boxed_str()) as &str
 
@JohnKugelman about the box leak ?
I don't think so
but that not a good thing to do anyway ^^
 
seems ok if these labels are going to be displayed forever
I wonder if I should explain the implications of leaking more
don't just do it to get around the compiler... ?
 
oh ya good link
 
@JohnKugelman the as &str seems unnecessary, since Box::leak already returns &str
 
11:08 PM
@JohnKugelman if you prefer as _
@trentcl needed because collect can't infer &mut str to &str
 
@Stargateur oh oh right
 
maybe this could be remove if compiler become more smart
but this case is rare enough
 
I guess you could do &*Box::leak(...) but that's hardly better
 
they're all ugly >_>
 
@JohnKugelman I mean... you're creating memory leaks
 
11:12 PM
well, box could add a method like leak_mut() and have leak return a const ref
 
hey no pointing fingers
 
but ... the number of time you need it... doesn't deserve a breaking change in std
maybe create a issue for Rust 2.0
 
@JohnKugelman you got me there
 
@E4netisheretodownvote GATs strike again stackoverflow.com/q/61978903/7076153
we don't have a duplicate for that ?
oh wait
there is a trick I think
maybe not...
 

« first day (2048 days earlier)      last day (1444 days later) »