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

Polymorphic externals #113

Open
Champii opened this issue Jun 10, 2022 · 0 comments
Open

Polymorphic externals #113

Champii opened this issue Jun 10, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Champii
Copy link
Owner

Champii commented Jun 10, 2022

We are currently highly limited by the externals definitions, that can only return concrete types.

We want to be able to call malloc for instance to allocate contiguous memory on the heap, and we want to do that for any arbitrary sized type.
Actually, the prototype definition is too strict and doesn't allow for generic types:

extern malloc: Int64 => String

We want to be able to alias the void * returned by malloc to any type we want.

extern malloc: Int64 => a

This implies to rework the prototype_call mechanism to be more like function_call with signature resolution and mangling/monomorphization

@Champii Champii added the enhancement New feature or request label Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant