Skip to content

Instantly share code, notes, and snippets.

View fef1312's full-sized avatar
🥺

anna fef1312

🥺
View GitHub Profile
@fef1312
fef1312 / validate.rs
Created December 7, 2022 17:31
the thing where rustc does the thing
struct Valid<T>(T);
trait Validate: Sized {
fn validate(self) -> Result<Valid<Self>, Error>;
}
struct Error {
msg: String,
}
@fef1312
fef1312 / transparent_language_design.md
Last active July 27, 2020 14:50
A little essay on why C++ is the most transparent language on the planet.

On the Virtue of Transparent Language Design

The motivation for writing this comes from this interview with Bjarne Stroustrup which, even though unfortunately being fake, makes a good point and I found quite entertaining to read.

Consider this example code in C++ (You can assume vec3 is a class):

int main(int argc, char **argv)