alan
alan copied to clipboard
`toHash` and `clone` functions
Grouping these together because they have a similar broad scope in the language.
One neat thing in Alan v0.1 was that both of these worked for all types; they just accepted the any
interface as their sole argument.
This may be impossible to implement for Rust because you can bind types that do not have #[derive(Clone)]
attached, and there are situations where you wouldn't want to be able to do that, particularly in the GPGPU context, or sockets, etc.
toHash
similarly could create an xxhash of anything and it was used for the HashMap
implementation to let you have anything as a key. Being able to hash everything is similarly useful, but I am unsure if I can replicate the way Alan v0.1 had the same hashes for the same object in both the AVM and Javascript. Rust may be very difficult to accomplish this. And this would be doubly-stymied by type binding, which by necessity would refer to different things in Rust and Javascript.
I would still like these to work in as many situations as possible, though.