Are high-level data structures going to be supported?

I am using Move IR to write some smart contracts and find that high-level data structures such as HashMap and Vector are currently not supported. I was wondering if it is because of the design philosophy of Move or it will be supported by Move IR/Move source code in the future.

Vectors are now supported (see code here and the tests for lots of examples).

Maps are not supported and are not on our short-term roadmap. However, note that many use-cases that would require a map in Ethereum (e.g., a map from addresses to X) can be represented in a Move by

  • implementing a resource that represents X
  • every time you would use a Map.put(addr, x), use if (get_txn_sender() == addr) { move_to_sender<X>(x) } in Move
  • every time you would use a Map.get(addr), use borrow_global<X>(addr) in Move
  • every time you would use a Map.remove(addr), use move_from<X>(addr) in Move

We may well have maps in the long term, but the use-cases we have had in mind for maps so far can be represented using a pattern like this.

Thanks very much for your reply.