4 ms·
I don't think you grasp quite the implications of what I was saying, this kind of approach could take _seconds_ to even start running your python application. L
by DanielHB 3y ago
I don't think you grasp quite the implications of what I was saying, this kind of approach could take _seconds_ to even start running your python application. Large python codebases could take like a minute to start if loaded that way.
Once it does start then your arguments can make sense, but even so it would still make it impractical for most things.
Trust me, when the Javascript dev tells you something will be slow, it WILL be very slow
- jsheard 3y ago> I don't think you grasp quite the implications of what I was saying, this kind of approach could take _seconds_ to even start running your python application. Indeed, the web demo takes about 5 seconds to cold-start on my beefy PC, between downloading the 22MB WASM blob and compiling it. It also grows the WASM heap to 160MB after running the simple Fibonacci example, and WASM heaps can't (yet) be shrunk, so the only way to reclaim any of that memory is to discard the whole instance and start over. It's cool that it works, but not very practical.
- antonjs 3y agoDepends a little on if you're going to a website to use an app, or running something on a always on PC on say a production floor where the app never gets exited, I'd think.
- jsheard 3y agoIf you're not targeting the web, what would be the point of running a Python runtime on top of a WASM runtime? You could just run RustPython as a native binary, or use ol' reliable CPython.
- amelius 3y agoI guess parts of this can be cached, so if you use the app more than once it will be faster (or at least it has the potential for it).
- hoodchatham 3y agoAs far as I'm aware, even discarding the instance isn't good enough, since v8 doesn't seem to reclaim the Wasm Linear Memory ever. I think the only thing you can do is start it in a worker and then terminate the entire worker.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- simonw 3y agoPyodide (standard cPython in WebAssembly) loads surprisingly quickly. My https://lite.datasette.io https://lite.datasette.io application usually starts up in less than 10s - most of that is downloading about 10MB of WASM blobs, and 10MB isn't actually that big these days (many sites serve more than that in image headers). When I built Datasette Lite I did it as a research project, assuming it would be far too slow loading to be useful. I've since changed my mind on that.
- jjtheblunt 3y agoYour project seems very cool, and good on you for it. 10 seconds is absurdly slow, though. That's like time to install Mathematica from a disk image level slow.
- simonw 3y agoI thought it was too slow as well, but apparently it's not - plenty of people are using it now, and I myself use it way more than I thought I would.
- polygamous_bat 3y ago> 10 seconds is absurdly slow, though. I hate to say this, but have you used any $ModenWebApp with $HotJSFramework recently? I thank the gods when those pages load without a 5-10 second of fancy spinning animation. Really thought we would be in a better place by 2024 but nope.
- jjtheblunt 3y agoI haven't used any such slow thing yet (am mostly a commandline world person).
- nick238 3y agoDon't work for a company where you need to turn in receipts or fill out info in crappy HR software? I mean, good for you and knowing the command line, but doing the less-fun, less-specialized parts of jobs usually involves regressing to the mean of what interfaces people know how to use.
- randomdata 3y agoWhat do you envision these scripts to be doing that it would matter if it takes minutes, hours even, to start? Fire and forget. Granted, the environmental cost to all that extra energy consumption may not be palpable. Then again, you're exactly choosing Python in the first place if you care about the environment.
- mcherm 3y ago> this kind of approach could take _seconds_ to even start running Only seconds? Today it takes 45 minutes to do the update by hand, but there's this handy 20-line Python script that does it instantly. (Hypothetical example only, but it's not uncommon.)
- esrauch 3y agoI just opened Facebook.com and it took more then 10 seconds time to first content paint, and it isn't because of slow internet. I've worked on more than one FAANG external user facing site fixing stuff to get median initial page latency to be below 5 seconds, so I think your "this will take _seconds_" emphasis is kind of funny. Internal business crud apps often take multiple seconds on every click. Even a minute for an employee to start an app that is then snappy would be acceptable for practically any internal business usecase if they can just leave the tab open, and there's no technology reason why python wasm interpreters would need to be that slow.