microsoft / qsharp-language

Official repository for design of the quantum programming language Q# and its core libraries
MIT License
233 stars 54 forks source link

Proposal for the Dyn Type #154

Open spignorel opened 1 year ago

spignorel commented 1 year ago

This proposal introduces a Dyn type to reflect values that are only known at runtime.

bamarsha commented 1 year ago

Although dyn as a type was originally my idea, I think my opinion now is that dyn should not be a type, but rather an internal compiler property for values. We don't plan to expose dyn to users (and potentially it may never need to be exposed, given our inference rules), so I think it would be better to avoid cementing it in Q#'s type system.

For the compiler's static analysis, I think we only need:

So I'm not sure if this should be a QEP at all, since we didn't write a QEP for the earlier static analysis of hardware capabilities before, but left it as an internal compiler implementation detail.

billti commented 1 year ago

Are we in agreement on this now? @spignorel do you need to update the proposal based on the latest from @samarsha above?

spignorel commented 1 year ago

Per @samarsha there are questions as to which repo this should sit under. @billti stay tuned.