You might be interested in Dao ( http://daovm.net , https://github.com/daokoder/dao ).
Tao is implemented in the C standard with minimal dependency (if you exclude additional modules and tools). It is lightweight and efficient with good support for deployment and expansion. Its interface for calling C functions is not stack based. Here is a simple example:
#include "stdio.h" #include "daoValue.h" static void Square( DaoProcess *proc, DaoValue *param[], int nparam ) { daoint num = param[0]->xInteger.value; DaoProcess_PutInteger( proc, num*num ); } int DaoOnLoad( DaoVmSpace *vmspace, DaoNamespace *nspace ) { DaoNamespace_WrapFunction( nspace, Square, "Square( num : int ) => int" ); return 0; }
You may notice that there is no template code for checking parameter types in a wrapped function. This is because this function is registered as Square(num:int)=>int , which means that this function can only accept an integer as a parameter and is guaranteed by the Dao runtime.
You may also be interested to know that it also has a Clang-based tool for automatically / semi-automatically generating C / C ++ bindings.
Disclaimer: I am the author of this language.
source share