Hacker News new | past | comments | ask | show | jobs | submit login

Even if performance matter Go should be a better choice. Go's performance is very close to rust in Web ecosystem and is very mature.

That’s just not true. More mature, sure. But the language experience couldn’t be more different between the two, and that counts. I don’t wanna be wasting my time with quirkiness.

I like Rust and everything, but pretending it’s going to get the job done faster than Go is just that—pretending. If you don’t like Go’s developer experience, then fine (and understandable when the alternative is Rust), but it’s not wasting time IMO.

Writing a for loop every time you need to iterate over a collection is wasting time.

My ratio of writing to debugging has never been such that the difference between for and forEach ever mattered. That being said, debugging complex go code bases 5 years ago (when I last was doing this daily) was less fun than other languages (their armory stocks a nice assortment of footguns and the debugging support was... minimal. Might have changed since then.)

I think he's referring to the "functional" stye APIs which let you write code that looks a lot like operating on java collections with streams. It's actually pretty great, I definitely miss it in other languages.

Did Delve exist 5 years ago? I find Delve to provide a great debugging experience for Go applications. Might be worth checking out if anyone found concern with that comment.

The first tagged release on Delve's GitHub is from 2014, but I have no idea if it was public at the time or not.

Is it possible that there are other factors that could take even more time than writing a little boilerplate? Maybe dueling with the borrow checker?

It's a tradeoff. I'd rather duel with the borrow checker a little bit every day then have a long debugging session figuring out where's a missing copy causing values taken from a map to be not available - that is a fun multi-hour challenge sometimes.

That’s perfectly reasonable if you’re writing lots of parallel code, but frankly 95% of web server code isn’t the sort of hairy parallel code that would benefit from a borrow checker on balance.

There are no threads in this scenario. You can easily lose ownership / crash on bad references when using golang maps in a single thread.

How do you get "bad references" in a Go map in a single thread? Are you thinking of nil pointers? That's a separate issue.

It’s not pretending. In fact, web application hosts are a great candidate for replacement with faster languages because it can have an immediate impact on infra costs.

Reducing infra costs are rarely the largest opportunity for an organization, and even then the majority of infra waste is typically unrelated to language. Moreover, trading iteration velocity (and/or rewriting your application) for some marginal infra cost improvement is not a very good approach.

Or C# with ASP.NET Core which is much closer to rust in performance.

> Or C# with ASP.NET Core which is much closer to rust in performance.

I haven't noticed that C# is faster than Go, or that it's as fast as Rust/C++. Except in selected micro-benchmarks, of course.

C# is at best in the same bracket as Go: https://www.techempower.com/benchmarks/#section=data-r19&hw=...

In my experience ASP.NET and its frameworks are potentially much slower than raw C#. As much as C# is supposed to be a fast language, whenever I run into a C# web app it seems to be inexplicably slow.

I'm not sure why anyone would be downvoting your data point. I am pretty bothered at how much emphasis folks throw behind the TechEmpower benchmarks. If you really dig into the implementations for the top languages, it's easy to see how far from the real world, those apps are. In the case of C#/ASP.NET, as soon as you add EntityFramework (or Dapper, if that's your thing) and some real-world querying of a database. You're looking at a pretty big slow-down. I'm certain things can be done to speed it up though.

The fastest .Net based library scores a 58%, while a framework based on Go scores 52%. The weights are arbitrary, so can't infer a lot from the 6% delta between .Net and Go - except that they compare favorably with each other in terms of performance.

The fastest .NET library is ASP.NET Core, which is a standard, mature, off the shelf framework.

Compared to the golang version using fasthttp, which is non-standard and makes compromises to achieve speed, and I'd avoid it for production.

Is that free in any way?

C# or ASP.NET Core never costed anything. The cost is in certain versions of Visual Studio, but that is not required. Besides Visual Studio, Visual Studio Code is popular too.

I can recommend Jetbrains Rider [1] for anything C#. I prefer it over Visual Studio even.

[1]: https://www.jetbrains.com/rider/

Is it also free to deploy? Can you deploy it on Linux?

Yes. It is also fairly straightforward to dockerize dotnet core apps[0].

[0] https://docs.docker.com/engine/examples/dotnetcore/

It's free in all the ways

The C# compiler roslyn, the dotnet runtime (Jit compiler, ...), and ASP NET Core are all MIT or Apache licensed and run officially supported on mac os, linux and windows.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact