From 5c542bb09e51eeb407a59f5bd4a2c6c460863446 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Apr 2017 12:01:20 -0400 Subject: switch wire message seralization to use protocol buffers This way it's not tied to details of the haskell binary library, and implementations in other languages should be fairly simple to do. The haskell protobuf library was used because it does not need extra tooling or build steps. So I didn't write a .proto file, but one could fairly easily be written by following ProtocolBuffers.hs and translating it. ProtocolBuffers.hs is *extremely* repetative and tedious code. Surely there must be a way to not need to write all of that? Oh well, I wrote it.. Sizes of serialized messages: ">>> debug-me session started": 121 sending a single key press: 169 This seems equally as efficient as the binary serialization was; that was 165 bytes before elapsedTime was added. This commit was sponsored by Ethan Aubin. --- Log.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Log.hs') diff --git a/Log.hs b/Log.hs index ffb4eb7..ecf0614 100644 --- a/Log.hs +++ b/Log.hs @@ -5,7 +5,7 @@ module Log where import Types import Hash import Memory -import Serialization +import JSON import Data.Char import Data.Time.Clock.POSIX -- cgit v1.2.3