Been looking to get into technical writing, and Gleam inspired me! Let me know what you think ๐
https://dev.to/bitcrshr/binary-data-in-gleam-implementing-the-rcon-protocol-2684
1 messages ยท Page 1 of 1 (latest)
Been looking to get into technical writing, and Gleam inspired me! Let me know what you think ๐
https://dev.to/bitcrshr/binary-data-in-gleam-implementing-the-rcon-protocol-2684
Neat! Are you planning to release it as a package?
Nice article! I think you can use rust syntax highlighting to get pretty decent Gleam highlighting too
definitely! hoping to get it out this weekend or next ๐
oH! iโll give it a shot, thanks!!
Oooh part 2 sounds exciting
that will probably come along once the package is done ๐
this is super cool, thanks for sharing! are you using / planning to use mug? or FFI out to erlang?
just using mug for now, may ffi out to erlang if needed (todo: learn erlang)
you could use this syntax too:
<<
packet.size:32-little,
packet.id:32-little,
packet.typ:32-little,
packet.body:bits,
0,
0,
>>
and depending on your usecase, it may be nice to have custom error types, or at least some info about the incorrect value in the error message, like n -> Error("type must be 3, 2, or 0 but was: " <> int.to_string(n))
something along the lines of:
pub type ParsingError {
InvalidPadding(actual: BitArray)
InvalidType(actual: Int)
InvalidPacketFormat(actual: BitArray)
InvalidPacketSize(actual: Int)
}
anyway, really good article, i really struggled quite a bit with this stuff when i got started ๐
ah, thatโs a good point, I didnโt think to match like that! iโll change that.
re: errors yea there will certainly be error types when the package comes around (soon!)
Here's the repo for this, hoping to get this fleshed out this week! https://github.com/bitcrshr/glame
uh, you imported a package just to type duration.seconds(5) |> duration.blur_to(duration.MilliSecond) instead of 5000? ๐
okay if we're being honest here it's very late and my brain is giving out, will polish it with fresh eyes tomorrow lmaoo
i am not known for polishing things before putting them in github
yeesh!
but i finally got my property testing working, so i'm happy ๐
gonna get some sleep and then think about how on earth i can protect against all those int overflows...
godspeed