I've been learning quite a lot of language design lately, so i decided to try my hand by implementing template functions for angel script, thing is I don't know much about the project structure. I was hoping to get some pointers on where to look and how angelscript manages some things, my rough idea is any function is any function with templates would have the corresponding template types passed as void* and type id's passed at the end of the function. say T@ DoSomething<class T,class K>(K@ param)
would be called as void* DoSomething(void* param,int tid_t,int tid_k)
But there's some considerations i have:
- built-in types cannot be handles, iirc, so how would the engine manage something like this(probably only use handles when you're sure its a ref type and throw an error otherwise)
- For templated script functions, would we need to make a new function for each instantiation? if yes I don't know how exactly script functions work and may not be able to do that.