frenetic-lang / frenetic

The Frenetic Programming Language and Runtime System
http://www.frenetic-lang.org/
Other
223 stars 52 forks source link

Switch from Openflow 1.0 to 1.3 #477

Open silvia-anderson opened 8 years ago

silvia-anderson commented 8 years ago
craig-riecke commented 8 years ago

So I'm running into a bunch of type safety issues using IPC with Sockets/Pipes. The problem child is Reader.read_marshall which blindly tries to unmarshall an Ocaml variable, and if the types are not present or unexpected in the catching code, it just segfaults. This is bad, and caused Issue #483 as well.

In an issue I opened with Jane Street, they're response was read_marshall is just an overall bad idea https://github.com/janestreet/async_unix/issues/11, and suggested using bin_prot instead. This is now looking like a good idea. The problem is the IPC protocols we've built have little or no documentation, and this would force us to document them.

craig-riecke commented 8 years ago

Well scratch that. Using bin_prot quickly descended into static checking hell - basically having to add [@@deriving bin_prot] into every type in Frenetic. It wasn't bad until we hit the opaque types that Frenetic punts on - in particular Packet In and Packet Out which take packet data. These are of type Cstruct.t and you can't apply bin_prot to that type because you end up creating type aliases for all the subtypes, and end up with a shadow type system for all of Cstruct. Yuck.

craig-riecke commented 7 years ago

Pull request #512 established plugin architecture. So now the only thing that's left is: