dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.36k stars 188 forks source link

[NativeAOT-LLVM] JSExport-based async main #2610

Closed SingleAccretion closed 3 weeks ago

SingleAccretion commented 3 weeks ago

The idea is simple: 1) Source generate a JSExport thunk for the entry point with a well-known name. 2) Invoke that JSExport - the existing host code already does this.

The complications are in the finer details. For example, this change utilizes a hidden file injected into user compilations to achieve the JSExport bit, to simplify the code generation. Even with that, due to C# rules, we cannot generate wrappers for all possible entry point definitions.

SingleAccretion commented 3 weeks ago

@dotnet/nativeaot-llvm