[HN Gopher] A Theory of Composing Protocols (2023)
___________________________________________________________________
A Theory of Composing Protocols (2023)
Author : mpweiher
Score : 47 points
Date : 2024-04-06 17:46 UTC (5 hours ago)
(HTM) web link (programming-journal.org)
(TXT) w3m dump (programming-journal.org)
| haskellandchill wrote:
| I'm interested in how this compares to the coalgebra approach
| like in "Session Coalgebras: A Coalgebraic View on Session Types
| and Communication Protocols"
| (https://arxiv.org/pdf/2011.05712.pdf).
| xg15 wrote:
| This sounds pretty cool. I think there is some kind of gap in
| formal modeling for languages that are interleaved with each
| other. Like, it's more or less straight-forward to describe, say,
| javascript and HTML(5) as ASTs, but things get hairy when you
| embed one language into the other, e.g. HTML attributes that
| contain JavaScript or JavaScript strings that contain HTML. Maybe
| this could help?
| rdtsc wrote:
| > We demonstrate our approach in the practical setting of Erlang,
| with a tool implementing protocol composition that both generates
| Erlang code from a protocol and generates a protocol from Erlang
| code.
|
| That's great. Erlang has gen_statem as a built-in behavior so it
| seems appropriate to use it. Also Joe Armstrong had been talking
| about protocols for the longest time. He would say something like
| "Tell me what's on the wire! Don't give me some C++ API".
|
| [1] https://www.erlang.org/doc/design_principles/statem
| convolvatron wrote:
| I struggle to put it into words - but I think this modern
| notion that we exchange language structs between processes and
| not arbitrary messages has lost something valuable.
|
| edit - I guess true interoperability? agency?
| naasking wrote:
| What would it even mean to accept an arbitrary message? All
| you can do in that case is record and/or forward because the
| contents are unknown.
| convolvatron wrote:
| sorry, message defined as a format, like a tcp header
| that's written down and agreed upon - not message defined
| in some other software system like protobuf with some
| mapping to and from language structures
| discreteevent wrote:
| Protobufs are just structured messages. They don't have
| anything to with language structures per se. They are
| semantically the same as the TCP header that's written
| down and agreed upon.
| convolvatron wrote:
| yes. but as a matter of culture one doesn't write binary
| formats any longer. that's just - silly? and its not as
| if I don't think people should use abstractions to format
| messages.
|
| and as a matter of definition, yes, protobufs are just
| bit strings and a schema definition in a limited type
| language (just like xdr and asn before it).
|
| but again, as a matter of usage, we're only really
| supposed to use them to map to and from structs.
|
| and its not as if this doesn't work, clearly it does. as
| someone who used to do protocol implementation before all
| this, I find unsettling. and I don't know if I'm just
| being predudicial, or if we we are somehow losing
| something by adopting this model as essentially
| mandatory.
|
| I do find it frustrating, that when I do want certain
| binary properties, or I want to encode a cyclic structure
| in a particular way, or use a richer schema. that I have
| to fight upstream to not use protobufs even if they don't
| bring anything except a useless wrapper around a byte
| string I am defining anyways.
___________________________________________________________________
(page generated 2024-04-06 23:00 UTC)