Profile for hikari

Header for hikari
Avatar for hikari
Display name
hikari 🌟 (fell out of the sky)
Username
@hikari@noyu.me
Role
admin

About hikari

Bio

from another world; magical girls on the internet, gpu programmers, musicians, sky enthusiasts, etc; EN/SV/DE/日本語

Stats

Joined
Posts
16689
Followed by
1483
Following
198

Recent posts

FSF may do a lot of harm to the open-source movement at times, but their insistence on copylefting everything lets me legally extract certain critical binaries from otherwise-proprietary systems and avoid ungodly amounts of effort, so, it’s impossible to say if they’re bad or not

Open thread at this post

I don’t know who needs to hear this, but

trait FooBar: Any {
  fn as_any(&self) -> &dyn Any {
    &self as &dyn Any
  }
}

sadly will not work, no matter how many apostrophes you add. you also can’t just call .downcast_ref() on a FooBar.

previously, when having to do this, i just gave up.

but it turns out there’s a practical workaround:

trait FooBar: Any {}
pub trait AnyFooBar {
    fn as_any<'a>(&'a self) -> &'a (dyn std::any::Any + 'static);
}   
impl<T: FooBar> AnyFooBar for T {
    fn as_any<'a>(&'a self) -> &'a (dyn std::any::Any + 'static) {
        &*self
    }   
}

I hope this helps avoid suffering for someone else!

Open thread at this post

i will stab the next person who tells me that there are hard and soft sciences and the distinction is whether you can empirically verify propositions. every scientific field has some degree of unfalsifiability lurking within it. i may or may not just be bitter because my degree is in linguistics which is supposedly a soft science, and so many STEM-bros do not realise that we too have experimentally verifiable propositions. it’s easier to prove various facts about language development than it is to prove your pharmaceutical works

Open thread at this post