News for hackers. Stuff that matters.
Re:Microsoft rewrote Q# compiler in Rust by systems on Wednesday June 21, 2023 @03:42PM (#36423330)
Well Rust was written OCaml on which F# was based So i think this was probably for performance, not for any expressive reasons

And personally i consider Rust to be from the OCaml/SML family of languages similar to F#, so i guess they moved within the family

Re:Microsoft rewrote Q# compiler in Rust by reocha on Wednesday June 21, 2023 @04:12PM (#36423725)
If it isn't clear from this comment rust is no longer written in OCaml and is fully self hosted (as far as I know).
Re:Microsoft rewrote Q# compiler in Rust by klabb3 on Wednesday June 21, 2023 @04:15PM (#36423768)
Correct. In this context it’s perhaps also worth mentioning that Rust depends on LLVM.
Re:Microsoft rewrote Q# compiler in Rust by tialaramex on Wednesday June 21, 2023 @05:03PM (#36424470)
Yes. Rust's compiler, rustc, is a bunch of Rust code that parses Rust syntax into an Abstract Syntax Tree to which it can apply macros, then this is lowered through two levels of intermediate representations, where more Rust code does the type inference and type checking and eventually borrow checking and various optimisations, until eventually it's lowered to LLVM Intermediate Representation LLVM IR, which LLVM will further optimise then produce machine code for the target architecture.
Re:Microsoft rewrote Q# compiler in Rust by reocha on Wednesday June 21, 2023 @05:09PM (#36424568)
Impressive knowledge o7
Re:Microsoft rewrote Q# compiler in Rust by Dudester230602 on Wednesday June 21, 2023 @06:17PM (#36425459)
What do Rust developers tend to do while the code is compiling? Vote 'Rust' in all the programming language surveys?
Re:Microsoft rewrote Q# compiler in Rust by xedrac on Wednesday June 21, 2023 @08:18PM (#36426571)
I know you're getting downvoted, but seriously, Rust compilation/linking does take a long time, especially if you enable fat LTO. The upside is it's doing a lot more for you than say the C or C++ compiler would. It's a very small price to pay for what you get.
Re:Microsoft rewrote Q# compiler in Rust by proc0 on Thursday June 22, 2023 @01:37AM (#36428357)
They play Rust.
Re:Microsoft rewrote Q# compiler in Rust by Measter on Thursday June 22, 2023 @12:31PM (#36434683)
Of course not, don't be daft! We go shopping for CPUs.
Re:Microsoft rewrote Q# compiler in Rust by Vecr on Wednesday June 21, 2023 @05:04PM (#36424479)
You can kind of compile (a version of) Rust into C and then compile that as well, but I assume miscompiles are common and there's very little checking done. It's used to bootstrap the compiler for Debian.