News for hackers. Stuff that matters.
Re:Rust – A hard decision pays off by sharno on Wednesday August 24, 2022 @03:00PM (#32584141)
I'd argue that C# (dotnet core) is a much better option than Go for an easy GC language with max productivity and great performance ceiling.
Re:Rust – A hard decision pays off by throwaway894345 on Wednesday August 24, 2022 @05:10PM (#32585804)
I haven't worked with C# since ~2013, but I mostly liked it. I'm sure it's a different beast now though. Some things I prefer about Go:

1. Tooling. `go build` just needs a `go.mod` file with a list of dependencies. There's no MSBUILD stuff (I think dotnet had a similar JSON file format, but then went back to MSBUILD?)

2. Runtime. I love that Go's default is static, native binaries, and that the ecosystem revolves around that. I especially love that this enables ~2mb Docker images. (I'm of the impression that you can do this in dotnet, but it's not clear to me how easy it is in practice or if there are performance tradeoffs)

3. Value types. Go doesn't have a classes; everything is a struct, and polymorphism and so on work on structs.

4. No inheritance. I'm pretty militantly opposed to inheritance. I know you don't have to use it in C#, but in Go I also don't have to deal with APIs or coworkers that assume inheritance.

That said, these aren't major things; I'm sure C# is a great language in general, and I'd definitely reach for if I wanted to make a Windows GUI app.

Re:Rust – A hard decision pays off by CharlieDigital on Thursday August 25, 2022 @08:04AM (#32592562)
1. `dotnet build` requires a .csproj file. It's XML based (they tried a JSON based format a few years back, but reverted to XML).

C# and .NET's main strength, IMO, is the web API framework and general purpose utility; everything from web apps to Unity and Godot. It's easy to start with `dotnet new webapi -minimal` will give you a scaffolded project which is pretty similar a barebones Express or Flask app. But you get much more headway and scalability and the room to layer more complexity as needed.

It's main detriment is, as you mentioned, the need for a somewhat heavy runtime and the relatively slow cold starts which make it a poor choice for things like CLI tools and serverless functions.

Re:Rust – A hard decision pays off by labrador on Wednesday August 24, 2022 @03:45PM (#32584758)
C# 2022 is much improved over earlier versions. For starts it's cross platform and compiles to reasonably sized single executables (touted as a strength of Go). Moreover, C# designers have started reducing boilerplate as much as possible, so for example, you don't need to declare a namespace, a class or a main to start coding.

That said, Go is a fine language. It doesn't have exceptions last I checked, so that could be a deciding factor. Exceptions are handy in a lot of cases.

Re:Rust – A hard decision pays off by nly on Wednesday August 24, 2022 @06:45PM (#32586838)
Garbage collector is still a steaming pile though
Re:Rust – A hard decision pays off by hu3 on Wednesday August 24, 2022 @10:24PM (#32588667)
Source? I thought .NET GC was tuned for high throughput.

Their performance is, impressive, to say the least.

https://www.techempower.com/benchmarks/#section=data-r21

Re:Rust – A hard decision pays off by nly on Thursday August 25, 2022 @04:12AM (#32590987)
It has terrible latency characteristics
Re:Rust – A hard decision pays off by throwaway894345 on Thursday August 25, 2022 @09:47AM (#32593646)
IIRC it also doesn’t do much/any escape analysis, so ~everything ends up on the heap as an individual allocation (except for values), putting even more pressure on GC.
Re:Rust – A hard decision pays off by metaltyphoon on Wednesday August 24, 2022 @03:20PM (#32584424)
Not only that, but greater tooling too.