ezyang / pytorch-unattached

Tensors and Dynamic neural networks in Python with strong GPU acceleration
http://pytorch.org
Other
20 stars 8 forks source link

More structured symbol type #119

Open ezyang opened 7 years ago

ezyang commented 7 years ago

Just because we've gone all dynamically typed on the IR, doesn't mean we can't have our symbols have a little more structure than just "strings". What we have found extremely useful in GHC is to be able to allocate one level of subnamespaces to our symbols. To keep things as strings, we achieve this by reserving the first letter of the symbol as the namespace signifier.

Looking at our list of built-in symbols, here are the namespaces I'd like to see:

And you can always add more as necessary. The namespace signifier can be easily removed to get a raw string as necessary.

CC @zdevito

zdevito commented 7 years ago

Seems like a good idea to me.