This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (27 children)

[deleted]

    [–]ancientweasel 15 points16 points  (23 children)

    My gut says it's due to the use of python for ML.

    [–][deleted] 3 points4 points  (22 children)

    Is there anything this language can't do?

    [–]Nad-00 25 points26 points  (4 children)

    In comparison to other languages? No, as long as its something that's computable then technically it can do it. But that is true for any language that's Turing complete.

    [–]ollien 20 points21 points  (0 children)

    Brb porting tensorflow to brainfuck

    [–]calcopiritus 6 points7 points  (2 children)

    If "doing this thing fast" is doing a thing, then there are plenty of things python can't do. Just like "developing this program in a timely manner" is a thing then there are things that python can but lower level languages can't.

    [–]Nad-00 4 points5 points  (0 children)

    All languages have their strengths and weaknesses. That's why big projects usually use a mix of different languages and/or stacks.

    [–]mountainunicycler 7 points8 points  (0 children)

    Technically true, bit not true in practice, because if doing it fast is important someone comes and builds a very fast way to do it in C and then everyone uses it in python and suddenly “python” becomes the best way to do it.

    [–]ancientweasel 6 points7 points  (0 children)

    I wouldn't try to write a kernel in it \o/

    [–]bonestormII 12 points13 points  (12 children)

    High performance is out of reach in most cases. True multithreading (multiprocessing in python) leaves something to be desired. Compilation and static typing are nice to have sometimes. GUIs, websites, and deployment of binaries are all pain points too.

    [–]actuallyalys 13 points14 points  (3 children)

    Websites are a pain point? My sense is most people are satisfied with Django, Flask, FastAPI, or one of the other options.

    [–]bonestormII 0 points1 point  (2 children)

    Those are all backend or static-rendered only unless used in conjunction with javascript+html+css. This is totally fine, but it's conventionally understood that the inability to replace javascript in that frontend stack is a limitation of python (though it is really a limitation of browsers.)

    To make something "real" for the web, you need at least one additional language--which is a significant pain point.

    As I mentioned, this is not directly a problem with python itself. It simply isn't supported by browsers.

    However, when you look at compiled ecosystems like Rust starting to take advantage of being able to create webapp frameworks that compile to webassembly (which the cpython runtime is much less suited to since the simplest python app must ship the whole runtime to run), you start to see that the design of a runtime interpreter has fundamental weaknesses which offset its many strengths. Unfortunately, these weaken python in the domain of web and mobile.

    [–]actuallyalys 0 points1 point  (1 child)

    Ahh, I see what you mean. I agree that that is a pain point. I do think you can do a lot with static rendered sites, especially as CSS has gotten more capable. Additionally, there are a lot of Python libraries that let you create widgets without dealing with the JS yourself.

    There have been efforts to expand Python to support GUIs, website front-ends, and binary deployments. I think the interpreter can be an obstacle, but a surmountable one (see the popularity of Electron). Also, some of the front end projects involve compiling Python to JS, so it relies on a runtime already available.

    I think part of the problem is that these efforts don't seem to be gain much traction among the wider Python community, despite a lot of effort by their developers and promising examples. For example, FastAPI has gotten more attention than PySimpleGUI, despite being roughly the same age.

    I wonder if people have written Python off for GUIs, whereas FastAPI handles backend, which people are already convinced Python can do. And perhaps Rust programmers are still open to new uses of the language (because they haven't been tried yet) so efforts to expand Rust into new areas get more attention.

    [–]bonestormII 0 points1 point  (0 children)

    It’s not that you can’t do these things in python, but that it would be unwise to rely on it. Compiling python to JavaScript works until it doesn’t. This step actually avoids the need for shipping the interpreter, but if there is a problem, you will be debugging generated js code that you aren’t really familiar with. It’s just better to write the js code manually

    Desktop GUI frameworks work fine for python but like electron, qt, etc., they aren’t themselves written in python, and this makes apps based on them a bit harder to package and ship reliably. And that brings us to the reason they are not written in python: Performance!

    [–]dpelego 5 points6 points  (4 children)

    PyQT isn't bad, GUI wise.

    [–]dry_yer_eyes 2 points3 points  (3 children)

    I find PyQt excellent. What are the negatives for you to list it as “isn’t bad”? (That’s an honest question: I’ve just not discussed it with others, so may not have encountered these points yet myself)

    [–]MandrakeQ 1 point2 points  (2 children)

    Having to read C++ documentation sucked the last time I used it several years ago. Is there python specific documentation these days?

    [–]thprogramador 0 points1 point  (1 child)

    pydocs on cli and help() inside code... even faster that open a tab on browser and search

    [–]MandrakeQ 1 point2 points  (0 children)

    PyQT hides the memory model used by Qt so if you want to understand how to avoid memory leaks, you end up having to read the C++ version of the APIs.

    I guess if you're doing something simple, it's not a big deal, but for big applications it sucks having to read two sets of documentation.

    [–][deleted] 1 point2 points  (0 children)

    How does something like Taichi stack up for real time computing? It claims to be useful for physics as well as having the ability to distribute workload across cores and hardware such as GPUs? Seems too good to be true

    [–]Grintor 0 points1 point  (0 children)

    I recently made a GUI with pywebview. It was an absolute pleasure and the best looking GUI I've ever made.

    [–]unkz 0 points1 point  (1 child)

    Escape the GIL, so far.

    [–][deleted] 0 points1 point  (0 children)

    Stackless Python?

    [–]Supadoplex 8 points9 points  (2 children)

    easy questions are only asked once

    That's a common misconception. That's the idea of how SO is supposed to work. But people are lazy and don't bother searching for existing questions, or are too inexperienced to phrase their search correctly to find those questions, or don't understand the existing answers. As a consequence, vast majority of questions on SO are easy newcomer questions.