4 ms·
So add mypy to your pre-commit
by reactordev 9mo ago
So add mypy to your pre-commit
- simianwords 9mo agoAll this but none of the performance benefits.
- deleted 9mo ago[deleted]
- shadowgovt 9mo agoIt'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 9mo agoThe point about mypy was it does type checking (static analysis) for your Python code. Not speeding it up.
- Qem 9mo ago> mypy won't make your Python faster Mypyc will do. See https://blog.glyph.im/2022/04/you-should-compile-your-python-and-heres-why.html https://blog.glyph.im/2022/04/you-should-compile-your-python...
- __MatrixMan__ 9mo agoIf 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 9mo agoThis is clearly not what I'm speaking about - there are only a few applications that talk to an LLM.
- reactordev 9mo agoToday…
- __MatrixMan__ 9mo agoThe 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?
- simianwords 9mo agoI was more thinking of python used as general purpose backend language. We can use LLM's to vibecode such languages.
- skeledrew 9mo agoI'd say most of us who prefer Python (a pretty significant number given it's the most popular language out there) don't care that much about performance, as today's machines are pretty fast and the main bottlenecks aren't in the language itself anyway. What we care about is usability/friendliness so we ourselves can iterate quickly.
- alex_suzuki 9mo agoOr ty: https://astral.sh/blog/ty https://astral.sh/blog/ty
- reactordev 9mo agoDamn… ok, I’ll try it