Just recently I heard that typed languages are best for agentic programming
So add mypy to your pre-commit
Anthropic invests $1.5M in the Python Software Foundation
41–50 of 192 posts
Re: Anthropic invests $1.5M in the Python Software Foundation
#42Earlier quoted context omitted.
AFAICT Python basically is a [statically-]typed language nowadays. Most people are using MyPy or an alternative typechecker, and the community frowns on those who aren’t.
It's a pretty nice best-of-both-worlds arrangement. The type information is there, but the program still runs without it (unless one is doing something really fancy, since it does actually make a runtime construct that can be introspected; some ORMs use the static type data to figure out database-to-object bindings). So you can go without types for prototyping, and then when you're happy with your prototype you can l…
It’s also a worst-of-both-worlds arrangement, in that you have to do the extra work to satisfy the type checker but don’t get the benefits of a compiled language in terms of performance and ease-of-deployment, and only partial benefits in terms of correctness (because the type system is unsound).
AFAIK the Dart team felt this way about optional typing in Dart 1.x, which is why they changed to sound static typing for Dart 2.
Re: Anthropic invests $1.5M in the Python Software Foundation
#43Re: Anthropic invests $1.5M in the Python Software Foundation
#44Re: Anthropic invests $1.5M in the Python Software Foundation
#45Earlier quoted context omitted.
AFAICT Python basically is a [statically-]typed language nowadays. Most people are using MyPy or an alternative typechecker, and the community frowns on those who aren’t.
> Most people are using MyPy or an alternative typechecker, and the community frowns on those who aren’t. That's not like a widespread/by-default/de-facto standard across the ecosystem, by a wide margin. Browse popular/trending Python repositories and GitHub sometime and I guess you can see. Most of the AI stuff released is still basically using conda or pip for dependencies, more times than not, they don't even shar…
If you're working on a project that doesn't use type hints, there's also plenty of frowning, but that's just because coding without a type checker is kind of painful.
Re: Anthropic invests $1.5M in the Python Software Foundation
#46Earlier quoted context omitted.
I don’t get this argument because if we put the effort to get it typed, we don’t get one of the best benefits - performance.
But that's not the argument here. Python type hints allow checking correctness statically, which is what matters for agents.
Re: Anthropic invests $1.5M in the Python Software Foundation
#47Re: Anthropic invests $1.5M in the Python Software Foundation
#48Re: Anthropic invests $1.5M in the Python Software Foundation
#49Earlier quoted context omitted.
> Most people are using MyPy or an alternative typechecker, and the community frowns on those who aren’t. That's not like a widespread/by-default/de-facto standard across the ecosystem, by a wide margin. Browse popular/trending Python repositories and GitHub sometime and I guess you can see. Most of the AI stuff released is still basically using conda or pip for dependencies, more times than not, they don't even shar…
Generally you only get frowned at if you're not using type hints while contributing to a project whose coding standards say "we use type hints here." If you're working on a project that doesn't use type hints, there's also plenty of frowning, but that's just because coding without a type checker is kind of painful.
Yeah, that obviously makes sense, not following the code guidelines of a project should be frowned upon.
Re: Anthropic invests $1.5M in the Python Software Foundation
#50Earlier quoted context omitted.
So add mypy to your pre-commit
All this but none of the performance benefits.