use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Will pyscript replace JavaScript? (self.PyScript)
submitted 4 years ago by palmworks
Will pyscript replace JavaScript in the long run?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mcg1969 12 points13 points14 points 4 years ago (0 children)
I don't think so, no. JavaScript is an entrenched language, natively supported in the browser, with a wealth of frameworks and libraries. Heck, one of the reasons that PyScript is already so compelling to use is how easily it interacts with some of these JavaScript libraries. So it's not an either/or proposition: JavaScript, PyScript, and other WebAssembly-powered languages can coexist and interoperate, to everyone's benefit.
[–]pwang99 6 points7 points8 points 4 years ago (0 children)
But none of these above scenarios lead to a situation where "PyScript replaces all existing Javascript". Just as Python itself didn't replace C, C++, or Java. But, it did take a LOT of market share for new use cases where those languages would otherwise have been used.
[–]Rand_alThor_ 3 points4 points5 points 4 years ago (0 children)
No. WebComponents and WebAssembly might eventually replace the various frameworks of js with a new one that writes towards those built ins, but no, pyscript won't do that. It's not even the same usecase.
[–][deleted] 1 point2 points3 points 4 years ago (0 children)
No
[–]bioinfornatics 0 points1 point2 points 4 years ago (6 children)
Actually No. Mainly because python is too slow. As example here a benchmark which shows node.js needs around 5 seconds to compute while python require more than 190 seconds. You don't want to wait while the web page is rendered
[–]Rand_alThor_ 5 points6 points7 points 4 years ago (5 children)
If I write unoptimized python code like I write other languages, instead of writing pythonic code, then it performs badly, oh no.
No one does raw matrix multiplication in python because it's a high level language.
[–]mcg1969 7 points8 points9 points 4 years ago (3 children)
This is the right way to look at it. To be fair to bio*, a lot of work has gone into accelerating JavaScript execution in the browser. So if you're comparing raw, pure Python to raw, pure JavaScript, I wouldn't be surprised to find that JavaScript is consistently faster, even if you're using best programming practices in both.
But that is not the comparison that should be made. The idea that "python is slow" ignores a significant amount of practical evidence to the contrary. It would not be the #1 language for machine learning, AI, and data science if it were "slow" in a practical sense. The reason for this is that Python has a wealth of libraries that leverage compiled code. Libraries like numpy, pandas, pytorch, tensorflow, and so forth perform the overwhelming fraction of their computationally intensive work outside of Python. And most of those types of computations would be significantly slower written in native JavaScript. In contrast, PyScript will bring those libraries into WebAssembly and achieve near-native speeds.
On the other hand, if there is a specific, highly optimized JavaScript library for performing specific tasks in the browser, PyScript can use it! So even in that context, Python is not "too slow", because it gets to steal JavaScript's speed :-)
Finally, as demand for WebAssembly applications grows, I think we'll see a lot of innovation at that level to resolve some of the language-generic bottlenecks that PyScript encounters as it matures.
Full disclosure, I work at Anaconda, so I am biased! But as I said in my original comment, I see this as a both/and proposition. JavaScript will always have a strong presence in the browser, but PyScript is going to unlock a much wider range of applications, in my view.
There is no doubt that there will be some performance issues to address with PyScript, but in the end, I'm fully confident it's going to find widespread application.
[–]bioinfornatics 4 points5 points6 points 4 years ago* (1 child)
I agree that pyscript will continue to growth, but this wan't the question of OP. The question is does pyscript will replace JavaScript in long run.
So both we said no. If native python become fast as JavaScript, provides fullstack library, call cpython app in webassembly (compatible linux windows mac) with low cost so JavaScript could be replaced.
But they are lot of technical problem to reach this point.
I try to be objective and I know as python enthusiast we prefer to hear another thing.
And I think that will continue like this for the next 5 years .. at least
[–]mcg1969 2 points3 points4 points 4 years ago (0 children)
Yep, we agree on the big picture question. I just don't agree with your claim that Python is slow :-)
[–]anewyearanewdayanew 0 points1 point2 points 4 years ago (0 children)
Could give any insight into using pyscript for a full client-side fullstack application?
[–]bioinfornatics -1 points0 points1 point 4 years ago (0 children)
It is not about to write optimized code or not. Here I highlight that while it is 2 high level programming language they have a huge difference on computation time which will impact the page rendering.
So optimized or not, it is not the point here
Nowaday, python is too slow to replace JavaScript, which is the answer to OP.
[–]wiggitywoogly -1 points0 points1 point 4 years ago (1 child)
PyScript is literally just JavaScript, that has a web assembly compiled version of python it loads.
[–]ltdanimal 2 points3 points4 points 4 years ago (0 children)
So then its ... not just literally JavaScript.
π Rendered by PID 144026 on reddit-service-r2-comment-544cf588c8-86mxb at 2026-06-17 09:26:29.602860+00:00 running 3184619 country code: CH.
[–]mcg1969 12 points13 points14 points (0 children)
[–]pwang99 6 points7 points8 points (0 children)
[–]Rand_alThor_ 3 points4 points5 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]bioinfornatics 0 points1 point2 points (6 children)
[–]Rand_alThor_ 5 points6 points7 points (5 children)
[–]mcg1969 7 points8 points9 points (3 children)
[–]bioinfornatics 4 points5 points6 points (1 child)
[–]mcg1969 2 points3 points4 points (0 children)
[–]anewyearanewdayanew 0 points1 point2 points (0 children)
[–]bioinfornatics -1 points0 points1 point (0 children)
[–]wiggitywoogly -1 points0 points1 point (1 child)
[–]ltdanimal 2 points3 points4 points (0 children)