RE: https://mastodon.gamedev.place/@eniko/117377588642989264 think i've got it. ...

@eniko@mastodon.gamedev.place

RE: mastodon.gamedev.place/@eniko/

think i've got it. the left code desugars to the right. so "generics" are really just structs that contain type information members, and also i'm stealing lua's `:` operator to instance calls

so calling `list:Get(...)` is really just `List_Get(ref(list), ...)`

`struct List<T>` is really just a struct List with a Type T member and `List<Foo> list` is just declaring a List struct with T initialized to typeof(Foo)

and a generic func that returns T returns a pointer to T which the caller copies