Hacker News new | ask | show | jobs
by fajpunk 3395 days ago
Thanks for the write up! In the beginning you mention that you ran into some bugs in the Python version that would have been caught by the Haskell type checker. Can you go into more detail about what those bugs were?
2 comments

The most serious one is that we were submitting jobs (as json) that were missing a few metadata fields. In Python we passed around dictionaries, and even though we had json schema validation in place, this slipped through. In Haskell, we define a record type and the corresponding serializers. It is more code, but what you get is that invalid data cannot exist at runtime: it simply cannot be represented.

Also, a compiler refuses to compile your code if you make a typo in a field name.

I'm wondering if integrating MyPy into the build, or even using Cython for performance, could have helped.
We do actually use Mypy! I wrote about my experience with it here:

https://www.reddit.com/r/programming/comments/5x3hdd/channab...