<twobitsprite>
Marshal... I was looking for Marshal... but the discussion about QUIC was very interesting :P
<companion_cube>
Marshal isn't suitable for a robust protocol tbh
<companion_cube>
It's decent for prototyping is all
<twobitsprite>
If I encode the type as an int at the beginning of the message?
<twobitsprite>
and yeah, I guess I am just prototyping for now
<discocaml>
<yawaramin> if i was forced to choose a binary protocol i'd go for MessagePack
<discocaml>
<eduardorfs> Marshal + proper checksum is quite reliable and useful for internal communication
<discocaml>
<eduardorfs> also fast
<twobitsprite>
eduardorfs: why is checksum necessary?
<twobitsprite>
TCP has a checksum
<discocaml>
<eduardorfs> TCP checksum is not good enough for this, collisions happens over TCP and a single one will kill your application
<discocaml>
<eduardorfs> SSL checksum is enough tho
<discocaml>
<eduardorfs> also storage checksum is important
<twobitsprite>
ok, checksum might not be a bad idea, I was mostly confused that you emphasized that specifically for Marshal, I was thinking it was a particular problem with Marshal
<discocaml>
<eduardorfs> it's a particular problem for anything that may corrupt your memory
<discocaml>
<eduardorfs> which Marshal may do
<discocaml>
<eduardorfs> bad Marshal leads to Obj.magic
<discocaml>
<yawaramin> or in C terms, casting a `void*` to whatever type you want
<twobitsprite>
what alternatives are immune to this issue?
<discocaml>
<yawaramin> pretty much all of them
<discocaml>
<eduardorfs> yeah, you will be forced to validate the data whenever you receive it
<twobitsprite>
I just want to convert << type creature = Orc | Elf | Dragon | ... >> to an int...
<discocaml>
<eduardorfs> just make a function then
<twobitsprite>
that's what I'm working on, I was just wonding if there was a normal way to do that instead of creating a match case for each type
<discocaml>
<darrenldl> dumb question: when does collision happen in tcp?
<discocaml>
<eduardorfs> whenever you have a couple bit flips, this happens quite a bit if you're exchanging a lot of data, which is the only reason why you should use Marshal
<discocaml>
<eduardorfs> a lot of data, as in gigabits per second
<discocaml>
<yawaramin> well, PPXs are used a lot for serializers/deserializers. there are different PPXs for different formats. JSON, XML, others
<twobitsprite>
darrenldl: when you have a router with 4 fiber WAN ports and 24 CAT5 LAN ports and more packets are coming into the WAN ports than can fit in the target LAN port
<twobitsprite>
or vice versa
<discocaml>
<darrenldl> twobitsprite: yeah but are those observable at tcp level? thats network level collision?
<discocaml>
<darrenldl>
<discocaml>
<darrenldl> not saying it will not impact the performance, but what you get out of tcp layer is still the intended byte stream, however slow, if transmission is successful, no?
<twobitsprite>
spoofed IPs on the local network can break TCP connections
<discocaml>
<darrenldl> well okay, fair enough
<twobitsprite>
this can even happen accidentally, like you have a DHCP server handing out IPs in a range, but you have a legacy server configured with a static IP that happens to be in that range
<twobitsprite>
that's a shit show trying to diagnose, especially if you were hired after that environment was first set up
<discocaml>
<darrenldl> @eduardorfs right fair enough, cheers
<discocaml>
<darrenldl> twobitsprite: yeah okay yep, i can see seq and ack wouldnt fully suffice against that kind of tomfoolery eiher
<twobitsprite>
yeah, imagine you get two response packets with the same ack/seq and the same source IP, wyd? :P
<discocaml>
<darrenldl> : D
<twobitsprite>
a good start to diagnose it is, you can port mirror from the switch and look for RST packets
waleee has quit [Ping timeout: 276 seconds]
bibi_ has quit [Quit: Konversation terminated!]
hannes_ has joined #ocaml
hannes has quit [Ping timeout: 260 seconds]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
pi3ce has quit [Client Quit]
pi3ce has joined #ocaml
tomku has quit [Ping timeout: 248 seconds]
tomku has joined #ocaml
<discocaml>
<nutsnbits_99368> Hi, I'm quite new to the entire functional programming paradigm, and I'm trying to use Ocaml to do some IPv4 CIDR processing
<discocaml>
<nutsnbits_99368> I'm just wondering if this code here is idiomatic FF code, or if I have brought procedural habits with me without knowing
<discocaml>
<nutsnbits_99368> This is supposed to take input such as '127.0.0.0/16' and spit out a range (127.0.0.0, 127.0.255.255) option
<discocaml>
<nutsnbits_99368> any advice at all is welcome, opinionated or not
<discocaml>
<nutsnbits_99368> (oh, and the output is supposed to be in (u32 * u32) option, so that's intended. the u32* functions are just aliases of Stdint.Uint32.*
deadmarshal_ has quit [Ping timeout: 276 seconds]
toastal has joined #ocaml
<discocaml>
<dinosaure> Just to notice you that `ipaddr` exists and it's the purpose of the library 🙂 at least, you should take a look on the code
alexherbo2 has quit [Remote host closed the connection]
mro has quit [Quit: Leaving]
<discocaml>
<yawaramin> suggestion: post code in plain text format instead of screenshots for accessibility 🙂
<discocaml>
<._null._> But then, not in this channel
<discocaml>
<yawaramin> yes, either in #beginners or a paste service
myrkraverk has joined #ocaml
myrkraverk has quit [Remote host closed the connection]
myrkraverk has joined #ocaml
euphores has quit [Quit: Leaving.]
euphores has joined #ocaml
motherfsck has quit [Ping timeout: 264 seconds]
Anarchos has joined #ocaml
Serpent7776 has quit [Ping timeout: 272 seconds]
Harzilein has quit [Ping timeout: 245 seconds]
bartholin has quit [Quit: Leaving]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
waleee has joined #ocaml
Serpent7776 has joined #ocaml
<discocaml>
<trrg5oe11659> Hello.
<discocaml>
<trrg5oe11659> I am a developer with over 8 years of experience.
<discocaml>
<trrg5oe11659> This time, as a startup, I have formed a team with many developers.
<discocaml>
<trrg5oe11659> I think that even developers with a long history of programming cannot know everything.
<discocaml>
<trrg5oe11659> So this time, I have formed a team with developers who are experts in the relevant fields.
<discocaml>
<trrg5oe11659> If you are a client who wants a project, please send me a message.
<discocaml>
<trrg5oe11659> And if you want to use this opportunity to strengthen long-term cooperation with us and earn income, please send me a message.
<discocaml>
<trrg5oe11659> We are happy to accommodate those who demand perfection of the project even if it costs more.
<discocaml>
<trrg5oe11659> We are happy to accommodate those who want to complete the project but are concerned about the low cost. However, we cannot tolerate excessive demands.
<discocaml>
<trrg5oe11659>
<discocaml>
<trrg5oe11659> Thank you.
Anarchos has joined #ocaml
tomku has quit [Ping timeout: 252 seconds]
tomku has joined #ocaml
Tuplanolla has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
bartholin has joined #ocaml
Serpent7776 has quit [Ping timeout: 264 seconds]
bartholin has quit [Quit: Leaving]
motherfsck has joined #ocaml
<discocaml>
<akhilindurti> any ocaml nixpkgs contributors here? wondering if anyone feels like updating ocaml-lsp to 1.19.0. i'd do it myself, but i'm feeling kinda lazy lol
<twobitsprite>
I can't believe none of you suggest Cap'n Proto when I was asking about binary protocols...
<twobitsprite>
it has official ocaml support, uses modules and functors, and is more efficient than things like protobuff, etc
<twobitsprite>
and it's strongly typed
<companion_cube>
Does it have *official* ocaml support?
<companion_cube>
I suggested protobuf because it's 50x more popular than capnproto, and it's more compact (albeit slower to decode, sure)