Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssemblyBuilder.Save in .NET 8 #61

Open
ShalokShalom opened this issue Feb 1, 2023 · 5 comments
Open

AssemblyBuilder.Save in .NET 8 #61

ShalokShalom opened this issue Feb 1, 2023 · 5 comments

Comments

@ShalokShalom
Copy link

Prototype: https://github.com/dotnet/runtimelab/tree/feature/assembly-builder-save

Issue: dotnet/runtime#15704 (comment)

Hint: Once this is implemented, change the Readme accordingly

@RyanLamansky
Copy link
Owner

If this ships I will definitely plug it in 👍

@Terricide
Copy link

Looks like it is in .net 9.0 preview

@RyanLamansky
Copy link
Owner

If it's still there when .NET 9 releases, I'll integrate it!

@RyanLamansky
Copy link
Owner

.NET 9 seems to have shipped with a way to save assemblies. I haven't tried it yet, but the API looks like what we need.

Some work is required to integrate it. In particular, the compiler assumes that the user will figure out how to supply all the imports and accept the exports, but when saving a DLL, people will expect to have generated types to cover both sides of that. So, the beginning and end of the compilation process will need some updates. I'll work on this when I have time, but PRs are always welcome 😇

@RyanLamansky
Copy link
Owner

Status update: I just committed partial work to c2beb13. It's not generating the import/export classes correctly yet but it's able to convert the main body of WASM code to a .NET DLL now. Fun fact: in the early days of this project, I mainly built on .NET Framework 4.x which had AssemblyBuilder.Save functionality which was extremely useful to figure out all the ways I was generating IL incorrectly. It's really nice to have that capability again.

It would be neat it someone pointed .NET DLL "decompiler" to a converted WASM DLL to see what it could do. In theory this could enable a C-or-Rust to C# conversion, for example, but there are many things raw WASM/IL can do that C# can't so I'm sure it would struggle.

Anyway, just wanted to share a progress update. I'm not sure how long it'll take me to get the last issues sorted out but I intend to do a new full release (it'd be version 1.3) once it seems to be working and I'm happy with the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants