Console? good, GUI? good, game dev? use Godot engine with its similar language Gdscript, but what else? Ive been seeing AI, Data Science stuff, but whats the point if ita slow?
People who say “Python is slow” are generally wrong, yes, the language is slower then C in basically everything and it also almost always doesn’t matter.
The bottleneck in a console app is not your applications ability to process, it’s your ability to read and type, you will have the same experience in any language.
The same is true with GUI apps, python GUI apps are generally just bindings to toolkits written in other languages like pyqt is a python wrapper around a C++ toolkit.
In actual gamedev, something like Pygame is using SDL which is a C library.
YouTube is a python web app.
Yes, python is slow, and generally it doesn’t matter, if it’s slow then it’s usually a PEBCAK problem. Python is primarily used as an easy to write language that is gluing together more complicated things written in faster languages.
Like bash, but readable by humans!
Who cares if the program takes ten seconds to run instead of one when it only needs to run once and coding it in Python takes a few hours instead of a day or two in C?
If you need performance that badly, by all means, use C. If you have ten ideas for simple programs and just want to code them real quick without fighting the compiler and worrying about all the little shit that C demands from you, then there’s nothing wrong with using Python.
Everything in life is a tradeoff. Use the right tool for the job.
In my experience, GUI was horrible because of the GIL. Python is nice because you can write and read it quickly, and packages like numpy allow you to use very natural syntax. Most of the numerical packages wrap C/C++/Fortran binaries which are very optimized. You just have to keep in mind not to do that kind of stuff directly in Python, write tight loops, etc.
By the time you finish your C script, compile it and run, Python developer will already have finished. Speed is relative.
What’s the point of anything? I have all these Electron apps on my devices which require Gigabytes of memory, Discord took a substantial amount of RAM my old laptop had. There’s Android apps which are hundreds and hundreds of megabytes and all they do is call some REST APIs. Lemmy’s protocol is terribly inefficient. And back in the day in the 90s an entire office suite fit on a bunch of floppy disks. And a 0.025 GHz CPU was all it took to run it… The internet was so much more efficient, you do your online banking, chat, read the news (without a lot of images) with 0.1% of today’s internet connections.
Because it is easier to read large codebases of Python than large codebases of Bash.
When used for much of the fancier stuff, like AI, it’s not running in python. Python is just setting up all the other stuff and making the calls to shove the models onto the GPU and configure and blah blah… You’re just writing the program that uses the ML libraries that make other types of programming do the real work, like CUDA or the other one I forgot the name of, or even Vulkan, or what have you.
So while Python is slow, things written in it do not have to be slow.
Similar to Godot’s language. It’s terribly inefficient, but it’s meant mostly to respond to human time scale events, not to have complex computation-heavy systems written up in it. And similar to Python with AI tools and whatnot, Godot’s graphics side is still running hot and fast in the GPU with dx/vulcan even while the language the UI and game logic is written in is inefficient.
“Similar to Godot’s language. It’s terribly inefficient”
Don’t know what you mean, but Godot app is only around 3mb, and it’s not as bloated as Python, though it has some high level layers or somthing too, and not as direct as C++.
They mean scripting, GDscript is also interpreted (and probably also not often parallelized) so it’s also not blazing fast (though I guess typing helps).
Though Godot has many options for languages (including bindings), so compiled is an option (you don’t have to go all in on one language either, so something like a generator or multiplayer code etc needing more performance can use a more capable language).
define slow.
my life has been in C style languages but even i kniw python us a great general purpose language. are you going to use it for high frequency trading? no but most things dont need that speed.
yes its used a lot in ai but also for a ton of linuc scripting. i dont think anyone uses perl anymore.
so in what way was it slow when you used it? what micro seconds were you lookong for?
Python is slow enough to notice in fairly normal usage. Just doing lookups into a dict with thousands of entries, for example, will lead you to researching how to sort and index it.
Python’s great as an interface to C which gives it the illusion of performing well.
Yeah, want to take a bet on how long a single lookup in a dict with 5,000 entries takes on my machine?
How to sort and index it
It’s a hash table. Can you explain why “sorting and indexing” would improve performance?
You’re talking out your arse.
You’re talking out your arse.
And honestly - what do you expect for a response with a shitty attack like that? Do you need to be a dick?
I wrote a console tictactoe game with primitive AI opponent using both Python and C++ and python takes more time in the background process before making a move than in C++.
Yeah, computationally intensive stuff is going to be slow when implemented in Python. You will find lots of data science libraries for Python that do computationally intensive stuff, but they’re then generally implemented in C/C++ or Rust, with only a thin API layer written in Python.


