It can actually manipulate the DOM by writing JS code.
This is really amazing.
Why is that amazing? Anyone can manipulate the DOM by writing javascript.
I don't really know, for now all I want is executing python in the browser
You might want that, but do people using what you make want that? Python is already orders of magnitude slower than a native program, it's going to be even slower running in a browser.
Manipulating the DOM with C++ means one doesn't have to write JS at all, and can use C++.
Even things like TS still rely heavy machinery to translate ts to js.
I don't really know how TS works and if it puts the generated JS in cache.
Well brython is already quite fast already, so I don't think a WASM version would be worse.
And python performance is not such a big problem, it's up to developers to write faster programs instead by picking relevant modules and not writing low-level code. Python performance has already improved a bit, and performance is rarely a real problem in software anyway.
TypeScript: in all sane deployments, it’s translated to JavaScript at build time, so that the end user is just receiving normal JavaScript. If you eschew a few features that do generate some new JavaScript (e.g. enums), TypeScript compilation can even be as simple as just removing type annotations. For most practical purposes, TypeScript is just JavaScript. The end user doesn’t experience the “heavy machinery” to translate it to JavaScript.
Python: whether you use the likes of Brython (>5MB of JavaScript, though if you’re unrealistically careful—given the choice to use Brython—you may be able to whittle it down towards 1MB) or CPython compiled to WASM (mostly even larger, but of WASM rather than JS), performance is always going to be worse than reasonably-equivalent JavaScript or ahead-of-time-compiled WASM from languages like C++ or Rust. It’s fundamentally doing more work than alternatives, so it’ll always be heavier to download, slower to run, and more memory-hungry on equivalent code. It should never be used for web frontend stuff except when operating under extraordinarily unusual constraints, because it’s simply significantly worse in every way imaginable other than “is it more like Python than like JavaScript”.
Well brython is already quite fast already, so I don't think a WASM version would be worse.
What are you basing this on? Brython's own web page says simple operations are slower than regular python and regular python is going to run at about 1/60th the speed of webasm.
Even python users seems to recommend not using it.
Python performance has already improved a bit, and performance is rarely a real problem in software anyway.
Again, I think this is for users to decide if performance isn't a problem.
Most big and popular websites are sluggish even on powerful desktops, let alone a phone that's a few years old.
When someone talks about using super slow languages for something interactive and distributed to users, that's a pretty big red flag, even more when they say 'performance is rarely a problem'.
> I don't really know how TS works and if it puts the generated JS in cache.
Usually, typescript is compiled to javascript in a build step (eg on the developer’s computer) using the typescript compiler. The output is javascript which can be run in the web browser directly, or bundled with webpack & friends, then loaded into the browser.
Why is that amazing? Anyone can manipulate the DOM by writing javascript.
I don't really know, for now all I want is executing python in the browser
You might want that, but do people using what you make want that? Python is already orders of magnitude slower than a native program, it's going to be even slower running in a browser.