News for hackers. Stuff that matters.
Re:Statically-typed error handling in Python using Mypy by mixmastamyk on Sunday December 08, 2019 @05:20PM (#21738807)
There aren't any mainstream languages that have the ability to detect the ultra high-level errors you describe. Maybe typescript is getting better.

Pyflakes and unit tests will detect the great majority of potential errors. Mypy gets you closer to zero.

Re:Statically-typed error handling in Python using Mypy by staticassertion on Sunday December 08, 2019 @05:42PM (#21738937)
Rust can express state machines just fine, as well as refinement types (Python can do refinement types too), but yes, I agree that there's room for languages to build more ergonomic but advanced type systems.
Re:Statically-typed error handling in Python using Mypy by yawaramin on Sunday December 08, 2019 @05:52PM (#21739005)
There are very usable, well-supported languages out there right now that do have such type systems. Saying they're out of consideration because they're not mainstream is a circular argument.
Re:Statically-typed error handling in Python using Mypy by coldtea on Sunday December 08, 2019 @07:32PM (#21739543)
>Saying they're out of consideration because they're not mainstream is a circular argument.

No, it's a pragmatic argument. There's no circularity it.

If they're not mainstream, then they're neither "very usable" or "well-supported" to any extend that a mainstream language would be.

Re:Statically-typed error handling in Python using Mypy by yawaramin on Monday December 09, 2019 @09:23PM (#21749036)
Here's the circularity:

- There are no mainstream languages with powerful and convenient type systems

- But there are less mainstream ones

- But I won't use those

- There are no mainstream languages with powerful and convenient type systems

Re:Statically-typed error handling in Python using Mypy by coldtea on Tuesday December 10, 2019 @12:01PM (#21754266)
That's circularity alright, but not as in a "circular argument" though. It's a feedback loop.

That's however a totally legitimate engineering choice.

Engineers picking on a language shouldn't bet on less mainstream incomplete environments with less tooling and libs and options and devs, just so that they can raise them into the mainstream.

That might be a "tragedy of the commons" thing, but it's not an engineering obligation to be an early adopter.

Re:Statically-typed error handling in Python using Mypy by yawaramin on Thursday December 12, 2019 @09:09PM (#21778574)
They're not obligated to by early adopters, but then you hear comments like:

> There aren't any mainstream languages that have the ability to detect the ultra high-level errors you describe.

And it's like, well there are great languages that can do that, but if you restrict yourself to that tiny 'mainstream' subset, you'll never know it.

And moreover I think engineers (or rather, companies) are way too conservative about this stuff–picking 'mainstream' tech can be a touch-and-go proposition at any time. Just because something is mainstream, doesn't mean it's the right choice for your project.

Re:Statically-typed error handling in Python using Mypy by viraptor on Sunday December 08, 2019 @06:43PM (#21739287)
close() is partially handled by any language with scoped resources. There's lots of them.

Injections are handled by any language with taint, although that became less popular. Perl had it. Anything with typed orm also has something similar (for example Esqueleto in Haskell)