Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

clojure.spec is not a type system. Still, my point is, just using a typed language won't remove the need for contracts, you would still need to roll up something like Nubank did even if it means using MyPy reflection features.

For example, imagine you have two services that communicates through a message queue. Service A produces X as a string, but Service B consumes X as an integer. You can type that, both services would compile, but it would break as soon as you tried to consume that message. And yes, you can build something using MyPy reflection or whatever, but you have to build it anyway.



Hm? Give the message a type. Service A or B would fail to compile, depending on whether the static type of X is a string or an integer.


AFAIK, kafka messages doesn't have "types", and even if they did, you would be relying on an external system, not your type system. If you are not convinced, test it by yourself, create two services and a kafka topic and produce a message from one service to another with different types on each service.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: