4 ms·
Is there a list of languages Cloudflare Workers supports? From what I can tell, it's JS, Rust, C, C++, and now COBOL. So... no PHP then? Seems like it would be
by ancarda 7y ago
Is there a list of languages Cloudflare Workers supports? From what I can tell, it's JS, Rust, C, C++, and now COBOL.
So... no PHP then? Seems like it would be a good fit, no?
- k__ 7y agoIf they use V8 it doesn't no. At least not with the state of WASM right now. Manual memory management and JS it is.
- steveklabnik 7y agoWe do use V8, yes.
- gameswithgo 7y agoany GC language could in theory be supported only if you can compile that language and the runtime it needs into a sufficiently small package.
- simonw 7y agoThe linked article talks about the importance of keeping size under control. PHP ships with literally hundreds of built-in functions, which I imagine makes it harder to optimize for the size constraints of Cloudflare Workers.
- steveklabnik 7y agoThe officially supported languages are: * JavaScript (and TypeScript) * C and C++ * Rust Other languages may work, and we we won't stop you from using them, but you may run into problems. The main issue with getting most languages to work is that we support JavaScript and WebAssembly, which means any other language needs support for compiling to wasm before it's even possible. Once it is, we have a one megabyte limit for the size of a worker, and so many other languages won't work because their minimal wasm output is too large. We'd like to support more in the future. It takes a lot of work.
- ignoramous 7y agoThanks. Official languages aside, are there plans to support protocols other than HTTP? Say, WebRTC? Or, even raw TCP/UDP sockets. From what I know, Spectrum lets one deal with L4 and MagicTransit with L3 (provided BYOAnycastIP), but will there be a way for Workers to be an origin to those?
- steveklabnik 7y agoWe would like to do this as well, yes, but I can't make any commitments regarding it.