News for hackers. Stuff that matters.
Re:How generics are implemented in Go 1.18 by mahesh-hegde on Wednesday March 02, 2022 @03:18AM (#30525071)
AOT compiler; single binary; standard library and package ecosystem well suited for a subset of programming tasks, while being much lightweight and less verbose than Java / C#.

Would not pick Go to make a website. But it's probably best tool to make a simple HTTP server or command line tool that deals with files or network.

Re:How generics are implemented in Go 1.18 by pjmlp on Wednesday March 02, 2022 @03:56AM (#30525304)
Java has AOT compilers since 2000, they just weren't free beer.

.NET was released with AOT compiler, although it only did dynamic linking (NGEN).

Mono always supported AOT compilation, just like the C# dialects for Singularity, Midori, and .NET Native for Windows 10 UWP.

Re:How generics are implemented in Go 1.18 by mahesh-hegde on Wednesday March 02, 2022 @04:06AM (#30525359)
> Java has AOT compilers since 2000, they just weren't free beer.

"just"

Tell me how me, a student in India with a cheap plastic laptop running Linux, could get straightforward access to some AOT compiler produced by some commercial company in north pole or somewhere.

Open source compilers got popular for a reason.

Now we have graalvm, but getting something running with graalvm is not always straightforward. Even with a full framework like quarkus I have had to use escape hatches @RegisterForReflection. Usability matters. And Go was built from day 1 with AOT in mind.

And lastly Go has better built-in / first-party supported APIs for file I/O, networking etc.. Subjective thing, I guess. When I want to make a database backed website, I reach for spring boot or vert.x; But Go wins for CLI stuff.

I don't know much about C# because I primarily work on Linux.

Re:How generics are implemented in Go 1.18 by pjmlp on Wednesday March 02, 2022 @04:21AM (#30525425)
Like always, on a street bazaar, or are you going to tell us they don't exist?
Re:How generics are implemented in Go 1.18 by mahesh-hegde on Wednesday March 02, 2022 @05:11AM (#30525703)
I don't think some obscure company's compiler for Java would be being sold on streets of Bangalore, much less likely in affordable price, much less likely in smaller towns.

And, to reiterate, usability matters, defaults matter. Cannot compare 'there existed some obscure vendor who sold an obscure feature in an obscure corner of Europe or Canada', with a mainstream programming language sponsored by a big tech having a good-enough default toolchain adopted by many companies and has lot of jobs;

Re:How generics are implemented in Go 1.18 by pjmlp on Wednesday March 02, 2022 @05:17AM (#30525746)
My experience, the catalogues used to be quite big and it was only a matter of time to get whatever.

Then again, maybe things changed in 20 years.

The technology for doing JIT caches on OpenJDK comes from J/Rockit, while OpenJ9 comes from IBM Websphere.

From 2000 to 2009, Red-Hat used to have an Eclipse version compiled with gjc.

Hardly obscure vendors.

Re:How generics are implemented in Go 1.18 by Mawr on Wednesday March 02, 2022 @06:38PM (#30535052)
> Java has AOT compilers since 2000, they just weren't free beer.

Commercial offerings are quite obviously not comparable to free ones.

Seems like Java can't really do AOT, even in 2022: https://news.ycombinator.com/item?id=30444454

Now, I say "really", because this is not about whether you can technically compile Java AOT or not. It's about the level of support - in Go AOT compilation is first-class. In Java, you're stuck looking through multiple second party options, some paid, some with caveats, bugs, etc.

First-class vs second-class support makes a massive difference.

As an example, this is like seeing "Go's advantage over java is its autoformatter - gofmt" and responding "Well, Java has autoformatters too!". Technically true, but irrelevant - in the real world, gofmt is used on 90%+ Go projects. The few Java projects that do use autoformatting each use a different formatter with different sets of rules. First-class vs second-class.

Re:How generics are implemented in Go 1.18 by kaba0 on Wednesday March 02, 2022 @06:40AM (#30526199)
Actually, there used to be GCJ which was a free AOT compiler for Java
Re:How generics are implemented in Go 1.18 by madmax96 on Wednesday March 02, 2022 @07:02AM (#30526379)
GCJ had compatibility issues. It never supported Java 1.5. It also couldn’t handle static linking properly. For a large-scale project it usually wasn’t an option.