Open dgryski opened 8 years ago
(Sorry for the delay.)
It does seem silly to not have some reusable network. I wonder if the network really needs to be special, or if it's a common instance of a need for reusable modules. Is 2PC's need for a network different than X's need for a 2PC component?
I would assume the basic API for a network would be the same, and you might want parameters for maximum delay / packet loss.
A reusable module would also work. My thought for making it a language builtin would only make sense if it turned out we wanted to use it in with special syntax.
A reusable module would also work. My thought for making it a language builtin would only make sense if it turned out we wanted to use it in with special syntax.
Even then, we might want a regular module with unpleasant syntax, plus some black magic baked into the compiler for syntactic sugar.
Slightly relevant: Backpack proposal for Haskell https://github.com/ghc-proposals/ghc-proposals/pull/5
Most people modelling distributed systems are going to want to have some sort of communication channel. Already in the raft and bookkeeper specification, there's a
network
set, with thesendMessage
primitive, some code for dropping messages, and thehandleMessage()
main loop.As I was starting to model https://en.wikipedia.org/wiki/Two-phase_commit_protocol , I realized I was going to want these exact same routines so my Coordinator could talk to the Cohorts.
Should this type be somehow integrated into the main language to allow these sorts of models to be created more easily?
(Promela, for example, based on https://en.wikipedia.org/wiki/Communicating_sequential_processes , has a channel type http://spinroot.com/spin/Man/chan.html )