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

Do we need the IR wrappers? #103

Open kuzminrobin opened 3 years ago

kuzminrobin commented 3 years ago

Do we need the IR wrappers?

The known reason for the IR wrappers (in *.ll files) to exist is that the IR wrappers names start with the double underscore __. The identifiers starting with double underscore are reserved in the standards of C and C++. Are there any other reasons?
Can Q# compiler generate the QIR such that instead of the IR wrappers the corresponding wrapped functions are called? (without __ in the beginning)

Stefan: I would prefer finding a solution that does not require keeping the IR wrappers, whether that be switching the wrappers to a language that doesn't reserve __ as starting characters (like Rust) or updating the QIR spec to remove those. While they do provide some benefit for avoiding name collisions, that pattern has a cost overhead for implementation both for us and any external folks who want to implement their own runtime. Perhaps we could remove this question from here in favor of an issue filed against the spec in the language repo?

Bettina: Yes, I am open to that conversation and filing it on the language repo makes sense