Conversation

Automatically generating a JSON parser from types is such a killer feature I don’t even think that much about until I have to interact with a third-party HTTP API and suddenly have to write reams and reams of code to very carefully ensure the data is the right shape.
6
226
Argh, example based API docs are really frustrating! Examples can be great for explaining stuff, but please give me the actual schema that you’re following! 😬
1
15
Replying to and
I think a lot of the time this kind of thing happens because the language in question does not have a syntax for writing types down. Which is an interesting point: even ignoring the benefits of static typechecking, statically-typed languages come with a schema notation built-in!
1
14
You absolutely *can* have schema languages for dynamically-typed languages—Racket has its contract system, Clojure has core.spec, etc.—but a lot of languages don’t. And the types are still there, but now you don’t have any agreed-upon notation for talking about them!
10