Skip to content

integrate tealr #4

@lenscas

Description

@lenscas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions