3 ms·
I wish Cloudflare supported Python for Workers/Functions. There is some weird translation from Python to Javascript which seems extremely bloated. I just want t
by systemvoltage 5y ago
I wish Cloudflare supported Python for Workers/Functions. There is some weird translation from Python to Javascript which seems extremely bloated. I just want to run Python for the backend, natively. One day, we can deploy Flask apps through Cloudflare edge nodes, that would be cool.
- robertlagrant 5y agoThey only use the Chrome v8 engine to host their serverless stuff, so everything has to transpile to Javascript or compile to WASM. If v8 doesn't run it, it's not running in their edge. I think it's a good idea; cheap runtimes and no cold start penalty are a good combination.
- ekimekim 5y agoOne of the major reasons all these kinds of services use javascript is that it can be reliably sandboxed (it needs to be, so it can run in a browser without every random website getting control of your machine). While there's nothing in theory preventing you from doing a similar thing with python, an implementation with the same hardening just doesn't exist. CPython sandboxes have been broken over and over again, to the point that conventional wisdom is "the only way to sandbox python is to run it in a VM". The only other language I can think of offhand that has similar levels of sandboxing is Lua.
- deleted 5y ago[deleted]
- systemvoltage 5y agoHow does AWS lambda work? From what I can see, it runs python natively. https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes...
- brody_hamer 5y agoIm guessing it’s LVM based. (ie: containers)
- trillic 5y agoIt runs it in a micro-VM.
- yencabulator 5y agohttps://firecracker-microvm.github.io/ https://firecracker-microvm.github.io/
- brody_hamer 5y agoMaybe fly.io? I haven’t used them, but they do containers “on the edge”.