3 ms·
Not total pain, but certainly loses in convenience to python. Deserializing large and arbitrary JSON inputs is trivial with python's `json.loads()`. Element acc
by bostik 11y ago
Not total pain, but certainly loses in convenience to python. Deserializing large and arbitrary JSON inputs is trivial with python's `json.loads()`. Element access rules have no dark corners (as long as you don't have pickled data in there).
In contrast, Go and its `json.Unmarshal()` aren't that well suited for parsing arbitrary and/or complex inputs. However, if the expected input is well formed and can be directly mapped to a predefined datastructure, the convenience factor is pretty high.
So, from my limited experience, I would say that JSON parsing in golang is more geared towards deserialising well defined transport formats than ingesting arbitrary inputs.
- lowmagnet 11y ago> In contrast, Go and its `json.Unmarshal()` aren't that well suited for parsing arbitrary and/or complex inputs. However, if the expected input is well formed and can be directly mapped to a predefined datastructure, the convenience factor is pretty high. I think go revolves more around well-defined structures, and JSON is anything but. For inter-process pipelines, protobuf (polyglot) and gob (go-only) work better in my experience.