intial implementation of type_alike in C, not tested