Re:Safety: A comparaison between Rust, C++ and Go
by unsafecast on Saturday July 30, 2022 @03:42PM
(#32289660)
Sounds great, that's what I was imagining too. Is there a way I can find it when/if you open the source?
Re:Safety: A comparaison between Rust, C++ and Go
by benreesman on Saturday July 30, 2022 @11:27PM
(#32292873)
Drop me a line at [email protected] and I'll let you know when we can open-source some of it.
None of it is really all that magical btw, so you should take a whack at it yourself!
One thing that wouldn't have occurred to me that one of the Haskell geniuses I work with identified to use is the notion of a "free"/"operational" monad: https://apfelmus.nfshost.com/articles/operational-monad.html.
Re:Safety: A comparaison between Rust, C++ and Go
by unsafecast on Sunday July 31, 2022 @01:19AM
(#32293377)
Thanks a lot.
> None of it is really all that magical btw, so you should take a whack at it yourself!
Of course! It's always good to see how other people approach it though.
Basically we have a nice Haskell DSL for generating arbitrary C++, and we deal with lots of code you wouldn't want to write by hand (big nested switch statements and other kinds of state-machine logic, choices about loop unrolling, lots of template overloads, SIMD intrinsics that require immediate values, etc. etc.) so we write Haskell that generates C++ and feeds it to e.g. `clang`.
Some of this is directly in Haskell, and some of it is little compilers mostly done using Megaparsec. It's a really nice approach where it fits!