lsd-ucsc / ChoRus

🎶 Choreographic programming in Rust 🎶
https://lsd-ucsc.github.io/ChoRus/
MIT License
39 stars 2 forks source link

Can we use `std::any::TypeId` instead of `ChoreographyLocation`? #9

Open shumbo opened 1 year ago

shumbo commented 1 year ago

Rust std has std::any::TypeId, which allows the comparison of types at runtime. Since it implements Hash, it should be possible to use this to compare type-level locations at runtime instead of ChoreographyLocation.

https://doc.rust-lang.org/stable/std/any/struct.TypeId.html

We should explore if it is possible to replace ChoreographyLocation with TypeId, list its pros and cons and implement it if it is feasible to do so.