2 ms·
Go is pretty miserable for dealing with JSON compared to Python
by UltraSane 1y ago
Go is pretty miserable for dealing with JSON compared to Python
- Zambyte 1y agoInteresting, Go is actually a language I tend to reach for when dealing with JSON.
- abound 1y agoI feel the same way, but to defend GP, if you're dealing with unknown JSON, the experience of deserializing `any` (or `map[string]any` if you know the top-level entity is an object) can be extremely tedious. For things like structured API requests/responses, Go's struct tags are basically exactly how I want my JSON ser/de to look.
- maxwellg 1y agoIt looks like there are a few Golang implementations of MCP. The one used in the article doesn't use tags but mcp-golang does. Tags are great! I love tags. - https://github.com/metoro-io/mcp-golang https://github.com/metoro-io/mcp-golang
- worldsayshi 1y agoI like Go, but Typescript/Javascript really seem like the ideal languages for dealing with JSON.
- haolez 1y agoWell, the JS in the name is for JavaScript :)
- worldsayshi 1y agoYeah, although I'm surprised that not more languages have designed data interaction to be more JSON like. In JS it just feels like I'm interacting with JSON directly. Most other languages have some layer of "weirdness"/indirection between the language runtime and the data. Like in Go I have to define field names twice. Once for the Go field and once for the field name in the actual JSON structure. Not even Python allows for copy-paste-able json. I have to do a bunch of syntax corrections for it to work.
- deleted 1y ago[deleted]
- pjmlp 1y agoIt applies to most stuff not only dealing with JSON, but it got lucky being tied to Docker and Kubernetes adoption and everything else that sprung out their ecosystem, so here we are.