What does HackerNews think of bflat?

C# as you know it but with Go-inspired tooling (small, selfcontained, and native executables)

Language: C#

I've been wondering how to integrate modern .NET Core into a custom build system (buck2) and was wondering similar things. There's this project I think is cool called bflat[1] that basically makes the C# compiler more like the Go compiler in the sense it's a one-shot single-use tool that can cross compile binaries natively. It's done by one of the people on the .NET Runtime team as a side project, and quite neat.

I mostly use Visual Studio but I think in practice you're supposed to compile whole .dll's or assemblies all at once, which acts as the unit of compilation; I don't think the csharp compiler generates native object-files-for-every-.cs or translation unit, the kind of approach you'd expect from javac or g++. Someone please correct me if I'm wrong though! I'd like to learn more if there's a more granular/incremental unit of compilation.

Since Roslyn and the compiler itself are mostly a library, maybe you could also write your own custom "csc-for-bazel" compiler or something to sort of bootstrap the whole thing and offer tighter integration...

.NET 8 will support Native AOT on macOS, I think.

[1] https://github.com/bflattened/bflat

We changed the URL from https://github.com/bflattened/bflat to the project page. Both are nice, but the project page is more unique. Yes I know you can't be "more unique".
I feel like the "Java" way of doing things in C# is simply a byproduct of inertia and outdated habits. You can model domain with records in C# in a very concise manner (F# style), you can pass around raw memory slices with Span. Writing simple CLI tools is incredibly easy with top-level statements and implicit usings, or even using bFlat [0] or ProcessX/Chell [1, 2].

[0]: https://github.com/bflattened/bflat

[1]: https://github.com/Cysharp/ProcessX

[2]: https://github.com/mayuki/Chell