414 karma · joined March 11, 2021
It’s just so damn useful and I’m not sure what the downside is, it sucks when you have to keep coming up with different names so you can keep around an identifier that you don’t need anymore.
mkdir -p ~/cargo/target
export CARGO_TARGET_DIR="~/cargo/target"
I was seriously looking at Zig, but I'm always getting faster in Rust and it feels like the downsides of extra complexity is well worth the upsides for larger projects.
Pretty good machine learning experience on M1.
varFoo, err := GetFoo()
if err != nil {
return err
}Can be written as:
varFoo := GetFoo()?
Just like Rust, everyone would stop complaining about Go error handling. But they have this absolutist position on syntactic sugar, even for something like this that would make the language that much nicer to look at and work with.
valgrind target/debug/rustbinary
==10173== HEAP SUMMARY:
==10173== in use at exit: 854,740 bytes in 175 blocks
==10173== total heap usage: 2,046 allocs, 1,871 frees, 3,072,309 bytes allocated
==10173==
==10173== LEAK SUMMARY:
==10173== definitely lost: 0 bytes in 0 blocks
==10173== indirectly lost: 0 bytes in 0 blocks
==10173== possibly lost: 1,175 bytes in 21 blocks
==10173== still reachable: 853,565 bytes in 154 blocks
==10173== suppressed: 0 bytes in 0 blocks
==10173== Rerun with --leak-check=full to see details of leaked memory
valgrind --tool=cachegrind target/debug/rustbinary
==146711==
==146711== I refs: 1,054,791,445
==146711== I1 misses: 11,038,023
==146711== LLi misses: 62,896
==146711== I1 miss rate: 1.05%
==146711== LLi miss rate: 0.01%
==146711==
==146711== D refs: 793,113,817 (368,907,959 rd + 424,205,858 wr)
==146711== D1 misses: 757,883 ( 535,230 rd + 222,653 wr)
==146711== LLd misses: 119,285 ( 49,251 rd + 70,034 wr)
==146711== D1 miss rate: 0.1% ( 0.1% + 0.1% )
==146711== LLd miss rate: 0.0% ( 0.0% + 0.0% )
==146711==
==146711== LL refs: 11,795,906 ( 11,573,253 rd + 222,653 wr)
==146711== LL misses: 182,181 ( 112,147 rd + 70,034 wr)
==146711== LL miss rate: 0.0% ( 0.0% + 0.0% )