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

[request] Allow function overloads #102

Open
heysokam opened this issue Apr 29, 2024 · 1 comment
Open

[request] Allow function overloads #102

heysokam opened this issue Apr 29, 2024 · 1 comment

Comments

@heysokam
Copy link

heysokam commented Apr 29, 2024

This is perfectly legal in Nim, because they are all different functions with different shapes:

image
But futhark sanitizes everything, and turns them into this instead:

proc release*(adapter: Adapter): void {.cdecl, importc: "wgpuAdapterRelease".}
proc releaseproc*(bindgroup: Bindgroup): void {.cdecl, importc: "wgpuBindGroupRelease".}
proc referenceproc00000000EAE069C7*(bindgrouplayout: Bindgrouplayout): void {.cdecl, importc: "wgpuBindGroupLayoutReference".}
proc releaseproc0000000036522FBD*(bindgrouplayout: Bindgrouplayout): void {.cdecl, importc: "wgpuBindGroupLayoutRelease".}

Would it be possible to have a flag that skips this name sanitation when opted into?

@heysokam
Copy link
Author

heysokam commented Apr 29, 2024

Created a working version, but its very hacky
Would appreciate your input on how you would do these Unsafe*Names config options, while respecting your existing architecture
master...heysokam:futhark-overloads:master

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

1 participant