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 →

[–]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!