News for hackers. Stuff that matters.
Re:Linewise translating unit-tested Python to Haskell to com... by koito17 on Sunday July 23, 2023 @07:01PM (#36840858)
TL;DR: The blogger took 4 Python projects, rewrote them in Haskell, and 3 of them had type errors. Therefore unit tests are not replacements for static typing.

---

I don't get how this post says anything about unit testing or static typing at all. Doesn't it just imply that bugs are easier to detect with one method than another method? Most statically typed languages out there have a type system too weak to make the expression 1/0 a compile-time error. But you work around this with linting, unit tests, using a language with a stronger type system, etc.

Re:Linewise translating unit-tested Python to Haskell to com... by l0b0 on Sunday July 23, 2023 @07:07PM (#36840900)
Yeah, as a big unit testing proponent I'd still definitely say they are not a silver bullet. They simply have a good cost-to-confidence-in-code ratio. So do static types, or type annotated code with strict validation.
Re:Linewise translating unit-tested Python to Haskell to com... by AnimalMuppet on Sunday July 23, 2023 @07:18PM (#36841003)
But did they have type errors in Python? Or was the type error introduced by translation?
Re:Linewise translating unit-tested Python to Haskell to com... by efarrer on Monday July 24, 2023 @01:09AM (#36843326)
Hi, I'm the author of the blog post and the paper. Every bug that was caught by the Haskel transition was verified to exist in the original Python. If I couldn't reproduce it in the Python, I fixed my translation. More information on my methodology can be found in the paper. https://drive.google.com/file/d/0B5C1aVVb3qRONVhiNDBiNUw0am8...
Re:Linewise translating unit-tested Python to Haskell to com... by tome on Monday July 24, 2023 @05:00AM (#36844847)
> Doesn't it just imply that bugs are easier to detect with one method than another method?

Yes, but then how can you say

> I don't get how this post says anything about unit testing or static typing at all.

It does say something about unit testing and static typing!