Remix.run Logo
reactordev 3 hours ago

So add mypy to your pre-commit

alex_suzuki 3 hours ago | parent | next [-]

Or ty: https://astral.sh/blog/ty

reactordev an hour ago | parent [-]

Damn… ok, I’ll try it

simianwords 3 hours ago | parent | prev [-]

All this but none of the performance benefits.

__MatrixMan__ 3 hours ago | parent | next [-]

If your code is talking to an LLM, the performance difference between rust and python represents < 0.1% of the time you spend waiting for computers to do stuff. It's just not an important difference.

simianwords 2 hours ago | parent [-]

This is clearly not what I'm speaking about - there are only a few applications that talk to an LLM.

__MatrixMan__ an hour ago | parent | next [-]

The article is about Anthropic's contribution to Python. Pretty much all of their code talks to an LLM.

And just a few comments earlier you said:

> Just recently I heard that typed languages are best for agentic programming

Are we not talking about using python (or some alternative) to constrain the behavior of agents?

reactordev an hour ago | parent | prev [-]

Today…

3 hours ago | parent | prev | next [-]
[deleted]
shadowgovt 3 hours ago | parent | prev [-]

It's true; mypy won't make your Python faster. To get something like that, you'd want to use Common LISP and SBCL; the SBCL compiler can use type assertions to actually throw away code-paths that would verify type expectations at runtime (introducing undefined behavior if you violate the type assertions).

It's pretty great, because you can run it in debug mode where it will assert-fail if your static type assertions are violated, or in optimized mode where those checks (and the code to support multiple types in a variable) go away and instead the program just blows up like a C program with a bad cast does.

reactordev an hour ago | parent [-]

The point about mypy was it does type checking (static analysis) for your Python code. Not speeding it up.