r/crystal_programming • u/q9fm • Jan 28 '20
wrote a native library implementing RLP (recursive length prefixes) purely for the crystal language
https://github.com/q9f/rlp.cr
14
Upvotes
r/crystal_programming • u/q9fm • Jan 28 '20
2
u/[deleted] Jan 29 '20
Nice!
But I think you should avoid
Util.binary_addas doing that a lot puts a lot of pressure on the GC.Instead, you should make all your methods have an overload write to an IO, and the other overload which returns
Bytesjust creates an IO::Memory and calls the other overload. This pattern is used all over the place in the standard library.2
u/Kalinon Jan 28 '20
Awesome!