At a high level, it seemed like F# is more functional like OCaml, than Rust is. I'd like to hear more about the reasoning, was it just performance? How different was it to justify a re-write?
At a high level, it seemed like F# is more functional like OCaml, than Rust is. I'd like to hear more about the reasoning, was it just performance? How different was it to justify a re-write?
My guess is because Rust is great with WebAssembly and they seem to target it with Q#:
So if you want fast browser perf, Wasm is a great choice.
There's also Wasm on the edge with the likes of Cloudflare Workers and Vercel https://vercel.com/docs/concepts/functions/edge-functions/wa...
It also has some interesting isolation properties.
You can't even do a syscall in 50ns.
Cloudflare's 5ms includes time to read the application code from disk. (I'm the one who originally did this measurement.)
50ns is the median time to initialize the Wasm module. I think it would make sense to do another round of measuring with more factors that test things end to end, and see how each of the platform performs.
BTW, I'm a big admirer of Cloudflare Workers... great work!
Maybe.
Yes, targeting WebAssembly, and the ability to then run in the browser, was a big part of it.
WebAssembly (will) also enable our language service extension to run in VS Code for the Web, as well as VS Code for desktop, with largely the same feature set.
It also means the core logic compiles to very performant native code for most platforms, which we use for the CLI.
It's early days for the project, with lots of work ahead of us, but I'm really proud of this first step. Happy to answer any other questions where I can!
So, am I hearing correctly, the goal was really about portability, and allowing Q# to run in a browser, not for any performance reasons of .NET.
For example, if you go to the playground that we publish on every push to main (https://microsoft.github.io/qsharp/), and open the Developer Tools to see the network traffic, you'll see that our WebAssembly module is just 1.5MB (504kb over the wire) - which includes the not just the language (parser, type system, IR, etc.) but also the runtime interpreter and quantum simulator.
Similarly, for the native tools, on my MacBook (i.e. ARM64) the command line compiler ("./target/release/qsc") is 3.9MB, which is entirely standalone with no dependencies.
We do have many features to add, so I'm sure those will grow a bit, but we are focused on keeping things as small, portable, and fast as a general principal.
If Q# is a language for quantum computing, and it is a niche language just for exploring quantum computing.
Then, how does that lead to a requirement to re-write to target WASM?
If you are a person that would be doing quantum computing, why do you care if you can run it in a web browser, or VS code for the web. You would just install tooling on your own machine. Or if you are editing code in a web browser, the code itself would get compiled and run on server, why does it have to compile and run right there in a browser.
So if we remove WebAssembly as a goal, Why can't you just use .NET, CLR and stick with current MS languages to build it in?
I don't understand why running in the web is a needed feature for this set of users.
I understand RUST is very speedy. Is that the real goal, and all of "Rust also works on WASM", is just a side benefit?
Seems like quantum computing needs speed. Performance is the real goal. To simulate a quantum computer a normal computer must run many more steps.
So we have performance of : .NET, Rust binary, or Rust to WASM.
Guess, maybe I answered my own question. If Rust is faster then .NET, then that is goal, and Rust can also run on WASM as option is a side benefit.
I'm afraid this seems to be more indictment of .NET in general, not just F#.
This is what underpins Blazor.
https://github.com/dotnet/runtime/tree/main/src/mono/wasm
Example C# app running in a browser:
https://github.com/dotnet/runtime/blob/main/src/mono/sample/...
Deploying GC language with a huge runtime and stdlib to WASM sounds like a bad idea.
Or for something more modern, Flutter.
Flutter is basically cost center app framework (like xamarin) - not something you model performant software after.
Flutter is doing quite alright, much better than Xamarin, with the MAUI reboot.