News for hackers. Stuff that matters.
Re:Automatically generating types for Cloudflare Workers by kentonv on Wednesday November 17, 2021 @10:26AM (#29254318)
When it comes to JavaScript / Web APIs, the language you're looking for is WebIDL. The standards specify all APIs in WebIDL, and I believe Chrome does exactly what you're describing, generating C++ interfaces from WebIDL.

In Cloudflare Workers we've taken a different path, having the C++ interfaces be the source of truth, as we feel this leads to less cognitive overhead for developers on the project (and avoided the need to write a new WebIDL code generator matching our internal C++ dialect). It's possible we'll revisit this decision in the future, but for the moment it seems to be working well.

Re:Automatically generating types for Cloudflare Workers by e12e on Thursday November 18, 2021 @04:00PM (#29270465)
Looking at https://webidl.spec.whatwg.org/ I'm not sure if I understand how this really helps bridging type information from js to python to c++ - it looks very tied to js?

There's openapi (swagger) and json schema which seems more like helping define RPC over http?