| ▲ | ACCount37 3 hours ago |
| Rarely. Most tinkering tasks just don't have enough heavy duty computation in them to as much as strain a modern CPU. And most of the rest are covered by packages like numpy or pytorch. For the rare exceptions, I make a C lib and call into it to get my numbers crunched. I get that Zig is a viable replacement for C there. But I don't see it replacing Python. |
|
| ▲ | archargelod an hour ago | parent | next [-] |
| > For the rare exceptions, I make a C lib The problem is that most people using Python don't have enough expertise in C to do the same. It also kinda destroys the argument that Python is good if your solution for performance is to use a different language alongside it. |
| |
| ▲ | itishappy 29 minutes ago | parent [-] | | The argument is that the ergonomics of using Python are worth the squeeze of learning two languages. Are the ergonomics of using Zig really enough to justify replacing Python on the happy path, or would it end up replacing just C? |
|
|
| ▲ | lenkite an hour ago | parent | prev | next [-] |
| Even if you are fine with Python's speed, its memory consumption DOES effect things and can be an extraordinary pain when you need to fit the result of your tinkering in any sort of constrained environment. |
| |
| ▲ | maccard 31 minutes ago | parent [-] | | By the time I’m memory constrained even on my laptop the processing cost of whatever I’m doing has gone beyond shoving it in the first scripting language I can find. Every device I write code on has at least 16GB RAM - most of them are 64 or 128 |
|
|
| ▲ | p-e-w 3 hours ago | parent | prev | next [-] |
| Not to mention that where heavy computation is required, Python often has libraries that are much, much faster than anything you can quickly hack together in C or Zig. |
| |
| ▲ | maleldil 3 hours ago | parent | next [-] | | As long as you can express everything you need on the library's terms. As soon as you write a Python loop, your performance plummets. | |
| ▲ | bluecalm 2 hours ago | parent | prev [-] | | Only if you doing something thousands of people has done before.
Anything new, even very simple and you are on your own and Python is 100x slower than naive C implementation on many tasks. Last little project I remember is writing a solver for a puzzle game my friend published. Python just doesn't work at all for such tasks. I think you are wrong about speed of those libraries as well. In my experience naive code designed for a specific task beats highly sophisticated general code and it doesn't take a rocket scientist to get huge speed-ups over some well established fast library. |
|
|
| ▲ | miki123211 2 hours ago | parent | prev [-] |
| And if you really need more performance (or, more often, fast startup times), Go gives you 90% of the speed with 30% of the effort. Rust if you really want to squeeze everything that can possibly be squeezed of that CPU. |
| |
| ▲ | pmarreck 32 minutes ago | parent [-] | | that’s not what the benchmarks say about Go, and based on multiple reports, Rust does not scale well into large codebases, which eventually become brittle and very difficult to change Zig is a return to “no magical effects,” except with reasonable safety | | |
| ▲ | kibwen 2 minutes ago | parent | next [-] | | > based on multiple reports These reports are smoking crack. Rust scales gloriously well into large codebases, and it especially shines when it comes to making major refactorings. Please don't bother speaking about things that you don't understand. | |
| ▲ | Synthetic7346 21 minutes ago | parent | prev [-] | | Link to said benchmarks? |
|
|