How are we going to do this?
Right now, the fork supports the add_type_methods method in hv_lua's userdata. This is done in such a way that it doesn't require changes in the tealr_generate_docs crate.
However, I'm not sure if I did the TypeBody implementation for the new types introduced by hv_lua correctly and I am probably missing some of those as well.
Further things: tealr is normally compatible with both mlua and rlua. Right now, that compatibility is broken in the fork but not entirely removed.
tealr + branch that I use as "fork" for FishFight : lenscas/tealr#39
edit: It might be possible to reverse the dependency, tealr doesn't care if you have enabled one of the backends or not. And the TypeWalker struct only cares about things having implemented A: 'static + TypeName + TypeBody.
Then it might be possible to add support for everything that hv_lua does to tealr without actually forking tealr.
TealData can then simply be merged with the UserData from hv_lua. So, I don't think that this is a problem is it is just some extra bounds on UserData that are needed.
TypeName has a new (default) method to generate the name of a Userdata type (with a Userdata type I mean the userdata that can be used to create dynamic queries and which also gets methods through the add_type_methods method)
TypeWalker has a new method (process_type_as_marker) to get all the information for a Userdata type.
Both of those would require another solution. I think it is possible to solve both of them by working with a Type<T> instead of a T though it would mean that you won't be able to modify what the name is of a Userdata type.
Lastly, some things would need to be reimplemented on hv_lua's side regardless as they are only accessible if a backend is selected. These are:
The generic macro (and optionally, the premade generics) https://github.com/lenscas/tealr/blob/master/tealr/src/mlu/generics.rs
the Union macro https://github.com/lenscas/tealr/blob/master/tealr/src/mlu/picker_macro.rs
and lastly, the TypedFunction https://github.com/lenscas/tealr/blob/master/tealr/src/mlu/typed_function.rs
The types that hv_lua exposes need to implement TypeName and unless they are built in to lua also need to implement TypeBody.
How are we going to do this?
Right now, the fork supports the
add_type_methodsmethod in hv_lua's userdata. This is done in such a way that it doesn't require changes in thetealr_generate_docscrate.However, I'm not sure if I did the TypeBody implementation for the new types introduced by
hv_luacorrectly and I am probably missing some of those as well.Further things:
tealris normally compatible with both mlua and rlua. Right now, that compatibility is broken in the fork but not entirely removed.tealr + branch that I use as "fork" for FishFight : lenscas/tealr#39
edit: It might be possible to reverse the dependency, tealr doesn't care if you have enabled one of the backends or not. And the
TypeWalkerstruct only cares about things having implementedA: 'static + TypeName + TypeBody.Then it might be possible to add support for everything that
hv_luadoes totealrwithout actually forking tealr.TealDatacan then simply be merged with theUserDatafromhv_lua. So, I don't think that this is a problem is it is just some extra bounds onUserDatathat are needed.TypeNamehas a new (default) method to generate the name of a Userdata type (with a Userdata type I mean the userdata that can be used to create dynamic queries and which also gets methods through theadd_type_methodsmethod)TypeWalkerhas a new method (process_type_as_marker) to get all the information for a Userdata type.Both of those would require another solution. I think it is possible to solve both of them by working with a
Type<T>instead of aTthough it would mean that you won't be able to modify what the name is of a Userdata type.Lastly, some things would need to be reimplemented on
hv_lua's side regardless as they are only accessible if a backend is selected. These are:The generic macro (and optionally, the premade generics) https://github.com/lenscas/tealr/blob/master/tealr/src/mlu/generics.rs
the Union macro https://github.com/lenscas/tealr/blob/master/tealr/src/mlu/picker_macro.rs
and lastly, the TypedFunction https://github.com/lenscas/tealr/blob/master/tealr/src/mlu/typed_function.rs
The types that
hv_luaexposes need to implementTypeNameand unless they are built in to lua also need to implementTypeBody.