demergent-labs / kybra

Python CDK for the Internet Computer
MIT License
81 stars 15 forks source link

Generics #345

Closed lastmjs closed 7 months ago

lastmjs commented 1 year ago

Records, Variants, Tuples, Aliases all need to support generics now. The cdk framework should guide you, along with the existing examples and the new generics example.

lastmjs commented 1 year ago

We cannot do this until RustPython allows for TypedDicts with Generics, or until we decide to do data classes and deal with the typing issues with making classes with optional properties, I am not sure it's easily possible.

Here's the RustPython issue to follow: https://github.com/RustPython/RustPython/pull/4946

We also will probably (maybe?) need the full stdlib in Kybra first.

lastmjs commented 7 months ago

We are closing this issue anticipating an entire rearchitecture of Kybra similar to what we have done with Azle. This removes most of the compiler architecture as it is. We believe that this issue no longer applies to the new planned architecture.

In case our rearchitecture is not successful, or we otherwise need to find these closed issues, the search term KYBRA_REARCHITECTURE can be used.