-
Notifications
You must be signed in to change notification settings - Fork 3
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
Proposal on XSharp interface #34
Comments
I voiced my concerns about implementing X# in v3 in #35. Quoting:
|
so what you are getting at is to have ilc emit it? |
Well, we'd have something similar to what X# did - that is, extract assembly code from CLR assemblies to files - but it would realistically only support string literals. We'd probably introduce some common header to the generated file. Do note that this will introduce a whole another build step. I'm not sure if inline assembly is worth it if most functions would be defined in their own standalone assembly files; e.g. (C#) [RuntimeImport("x86_getcr3")]
public static extern nuint GetCr3(); (NASM x86-64 Assembly) align 16
global x86_getcr3
x86_getcr3:
mov rax, cr3
ret This is the approach most kernels take, e.g. Linux, WinNT, *BSD, etc... |
mmm I think that could work like we have a path search to include .s files have YASM build it and we pass the build consts from .net to it so like in the cosmos nuget package there would be a folder |
I think this will be way simpler for long term support + community contributions |
I am proposing that we use a fluent API for XSharp like this https://gitlab.com/liquip/liquip/-/blob/7921298f4f73b412a52bab313172df7c41761e5d/Liquip/RDseed.cs#L56 this will map well to a string builder and will allow better showing of control flow
The POC will target yasm and x86 and just emitting the asm string
The text was updated successfully, but these errors were encountered: