Live data from Hacker News

Making Python fast – Adventures with mypyc

blog.meadsteve.dev

91–95 of 95 posts

Re: Making Python fast – Adventures with mypyc

#91
post #83

Earlier quoted context omitted.

I don’t get the struggle with types people have. It’s not hard to use a knife instead of a hammer to cut stuff. What’s the struggle with types, specifically?

Try teaching c++ to a new programmer and you’ll understand the struggles people have with types. You might have forgotten, but you had head scratchers too when you where learning. Everyone has them. I’ve taught people who are absolute geniuses, even they struggled initially. And sure you get over it, just like people can become quite adapt at programming in esoteric languages like brainfuck, but that doesn’t mean the…

Yea types are hard, but I think to write quality software types are really important, almost necessary. I guess starting in a foundation where types are minimal like Python would be good for learning, then adding static typing is just a level of abstraction above that. We have to learn programming gradually though abstractions anyways, so I don’t see a problem there.

Re: Making Python fast – Adventures with mypyc

#92
post #82

Earlier quoted context omitted.

You can configure vscode to fail on typing problems and it will show errors in your editor

So that's an IDE feature rather than a language level feature

Nope, that's a language level feature. Your code will also fail at runtime. The IDE is just turning it on.

Re: Making Python fast – Adventures with mypyc

#93

What's with this fascination with making python fast? It's not supposed to be fast, it's supposed to be simple. If you want speed use a compiled language. Trying to make python fast is like trying to strap a turbocharger to a tricycle.

Python programming is simple because I the programmer have to do less stuff. But also, to a really really crude approximation, some asm that does less stuff is both simpler, and faster, than some asm that does more stuff (depends on what it is I'm doing in particular, but, it's a decent rule of thumb).

But there is a disconnect between Python programming simplicity and Python speed, which stems from the fact that under the hood Python is doing much more than its minimal asm 'spiritual equivalent'.

But in a pure abstract theory sense, it shouldn't "need" to. I don't really care about the intricacies of garbage collection or global interpreter lock or page misses etc - what if I just care about "can I make this nice idea into reality in 10 minutes". The reality is that I'm just barely working with the tip of an iceberg composed of 60+ years of computer abstractions. But who can blame me - I am but a mere mortal.

If we could have a programming language that is both simple for the programmer and simple for the computer, it would be great. It's not that unreasonable that people start from the user experience side - making a simple language faster, by getting rid of unnecessary work - rather than the opposite extreme: making it simpler to come up with optimal machine code whose simplicity withstand contact with hundreds of vestigial appendages that just have to be dealt w bc of computer history (spanning from how to do a syscall to how to make a gui in some particular os)

Re: Making Python fast – Adventures with mypyc

#94
post #92

Earlier quoted context omitted.

So that's an IDE feature rather than a language level feature

Nope, that's a language level feature. Your code will also fail at runtime. The IDE is just turning it on.

I don't think that's how it works. Unless you install a library like typeguard python doesn't do runtime type validation

Re: Making Python fast – Adventures with mypyc

#95

Earlier quoted context omitted.

Python is a bit more dynamic than JS, which makes it uniquely hard to optimize. There is more improvement to be done however and is being done.

Right, but I think we know how to optimise all these things. It's all solved problems.

If it's solved, why is python so slow?
Post reply on HN