Have you ever tried to compile for esp32/8266?

dangbinghoo dangbinghoo at gmail.com
Tue Nov 26 04:38:17 UTC 2019


On Tuesday, 26 November 2019 at 04:34:44 UTC, dangbinghoo wrote:
> On Tuesday, 19 November 2019 at 12:51:06 UTC, Andrea Fontana 
> wrote:
>> I see expressif released a fork of llvm with a new target: 
>> extensa.
>> This allows you to write code for esp8266 and esp32 using 
>> clang [1]
>>
>> I wonder if we can use ldc (using -betterC I guess) to build 
>> code for these platforms as well.
>>
>
> And you will have betterC d code compiles and linking:
>
> ```
> $ cat dcode.d
>
> module dcode;
>
> extern(C) int printf (scope const char * fmt, ...);
>
> char[8] a = ['a'];
>
> extern (C) void dlang_main()
> {
>     uint i = 0;
>
>
>     printf("hello, dlang says : i = %d, char a len = %d\r\n", 
> i, a.length);
> }

PS: and in other place of you esp32 IDF C code, just call 
dlang_main as a pain c function, you will probably see Dlang is 
saying hello.

^_^

Hope these helps!

Thanks!

----
Binghoo Dang




More information about the digitalmars-d-ldc mailing list