News for hackers. Stuff that matters.
Re:Tiobe Index: Go language at all time high and in the top 10 by kerkeslager on Sunday July 09, 2017 @07:52AM (#14729327)
It's a real shame that the programming industry has bought into the Go hype so readily. Don't get me wrong: the design decisions made by the Go team make lots of sense within the context of Google. But the vast majority of programmers don't have Google's problems of scale, and by using Go they give up many benefits of modern type-safe programming languages. There's a method to Google's madness, but for most development teams, adopting Go is imitating the madness without understanding the method.

Of course, this is extremely beneficial to Google: they get a community of people developing free libraries for them. But for the rest of us, it's an enormous drain of mindshare that could be devoted to more general-purpose languages.

Re:Tiobe Index: Go language at all time high and in the top 10 by rbehrends on Sunday July 09, 2017 @09:43AM (#14729691)
A major reason, in my opinion, is that Go addressed an actual need. And that is providing an imperative, GCed language with native compilation.

We've seen some more languages that cover this particular niche in recent years, but they aren't yet mature and/or lack backing.

The biggest problem here is garbage collection. Garbage collection (or other forms of automatic memory management) has traditionally been necessary for functional languages and (as a matter of practicality) popular for interpreters and JIT-compiled languages, but has often encountered hostility and rejection among users of imperative, natively compiled languages. Go was simply one of the first languages to hit that niche and reach a sufficient level of maturity.

Putting up with Go's idiosyncrasies then became simply a tradeoff.

Re:Tiobe Index: Go language at all time high and in the top 10 by kerkeslager on Sunday July 09, 2017 @09:53AM (#14729734)
D was fairly mature before Go was invented, so I'd credit Go's success to Google hype rather than the reasons you mentioned.
Re:Tiobe Index: Go language at all time high and in the top 10 by rbehrends on Sunday July 09, 2017 @09:56AM (#14729750)
Sorry, D's garbage collector is too limited to qualify. It is a stop-the-world, conservative collector with a history of performance problems [1].

And the fact that D development appears to be focusing on @nogc rather than fixing the GC issues also doesn't help.

[1] Such as https://pointersgonewild.com/2014/09/09/ds-garbage-collector...

Re:Tiobe Index: Go language at all time high and in the top 10 by curioustom on Sunday July 09, 2017 @08:08AM (#14729363)
Honest request - could you list the top benefits of modern languages people are giving up in favor of Go ?
Re:Tiobe Index: Go language at all time high and in the top 10 by kerkeslager on Sunday July 09, 2017 @08:50AM (#14729516)
Type checking, mainly. Lack of generics makes the type system fairly useless. Go generate works around the code duplication caused by no generics, but exacerbates the debugging problems.

This is a tradeoff, increasing bugs and debugging time in exchange for faster compilation. I believe the developers when they say this makes sense in a 1 billion line codebase like Google's, but I've worked on 1 million line codebases and at that size debug time vastly outweighs compilation time in i.e. C#. I'm actually in a good passion to evaluate this because I worked in both C# and Java with and without Generics. Most codebases are far fewer than 1 million lines.

There were other big problems with Go last time I checked, but I haven't looked at it much in a while, so I won't venture to say more since those things might have changed.

Re:Tiobe Index: Go language at all time high and in the top 10 by flashmob on Sunday July 09, 2017 @09:16AM (#14729586)
Type system is pretty cool in go. Particularly how the interfaces work, you don't have to explicitly declare that your object /type implements an interface, it automatically figures it out.

Lack of genetics makes the code easier to read. Much better with interfaces. Check this out http://blog.jonathanoliver.com/golang-has-generics/

Re:Tiobe Index: Go language at all time high and in the top 10 by kerkeslager on Sunday July 09, 2017 @09:35AM (#14729662)
Duck typing is admittedly nice.

The article you linked is deeply confused. He complains about a complicated generic type that he never encountered, and it's not clear if he's even used generics at all. He also says that if he needs to reuse something later he'll just implement an interface (huh?).

Re:Tiobe Index: Go language at all time high and in the top 10 by Silhouette on Sunday July 09, 2017 @10:06AM (#14729787)
Check this out http://blog.jonathanoliver.com/golang-has-generics/

I'm afraid that's not a well-informed article. The assumption that the main use case for generics is collections is very limiting, for example. That might have been one of the original motivations, but today generic types are widely used for countless data structures and algorithms, and even modelling entire patterns of computation in languages like Haskell. They let you prove a lot more useful properties than just not inadvertently trying to pull a foo out of a set of bars.

Re:Tiobe Index: Go language at all time high and in the top 10 by rbehrends on Sunday July 09, 2017 @09:31AM (#14729646)
> Check this out http://blog.jonathanoliver.com/golang-has-generics/

The author makes the common mistake of assuming that subtype polymorphism can be a full replacement for parametric polymorphism. It isn't, and neither is parametric polymorphism a replacement for subtype polymorphism.

Re:Tiobe Index: Go language at all time high and in the top 10 by hokkos on Sunday July 09, 2017 @01:01PM (#14730636)
The blog author cannot even mocks generics right, in C# the string type in not a generic type. He recognize generics are good for map, list, but it is ok that users can't declare their own without explanations, only vague caricatures. Go community is all about choice-supportive bias (aka post-purchase rationalization).
Re:Tiobe Index: Go language at all time high and in the top 10 by cannabis_sam on Sunday July 09, 2017 @06:34PM (#14732087)
Check this out: https://commandcenter.blogspot.com/2012/06/less-is-exponenti...

Particularly this:

>Early in the rollout of Go I was told by someone that he could not imagine working in a language without generic types. As I have reported elsewhere, I found that an odd remark.

>What it says is that he finds writing containers like lists of ints and maps of strings an unbearable burden. I find that an odd claim. I spend very little of my programming time struggling with those issues, even in languages without generic types.

>But more important, what it says is that types are the way to lift that burden. Types. Not polymorphic functions or language primitives or helpers of other kinds, but types.

>Programmers who come to Go from C++ and Java miss the idea of programming with types, particularly inheritance and subclassing and all that. Perhaps I'm a philistine about types but I've never found that model particularly expressive

(He then continues to rant about inheritance, without mentioning generics again.)

So basically, Go does not have Generics and one of the creators justified it by conflating subtype polymorphism, parametric polymorphism and ad-hoc polymorphism (inheritance, generics and interfaces in oop terms).

I happen to agree with Rob Pike that inheritance is a bad way to model things in most cases, but that's a non-sequitur argument against generics.

I also think his arguments about composition is weak, especially compared to how function composition works in Haskell. The Doug McIlroy-quote he pulls out fits great with point-free style haskell, and parametric polymorphism/generics is extremely useful for this.

(To be fair, he has since said that it is a weakness that might change: https://blog.golang.org/slices )

Re:Tiobe Index: Go language at all time high and in the top 10 by puobelle on Sunday July 09, 2017 @12:53PM (#14730609)
Re:Tiobe Index: Go language at all time high and in the top 10 by Arzh on Sunday July 09, 2017 @09:16AM (#14729584)
Generating the code leads to a lot easier debugging for me. In C++ debugging generics are annoying to put breakpoints in, since it is harder to hit the exact implementation I want (VS has a way to do this but it is a little annoying to get right). I don't mind doing that because all too often I've seen a 'generic' implementation gain more and more flags to make it less and less generic. I've only ever needed to do that a few times, the built in containers cover 95% of what I need. I came to go because I was formulating an opinion of c++, java, javascript etc and they aligned very closely to what the main team of three guys were talking about when they were first releasing it. Most of the time I never scale the application but I still love the way to solve problems in go, especially when I'm doing something in a concurrent manner.

I've also had a large (5M+ lines) C++ project that would need to be complied 3-4 times to do things like CI and automated testing. So each build taking 1-1.5 hours, which is not crazy, because of rebuilding code that is static 99% of the time mean that it is worth it to me.

Re:Tiobe Index: Go language at all time high and in the top 10 by rbehrends on Sunday July 09, 2017 @09:27AM (#14729629)
C++ templates are a very idiosyncratic way of doing parametric polymorphism, and the C/C++ compilation model is even more idiosyncratic. You cannot make general statements about parametric polymorphism based on that.
Re:Tiobe Index: Go language at all time high and in the top 10 by Arzh on Sunday July 09, 2017 @10:52AM (#14729971)
Everything I said was based on my experience with C++, I was making pointed statements not general ones.
Re:Tiobe Index: Go language at all time high and in the top 10 by kerkeslager on Sunday July 09, 2017 @09:24AM (#14729618)
It's 2017. C++ was invented in 1984.

Just because a 33-year old language has problems doesn't mean Go is the best solution.

Re:Tiobe Index: Go language at all time high and in the top 10 by Arzh on Sunday July 09, 2017 @10:57AM (#14730004)
I find that go is the best solution for my problems
Re:Tiobe Index: Go language at all time high and in the top 10 by yazr on Sunday July 09, 2017 @11:52AM (#14730298)
Can you please comment on this code base ? Which tools / build chain r u using ? Did the actual compile take 1hr or the full CI/test ?

Did u try use any parallelization ? I am curious because i am working on a "smart" parallelizer builder

Re:Tiobe Index: Go language at all time high and in the top 10 by Arzh on Sunday July 09, 2017 @01:56PM (#14730862)
Yeah each build would take about an hour, 4-5 hours for the whole CI/test to get finished. It was crossed complied so there was an MSBuild and a gcc build. It was sone in serial since we didn't want to waste time building the release if the testing or QA builds failed.
Re:Tiobe Index: Go language at all time high and in the top 10 by di4na on Sunday July 09, 2017 @09:35AM (#14729660)
Memory isolation. Goroutines are really a poor man Actor.

Error handling and control of the flow. Functions as first class citizens with real closure.

Dynamic tracing.

Etc etc

Re:Tiobe Index: Go language at all time high and in the top 10 by curioustom on Sunday July 09, 2017 @11:08AM (#14730051)
Thanks! Is there a language which mostly has those but also has some of the benefits of Go?
Re:Tiobe Index: Go language at all time high and in the top 10 by di4na on Sunday July 09, 2017 @01:57PM (#14730871)
Erlang and Elixir and all languages on the BEAM. Haskell, Ocaml and Rust on recent linux kernel or on freeBSD/Illumos OS.

But i do know what are the advantage of Go you want because i personally do not see a lot in it. Different pov i guess.

Re:Tiobe Index: Go language at all time high and in the top 10 by hu3 on Sunday July 09, 2017 @08:21AM (#14729411)
You really think Google's scale actually benefits significantly from comunity libraries?

At that scale it must be a nitghmare to use third party code. Hell they even invented their own system programming language.

Re:Tiobe Index: Go language at all time high and in the top 10 by kerkeslager on Sunday July 09, 2017 @09:03AM (#14729551)
Of course. They don't have to import a library as a package, as most are BSD they can just use the code. And even if they use dependencies, dependency management can be simplified by only importing mature, conservative libraries. Most problems developers have with dependencies are caused by importing every 0.x versioned library in i.e. NPM and plugging together a bunch of buggy leaky abstractions.
Re:Tiobe Index: Go language at all time high and in the top 10 by randomdata on Sunday July 09, 2017 @11:20AM (#14730110)
The problem with all those modern type-safe programming languages is that they all use modern programming idioms. In reality, the market just wanted another C, the 2nd place language in this list, without the parts that make it especially dangerous to use. Go came the most close to providing that, and thus it started to see adoption in that market.
Re:Tiobe Index: Go language at all time high and in the top 10 by ice109 on Sunday July 09, 2017 @08:19AM (#14729404)
umm I chose go exactly because it has a type system. what's another "modern" type safe language that's as convenient as go? kotlin? c#?
Re:Tiobe Index: Go language at all time high and in the top 10 by boubiyeah on Sunday July 09, 2017 @08:37AM (#14729459)
Also: Scala, TypeScript, F#
Re:Tiobe Index: Go language at all time high and in the top 10 by 43224gg252 on Sunday July 09, 2017 @08:47AM (#14729505)
I've only used Scala and TypeScript. TypeScript is crap compared to Go. It's yet another abstraction layer on top of javascript and it's much slower and even more difficult to program with than Go. There's no point in using TS when Go is there.

Scala is yet another language running on a JVM and its syntax is almost as bad and clumsy as Java. Most benchmarks put it on par with Go in terms of performance.

I just don't see a point in using these languages when Go is just as capable, more simple, compiled to binaries (and can even run on bare metal in some cases), runs on more platforms, has much better editor support, and is just more fun to use in general.

Re:Tiobe Index: Go language at all time high and in the top 10 by Others on Sunday July 09, 2017 @09:10AM (#14729572)
Scala has its problems, but it is not anywhere near as clumsy as Java. Where Scala falls flat is implicitness, an overabundance of features, and extreamly dense syntax for very high levels of abstraction. Its syntax is actually quite nice, with relatively few warts. I find it a joy to write, and very fluid.
Re:Tiobe Index: Go language at all time high and in the top 10 by c_shu on Sunday July 09, 2017 @09:55AM (#14729749)
Scala is too complicated. It reminds me of C++. But C++ is fast. People use it probably when performance is their first priority.

For practical reasons I just bear with C++. Use it as necessary.

I would rather not bear with another complicated language, unless there are compelling reasons.

I think it's unlikely that Scala can be useful to me in the near future, because there are so many good alternatives.

Re:Tiobe Index: Go language at all time high and in the top 10 by ice109 on Sunday July 09, 2017 @09:15AM (#14729580)
>Scala

functional language with hoards of issues

>TypeScript

javascript

>F#

essentially vendor locked to windows

Re:Tiobe Index: Go language at all time high and in the top 10 by moogly on Sunday July 09, 2017 @10:07AM (#14729789)
>>F# >essentially vendor locked to windows

If you by "essentially" mean "not at all". You've been able to run F# on Mono for ages, and now you can run it on either Mono or .NET Core.

Re:Tiobe Index: Go language at all time high and in the top 10 by fiedzia on Sunday July 09, 2017 @10:22AM (#14729844)
> You've been able to run F# on Mono for ages

But you wouldn't want to, because for a very long time Mono was horribly buggy, and no library or application cared for supporting it. It may be better now in terms of .Net itself, I am not sure how it looks like in terms of community support for non-windows usage.

Re:Tiobe Index: Go language at all time high and in the top 10 by ice109 on Sunday July 09, 2017 @11:51AM (#14730285)
i have a running f#/mono environment on this computer. on my other computer i cannot get it to work. things like this

https://stackoverflow.com/a/41578645/6767912

and this

https://github.com/NuGet/Home/issues/2880

tells me it's not production ready (yes i've even tried compiling mono from source).

Re:Tiobe Index: Go language at all time high and in the top 10 by kerkeslager on Sunday July 09, 2017 @09:19AM (#14729598)
Arguably every language has a type system. Go provides only the most rudimentary type checking.

I was lamenting that so much mindshare is devoted to go instead of a more general purpose language, not claiming there's a more convenient language. If that mindshare had been devoted to another language, there's no telling what language would be as convenient as go. But most developers care about more than convenience.

Re:Tiobe Index: Go language at all time high and in the top 10 by ice109 on Sunday July 09, 2017 @09:23AM (#14729614)
>But most developers care about more than convenience.

indeed

Re:Tiobe Index: Go language at all time high and in the top 10 by crdoconnor on Sunday July 09, 2017 @10:04AM (#14729780)
I don't think they necessarily have. TIOBE is just a crappy index. PYPL is better:

https://pypl.github.io/PYPL.html

Re:Tiobe Index: Go language at all time high and in the top 10 by notacoward on Sunday July 09, 2017 @10:18AM (#14729826)
I'm not sure that an index based on availability of tutorials is really an improvement. It's explicitly targeting a subset of the whole programming population.
Re:Tiobe Index: Go language at all time high and in the top 10 by crdoconnor on Sunday July 09, 2017 @10:30AM (#14729882)
It's based upon volume of searches for tutorials, not availability.

It's a leading indicator rather than an overall measure of popularity.

Re:Tiobe Index: Go language at all time high and in the top 10 by notacoward on Sunday July 09, 2017 @11:41AM (#14730227)
"Availability of tutorials" vs. "searches for tutorials" doesn't affect the point. It's still selecting a subset of programmers. While it's somewhat useful as a leading indicator of popularity over the next couple of years, it's less so w.r.t. either the present or the further future. I'm not saying it has no value at all, but it's not clearly a substitute - let alone a superior substitute - for surveys that measure other things.
Re:Tiobe Index: Go language at all time high and in the top 10 by bostand on Sunday July 09, 2017 @10:01AM (#14729773)
Malware creators have switched to golang because it makes it very easy to write platform independent networked code.

You are fighting a lost battle, go has already won

Re:Tiobe Index: Go language at all time high and in the top 10 by lostmsu on Sunday July 09, 2017 @12:10PM (#14730412)
AFAIK last week's Petya is in C#.