Champii/Rock

Polymorphic externals

Champii opened this issue · 0 comments

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