Open YanDevDe opened 1 month ago
You mean whether there is an option to output C code? If so, no there isn't. It's something that hopefully will happen some time in the future, but it's not a priority.
And one more addition: while there is still changes to the semantics and the language (i.e. 0.6-0.9) it's going to be less fun to support an additional backend. So this is better done once the language is 1.0.
After 1.0, the versioning of the compiler, language and the standard library will diverge:
Exactly, to output C or even C++ - just like TypeScript outputting to JavaScript :)
Got it - thank you so much!
That said STM32 is an ARM processor, so it would be possible to just be able to cross compile code for it if I enable the ARM target. – But it requires someone to test and help out with library linking etc.
I'm more rather interested for the ESP32! Which they uses RISC-V processor. Questions however remains if native C++ library would be compatible with C3C?
The support I have already for RISC-V is probably better than 32-bit ARM. C3 would be able to use a C++ library through a C API, but not directly with C++. For C++ I'd say these possibilities exist:
Write all the code in C3, access the C++ library through a C wrapper
C3 <---> C API wrapper <---> C++ Library
Write some C++ code, which calls C3 (as if it was C) and also calls the C++ library.
C++ main code <---> C3
^
|
v
C++ Library
Interesting! I'm going to try out in couple of days! Thank you so much lerno!
I'm also wondering how the performance is between vs. native C++? There also exists MicroPython for ESP32 but the reason why I don't use it is because it's too horrible slow and ESP32 is not really the fastest chip out there.
It should be the same as using C++.
You can try using elf-riscv32 / 64 targets now.
Hello,
this is an very interesting new language and so I was wondering if you're able to compile to raw cpp/h as well? In order for me to use it for ESP32/STM32/Arduino with PlatformIO?
I'm kinda getting sick to have 2 different files, cpp and header but I value speed / performance of cpp for IoT devices haha