News for hackers. Stuff that matters.

Ask HN: Alternative to Go

With all the Go skeptics around on HN (not judging, just an observation), there must be a wealth of knowledge about similar (but "better") languages.

What I like about Go is: - excellent standard and public libraries - fast compile times (hot reloading is awesome) - easy distribution by cross compiling binaries that have no dependencies

Is there anything that has similar developer ergonomics as Go?

( 20 comments | 9 points | on HN )
Re:Ask HN: Alternative to Go by randombytes6869 on Wednesday July 08, 2020 @04:29AM (#23768009)
Java meets your requirements. It gets a lot of shit but there's reasons why its so widely used.

The standard libraries + community are larger than Go, you can find a library to do anything. Standard library is huge and mostly great.

Compilation time is a couple seconds even for huge projects. You can do automatic reloads using Gradle.

Its very cross platform, including one of the only good cross platform desktop UI's.

You can build smaller binary distributions using JLink or a multitude of third party tools.

Single binaries are overrated. Any app that's widely distributed uses an installer or package management anyways (brew,choco,apt)

Re:Ask HN: Alternative to Go by qppo on Wednesday July 08, 2020 @01:43PM (#23772260)
> Single binaries are overrated. Any app that's widely distributed uses an installer or package management anyways (brew,choco,apt)

Single binaries are easier to install and maintain even if you have to maintain an installer.

Re:Ask HN: Alternative to Go by dcminter on Wednesday July 08, 2020 @06:06AM (#23768476)
I'm a Java developer, but I take issue with your last point:

"Single binaries are overrated. Any app that's widely distributed uses an installer [...]"

That's true once you have the kind of traction where distro maintainers are going to consider packaging it themselves. But to attain that kind of popularity having a stand-alone binary is going to make a huge difference.

Unless you're willing to build all those packages/installers from scratch!

Re:Ask HN: Alternative to Go by karmakaze on Wednesday July 08, 2020 @03:46PM (#23773525)
My opinion is between these. A single binary is easier, and the java app deployment could be made better than it is now.

Currently I make an 'uberjar' that includes all java dependencies including Tomcat/Jetty/etc: java -jar my-app.jar

What's annoying is finding the desired JDK/JRE for each OS with the right license and manually installing it. Sometimes having to make some file fixes (e.g. OpenJ9 JDK & Maven compatibility).

Re:Ask HN: Alternative to Go by jetti on Friday July 10, 2020 @12:34PM (#23793263)
Another benefit of using the JVM is that you have a variety of languages to pick from that target the JVM and can interop with Java, which means you gain the benefits of all the libraries but also being able to experiment with other languages.
Re:Ask HN: Alternative to Go by dougbarrett on Wednesday July 08, 2020 @05:11PM (#23774270)
I've been developing Go web applications for the past 7+ years, some services getting billions of hits a day, and still have more than a handful running on various platforms currently.

In the past few days, I've been playing around with Kotlin because a client of mine is wanting an Android app developed, so I figure this is a good opportunity to dive right in. I have experience with Spring Java as well, not as the primary dev of the project, but I've written enough code to be comfortable with the process.

After being impressed with the process of writing Android apps in Kotlin, I decided to jump into Spring Boot + Kotlin and have been nothing but impressed. It's certainly different, but I'm feeling more productive than I was in Go because I can't say there is anything quite like it available in Go. I've tried Buffalo, but kept running into issues, and my typical go-to stack is Echo for the framework and Gorm for the MySQL library, but even then I need to pick my own tools for auth and caching.

The build time is certainly something to be desired, but with one of the more basic apps I'm writing for a client right now, it takes just a few seconds to compile, so it's certainly nothing to complain about at this point.

This is the tutorial I initially followed: https://spring.io/guides/tutorials/spring-boot-kotlin/ and swapping out the h2 database for mysql was pretty straightforward, and I was pleasantly surprised to see that I was able to have the app automatically set up the DB structure for me, similar to how AutoMigrate works with gorm.

Re:Ask HN: Alternative to Go by karmakaze on Wednesday July 08, 2020 @10:48AM (#23770384)
Perhaps Kotlin/Native. I've only used Kotlin which is exceeds my minimum expressiveness level for a go to default.

I prefer F# but is trickier to set up and less well used/documented/discussed. OCaml might fit the bill.

Re:Ask HN: Alternative to Go by JaggerJo on Wednesday July 08, 2020 @03:52PM (#23773575)
The F# community is amazingly helpful. Really helped me when I started learning it..

F# works great for GUIs. Startet that project about a year ago and it’s gaining traction. Not sure if something like this exists for OCaml ? (If so please let me know - would love to give it a shot)

https://github.com/AvaloniaCommunity/Avalonia.FuncUI

Re:Ask HN: Alternative to Go by karmakaze on Thursday July 09, 2020 @12:00PM (#23781640)
This is really cool! Look forward to trying it on my next project.
Re:Ask HN: Alternative to Go by mahaganapati on Wednesday July 08, 2020 @03:36AM (#23767767)
Depends on the use case... I was going to write something in Go the other day since I hadn't in a while, but instead it was easier to write a bash script.
Re:Ask HN: Alternative to Go by Gibbon1 on Wednesday July 08, 2020 @03:04AM (#23767604)
C# is a more mature and complete language than go. And always will be.

Microsoft also appears to be working towards support for gui support for macOS and linux.

https://devblogs.microsoft.com/dotnet/introducing-net-multi-...

Re:Ask HN: Alternative to Go by JaggerJo on Wednesday July 08, 2020 @03:48PM (#23773539)
there’s already Avalonia UI. (with FuncUI it also works great with F#)

https://github.com/AvaloniaUI/Avalonia

https://github.com/AvaloniaCommunity/Avalonia.FuncUI

Re:Ask HN: Alternative to Go by qlk1123 on Wednesday July 08, 2020 @03:34AM (#23767750)
Is the cross compiling flow of C# as transparent as GO?
Re:Ask HN: Alternative to Go by Gibbon1 on Wednesday July 08, 2020 @03:57AM (#23767858)
We hired another engineer so I haven't done any work with C# in the last couple of years. But maybe 5-7 years ago compiled a Windows Forms application with Xamarin under Linux and it worked with a couple of fixes.

I suspect that given that it's Microsoft if it works it'll just work.

Re:Ask HN: Alternative to Go by JaggerJo on Wednesday July 08, 2020 @03:45PM (#23773524)
consider F#. It’s a joy
Re:Ask HN: Alternative to Go by aprdm on Wednesday July 08, 2020 @04:41PM (#23774022)
C++ is becoming better and better adopting best practices from other languages. I get it comes with a lot of complexity but I don't see it going anywhere.

Could be an alternative.

Re:Ask HN: Alternative to Go by mraza007 on Friday July 10, 2020 @12:20AM (#23788107)
What resources would you suggest to learn or improve C++
Re:Ask HN: Alternative to Go by aprdm on Friday July 10, 2020 @04:37PM (#23796166)
I would start with a tour of C++, latest edition is C++18 Iirc and it mentions things from 2020.
Re:Ask HN: Alternative to Go by paktek123 on Wednesday July 08, 2020 @03:18AM (#23767674)
Nim looks very promising
Re:Ask HN: Alternative to Go by sigjuice on Thursday July 09, 2020 @01:41PM (#23782818)
What hot reloading? Aren't you just restarting processes? That has nothing to do with Go.