Dev Diary 13/10/2018 and 14/10/2018
Spent a lot of time fighting the compiler and my own traits. I got pretty frustrated, it has taken me ages to write a tiny amount of low-quality code for the metadata implementation. But I think I figured out why: I've misunderstood serde. I wrote a serde-like crate where the supported data model is exactly that of ssb. But the serde data model isn't about json/cbor/whatever, it really is about the rust type system. Data format specific stuff can be done by the Deserializer/Serializer implementations (and most importantly their error type). This was why writing code with my custom traits was so painful - they simply didn't map to the rust types I tried to (de)serialize.
The moment I realized this, I went from having to force myself to do more rust implementation work to actually looking forward to it. But I'm done for the weekend.
Other things:
- turned spec into html, adding ids to get something linkable from the rust implementation: https://github.com/sunrise-choir/spec/blob/master/index.html
- still need a URL
- signature decoding: https://github.com/ssbrs/ssb-multiformats/commit/3ea18acd8a51fe9d559f2758e961a67c3d9d1ac7
- unicode stuff: https://github.com/tormol/encode_unicode/pull/7
I can already feel this dev diary declining...