Open frank-dspeed opened 5 years ago
I agree, however it could also be useful to just write C FFI/C declarations.
http and sockets are target specific.
how I see it:
fetch
for ESP32 with same syntax as the fetch we have in browserso what you are suggesting is rather p.3
I mean, not against it at all, but for now I'm concentrating on the transpiler part, and it is a gigantic effort to implement even just the ES3 spec...
Well, After implementing ES3, you can run babel and typescript to turn ESnext to ES3. Also, I think I found some issues and have fixes for them but I patched my local ts2c implementation so IDK. Also, I have came up with a series of tricks to get 64-bit intagers and C FFI for use in an OS, see js-os. It also patches the input JS and the ouput C quite a bit.
interesting project! :+1:
yes, basically this patching as in cpatch.js
is more or less what a TSC target would do.
C FFI is also done in TSC target, already possible via type definitions, example here: https://github.com/andrei-markeev/ts2c-target-esp-idf/tree/master/headers
this would be really usefull if it would be able to implament some standard stuff like a basic http request and response handling or a net socket.