+ 1
Speeding up Python
Python is often the language of choice for beginners who want to get the feel of programming. I enjoy using it as it is reasonably easy to find errors and get a program to do what I want. However, programs running in C run faster, so it should be the language of choice. Is there an easy way to program in Python and when it works efficiently to compile it as in C to produce a faster result?
2 Respuestas
+ 2
Sadly Python can't be compiled due to its language design. There are some tweaks to make Python a little bit faster but it will still be 10 to 500 times slower than C depending on the workload.
Maybe Rust might be an interesting language for you. Rust tries to be as high-level as possible while still maintaining the speed of low-level languages like C. It's been the most loved programming language for years according to the stackoverflow dev survey and I think this says a lot about it. And I, too, think that Rust is one of best languages ever created for many reasons.
The official website:
https://www.rust-lang.org/
And here's a online course:
https://doc.rust-lang.org/stable/book/