FFIGen Pad - Next Steps?

226 views
Skip to first unread message

Aayush Kashyap

unread,
Mar 17, 2024, 9:00:41 PMMar 17
to dart-gsoc
Hi everyone!
I just completed compiling a few C libraries to WASM and am currently exploring WASMGC to compile some Dart too. I wanted to ask what the next step should be?
Also to extend my understanding of the project, is libclang needed internally by dart-sdk to generate AST, and hence its need? If that is the case, are there any more C dependencies that I need to incorporate too?
Regards,
Aayush

Daco Harkes

unread,
Mar 18, 2024, 4:01:09 AMMar 18
to Aayush Kashyap, dart-gsoc, Prerak Mann, Jackson Gardner
Hi Aayush,

We haven't looked at the challenges compiling libclang to WASM. That is for you to explore! Let us know what you find out!

A first step is to start with a simple C program that interacts with file IO through WASI.
And then try compiling the whole of libclang from source to WASM with WASI.

Kind regards,

 •  Daco Harkes
 •  Software Engineer
 •  dacoh...@google.com 

--
You received this message because you are subscribed to the Google Groups "dart-gsoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dart-gsoc+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dart-gsoc/e07ea395-e1d3-4b63-8a63-7b79251890dan%40googlegroups.com.

Aayush Kashyap

unread,
Mar 27, 2024, 5:56:23 AMMar 27
to dart-gsoc
I was successful in compiling a piece of C code to WASM with fileoperations. I also tried compiling Dart code to WASM via WASMGC. Next up, I wrote some basic C code to explore how libclang works. I am currently exploring ways to compile libclang to WASM. With the deadline for submission approaching, is it a good time to submit a draft proposal?Also, what all points should I include in my proposal and in how much detail? 

Daco Harkes

unread,
Mar 27, 2024, 6:45:44 AMMar 27
to Aayush Kashyap, dart-gsoc, Jackson Gardner, Prerak Mann
Hi Aayush,

That's great!

Another thing for you to try is to make the compiled Dart code to WASMGC work together with the C code compiled to WASM+WASI.

I am currently exploring ways to compile libclang to WASM.

Cool!
 
With the deadline for submission approaching, is it a good time to submit a draft proposal?Also, what all points should I include in my proposal and in how much detail? 

Yes, please make a Google doc and give +Prerak Mann +Jackson Gardner and me comment access.

Kind regards,

 •  Daco Harkes
 •  Software Engineer
 •  dacoh...@google.com 

Kingsley Umenze

unread,
Mar 27, 2024, 11:07:59 PMMar 27
to dart-gsoc
Good day, i have successfully compiled C code to WASM and i have been able to interact  with the C method in dart code via JS  i want to know if this is a valid route.

Daco Harkes

unread,
Mar 28, 2024, 5:07:17 AMMar 28
to Kingsley Umenze, dart-gsoc
Hi Kingsley,

No, you should interact with dart:ffi and dart compile wasm, not via JS interop.

Kind regards,

 •  Daco Harkes
 •  Software Engineer
 •  dacoh...@google.com 

Aayush Kashyap

unread,
Mar 29, 2024, 6:13:10 AMMar 29
to dart-gsoc
Hi Daco!
I have sent the initial proposal to everyone mentioned. Please have a look!

Regards,
Aayush Kashyap

Daco Harkes

unread,
Apr 2, 2024, 6:32:42 AMApr 2
to Aayush Kashyap, dart-gsoc
Hi Aayush,

The proposal looks good.
It could be expanded with some learnings from the getting started projects.

Also, could you add a link to a private GitHub repo with your sample code so that we can take a look?

Kind regards,

 •  Daco Harkes
 •  Software Engineer
 •  dacoh...@google.com 

Aayush Kashyap

unread,
Apr 2, 2024, 10:49:28 AMApr 2
to dart-gsoc
Hi,
I actually haven;t been able to figure out how to initialize the symbols into the dart code. On native platforms it would have been done with DynamicLibrary.(process/open/executable) calls but how do I initialize them on WASM Platform?

Regards,
Aayush
Reply all
Reply to author
Forward
0 new messages