trying something a little more adventurous with Rust: yet another version of my dns-trie
adventurous because it will need a little bit of unsafe{} to be competitive with the C version
2
5
currently trying to work out how to do this in stable rust: there is Vec::from_raw_parts()
BUT NOT Vec::into_raw_parts() π
2
1
hmm actually i want slice::from_raw_parts
which avoids having to worry about the compiler implicitly dropping the vec when i donβt want it to
1
ugh, having moaned at length about if{}else{} being so much more bulky than ?:
i will now moan at length about how a missing ; is so much more tricky than a return keyword
2
1
actually when to ; and when not to ; in Rust is still in that category of annoying trivia where i understand the rules but i have not yet programmed my fingers to play along
irritating π€
1
2
ugh i want my std::ops::Index::index() method to return Option<&T> not &Option<T>
my data structure either stores T or not, the option is implicit, and i canβt return a ref to something that doesnβ exist
1
itβs a data structure so it needs a fuzzer and a test oracle
iβve written a BmpVec for small bitmap-compressed vectors
now iβm writing a BlimpVec which is not compressed and doesnβt have unsafe code
1
1
while iβm getting this fuzzer going, i would be very grateful if any rustaceans could express an opinion on my unsafe code - the important functions are from_cooked_parts() and as_cooked_parts()
dotat.at/cgi/git/dnstrie.gitβ¦
4
I would worry that as_cooked_parts could explode if I construct a bmpvec from raw parts which are not heap allocated. You need to document the invariants which the unsafe methods rely on
May 13, 2021 Β· 5:16 PM UTC
1

