4 ms·
Why not…just use rust then? I don’t understand the point of all of these niche languages in real life. Python, Go, rust, c, cpp, js, C#, kotlin, but why use oth
by asylteltine 3y ago
Why not…just use rust then? I don’t understand the point of all of these niche languages in real life. Python, Go, rust, c, cpp, js, C#, kotlin, but why use others? Each of these have clearly defined strengths and community support.
- hu3 3y agoWhile I understand your sentiment, Q# is specialized for Quantum Computing: https://en.wikipedia.org/wiki/Q_Sharp https://en.wikipedia.org/wiki/Q_Sharp It's arguably different enough of a domain to justify a new language.
- Alupis 3y agoThis strikes me as a bold (probably marketing) claim more than anything. Looking at the example code, it seems to make use of many "quantum" libraries, but why could those libs not be made available to C# or whatever? Quantum computing is a niche, to say the least, and the field is far from clearly defined. This sounds a lot of IBM proclaiming RPG will be the best "big iron" language ever - and today nobody uses it.
- erk__ 3y agoProgramming languages for quantum computing needs to uphold some rules normal programs does not need to. The biggest is likely that no information may be destroyed when the program is run, from this follows that it needs to be reversible. This means that from any result you should be able to compute the input. Rules like these can be hard to uphold in normal languages (I have done it with a subset of rust in the past) so a specialized language is often used instead. There is probably more to it, but these are the parts I know a bit about.
- ko27 3y agoThe simple reason is that if you design your language with limitations of a quantum computing you can make certain guarantees about your program being able to physically execute on any quantum computer. You can find more details here: https://learn.microsoft.com/en-us/azure/quantum/overview-what-is-qsharp-and-qdk https://learn.microsoft.com/en-us/azure/quantum/overview-wha...
- saraham 3y agoI'm a compiler engineer on the Q# team - to add to what others have said, Q# is more than a set of quantum APIs, and the Q# compiler does quantum-specific checks and transformations on the AST representation of your program. To do the same thing in an existing language, you'd need a deeply embedded DSL so that the program can be manipulated by the Q# "compiler" before running it. It's possible, but it can get kind of clunky, where you have to use the "embedded" if statements, for loops, etc. instead of the ones from the host language. A new language helps with having a cleaner separation.
- erk__ 3y agoThis was more or less how I did it in my reversible rust project. Though I was only really interested in reversibility. https://github.com/Erk-/RRust https://github.com/Erk-/RRust
- asylteltine 3y ago[dead]
- deleted 3y ago[deleted]
- proc0 3y agoThere are multiple dimensions of trade-offs from which to choose from, i.e. runtime speed vs. convenience of writing, complexity of learning vs. powerful type systems, etc.