News for hackers. Stuff that matters.
Re:Go and Simplicity Debt Redux by kmicklas on Sunday June 18, 2017 @03:26PM (#14582377)
Basically all these articles about Go make it sound like it was designed to be some kind of teaching language with a low conceptual barrier to entry, except Google intends it to be used in real settings, which is the problem.
Re:Go and Simplicity Debt Redux by nickpeterson on Sunday June 18, 2017 @05:34PM (#14583079)
Go is designed to minimize the cost of bad programmers. It's a decent idea, and likely scales better than languages that try to maximize the value of great programmers (lisp,Haskell,etc).
Re:Go and Simplicity Debt Redux by kelseyfrancis on Sunday June 18, 2017 @07:55PM (#14583678)
The part of this argument I don't really understand is that it seems like the cost of bad programmers is higher, not lower, with a "simple" language where it's _normal_ to have type-unsafe code and mutable state everywhere.
Re:Go and Simplicity Debt Redux by kjksf on Sunday June 18, 2017 @09:24PM (#14584019)
Go is type safe (unless you use "unsafe" package, that is, but it's no different from Rust).

Or show me how you would subvert Go's type system and tell me which language you're comparing it to that wouldn't allow similar type system subversion. And no moving goal posts, please. "Type safe" has a certain meaning.

The value of immutability is so overblown, as shown by literally every mainstream language being mutable by default.

Not to mention the perf cost of immutability.

For just one example see https://ayende.com/blog/164739/immutable-collections-perform... (immutable version of dictionary is 30x slower, immutable list is 16-32x slower).

I'm not cherry-picking. This is just the first search result. If you understand how immutability works from first principles, it just does much more work.

Ultimately I wouldn't describe Go as "minimizing bad programmers" but "minimizing a damage that well intentioned but ultimately mis-guided good programers can do to the codebase".

For example I believe that your enthusiasm for immutability is well intentioned but I would rather not take 30x perf hit for theoretically safer code.

Bad programmer will write a bug that can be fixed.

A mis-guided good programmer will write a compile-time parser that only he can understand (possibly only for a week after writing it), will baloon compile times, produces incomprehensible error messages and you won't be able to convince him that a standard recursive-descent parser is 10x simpler to write and read.

Go prevents mis-guided smart programmers from inflicting too much pain on everyone else.

Re:Go and Simplicity Debt Redux by mrkgnao on Monday June 19, 2017 @07:39AM (#14586127)
Good compilers don't keep immutable things immutable at runtime, but turn uses of clean high-level functional code into tight C-like loops.

https://donsbot.wordpress.com/2010/02/21/smoking-fast-haskel...

It's been seven years since: that's GHC 6.13, and GHC 8.2.1 is being released soon. Performance is even better now as long as laziness doesn't bite you (which is much less rare than people think).

> you won't be able to convince him that a standard recursive-descent parser is 10x simpler to write and read

I don't know what a "compile-time parser" is, but someone used to a good parser combinator library is going to be difficult to convince.

http://www.haskellforall.com/2017/06/translating-c-parser-to...

It reads like the formal spec of the language. Hand-writing recursive descent parsers isn't fun (given a sufficiently complex grammar) and expecting people to accept it as the One True Practical Non-Ivory Tower Way (and expressing dismay at not being able to convince them otherwise) is suggestive of monoculture, the kind that prides itself on copying code and using wrappers over the two or three first-class data structures that exist in the language for everything.

Re:Go and Simplicity Debt Redux by kelseyfrancis on Monday June 19, 2017 @02:20PM (#14589100)
> Go is type safe

Functions that accept or return the interface{} type are not type-safe. These are _common_.

Re:Go and Simplicity Debt Redux by comex on Sunday June 18, 2017 @03:38PM (#14582442)
Go is designed to be a language with a low conceptual barrier to entry; that’s quite evident from its design. That doesn’t mean it’s just a “teaching languge”, or if it does, you’ll have to explain that to all the people happily using it in production.
Re:Go and Simplicity Debt Redux by coldtea on Sunday June 18, 2017 @05:09PM (#14582950)
>or if it does, you’ll have to explain that to all the people happily using it in production.

Easy concurrency.

Good tooling.

A handy standard library.

Static compiles.

The hype of a "Google language".

You don't need "low conceptual barrier" or anything particularly beautiful about its design to explain its success.

Those are the reasons I use it too.

Re:Go and Simplicity Debt Redux by kjksf on Sunday June 18, 2017 @09:03PM (#14583922)
Some of those things are a direct result of Go's simplicity.

Good tooling in particular is available because Go syntax is deliberately simple. It's simple for humans and simple for tools.

Go shipped with Go parser in standard library from day 1. Go syntax hasn't changed from that day.

Having Go parser in standard library means that building tools like go get, linters, auto-formatters, code coverage tools etc. is very simple.

Contrast that with C++ or Rust or Swift.

A C++ parser alone (clang) is probably a bigger project than the whole Go compiler. Rust and Swift don't even have a stable syntax yet and as far as I know they don't have the equivalent of Go's ast package.

If Go didn't aggressively tame complexity then it would have ended the same way as Rust or Swift. Sure, it would have generics, but also slow compilation time, language that takes years to reach stability, tooling that is exponentially more difficult to write etc.

That's engineering: making decision about what is more important and accepting that less important things have to be dropped.

If features are most important, then you accept complexity. See Rust or Swift.

If simplicity is most important, then you accept less features. See Go.

I for one am glad that I have a choice.

I would rather have Go than a third language driven by the same ideas and priorities as Rust or Swift.

Re:Go and Simplicity Debt Redux by steveklabnik on Monday June 19, 2017 @01:13PM (#14588557)
Rust does have a stable syntax, or at least, by "stable" I mean it only changes in backwards compatible ways.

https://crates.io/crates/syn is the most popular parser crate at the moment.

Re:Go and Simplicity Debt Redux by geodel on Sunday June 18, 2017 @06:57PM (#14583457)
"Google language" is Dart and it does have generics. So low conceptual barrier seems reasonable reason for success. Rust does have all features you listed and of course generics. Both started around 2009 so it is about same age as Go but not as popular among developers.
Re:Go and Simplicity Debt Redux by coldtea on Monday June 19, 2017 @02:33AM (#14584950)
>"Google language" is Dart and it does have generics.

Only Google never made a good job at promoting it, and it's a dynamic language meant as a better-JS, so not the same market as Go.

>Rust does have all features you listed and of course generics. Both started around 2009 so it is about same age as Go but not as popular among developers.

Rust took until 2-3 years ago to finalize its design and be stable. Go was already stable for years by that point.

And Rust comes with an uncommon, and hard to grasp at first, memory management model which stops many in their tracks -- it's not the presence of generics (or traits, or option types or whatever) that's the issue.

Re:Go and Simplicity Debt Redux by ngrilly on Monday June 19, 2017 @05:54AM (#14585700)
I like programming in Go, but I don't understand the downvote on your comment. And I agree that Rust adoption is slowed more by the memory management model than type parametricity.
Re:Go and Simplicity Debt Redux by pjmlp on Monday June 19, 2017 @01:31AM (#14584779)
There are other factors, like Go compiles to bare metal while Dart was targeted to replace JavaScript on the web, which is pretty much impossible.

Additionally Dart was betrayed by Google's own teams that decided to invest in TypeScript instead.

Re:Go and Simplicity Debt Redux by wtetzner on Sunday June 18, 2017 @11:16PM (#14584414)
> Both started around 2009 so it is about same age as Go but not as popular among developers.

They didn't hit 1.0 (and the corresponding backwards compatibility guarantees) at the same time.

Re:Go and Simplicity Debt Redux by kmicklas on Sunday June 18, 2017 @04:37PM (#14582783)
Of course you can find people using all manners of languages/systems in production. That doesn't mean they are well designed. And I don't think it's necessary for me to reiterate at this point why Go is poorly designed.
Re:Go and Simplicity Debt Redux by Thaxll on Sunday June 18, 2017 @04:44PM (#14582821)
And yet Go is used by more and more large project / compagnies where supposing superior languages are nowhere because way too complex.
Re:Go and Simplicity Debt Redux by coldtea on Sunday June 18, 2017 @05:09PM (#14582951)
Well, it's used by 1/10 to 1/100 the number of large project/companies that C++, Java, and C# are used.

So there's always that.

Re:Go and Simplicity Debt Redux by gribbly on Sunday June 18, 2017 @07:37PM (#14583619)
It's also a MUCH younger language than those you listed, that said I don't think Go or any other of the 'new languages on the block' will reach anything near the wide use of languages like C++ or Java, atleast not in my lifetime.
Re:Go and Simplicity Debt Redux by coldtea on Monday June 19, 2017 @02:26AM (#14584922)
Well, Java had that wide an adoption (in the enterprise) already 10 years after it was introduced. It appeared on 1995 -- but 2005 it was already the de-facto enterprise backend language.

Ditto for C#, but of course C# was pushed by MS as the native solution for Windows, a platform that already had 95% market share.

Re:Go and Simplicity Debt Redux by geodel on Monday June 19, 2017 @09:08AM (#14586614)
1995-2005 was the time when traditional IT industry grew to such humongous proportion. Global delivery model, offshore development and so on were developed during that time. So either way Java/C# came at right time or IT industry grew due to them. Lots of new software and users were created which did not exist before and not the wholesale rewrite of pre-existing software else e.g. COBOL could have gone from banking sector.

So asking Go to be popular as Java in 10 years is to live up to expectation that past languages weren't asked.

Re:Go and Simplicity Debt Redux by kmicklas on Monday June 19, 2017 @10:41AM (#14587314)
It's more than anything because of Google's clout, and secondarily the general worse-is-better fetish in tech.

Go actually just pushes all the complexity into the code you write with it, so I don't buy that that is the reason.

Re:Go and Simplicity Debt Redux by computerex on Sunday June 18, 2017 @03:34PM (#14582416)
What articles are you talking about? This couldn't be further from the truth. Go is a practical language meant to be used in production settings. It's not a haskell. For example, it's support for protocol buffers is second to none imo.
Re:Go and Simplicity Debt Redux by chowells on Sunday June 18, 2017 @04:01PM (#14582580)
Err. Why do you think Haskell isn't intended to be used in production settings?
Re:Go and Simplicity Debt Redux by nvarsj on Sunday June 18, 2017 @05:13PM (#14582981)
Well, it wasn't. Haskell was designed primarily as a test bed for writing language features to support PhD theses. The great success of Haskell is the amount of new language ideas it generated, which we now see in many other places.
Re:Go and Simplicity Debt Redux by chowells on Sunday June 18, 2017 @07:21PM (#14583559)
Being a real-world language was absolutely one of the design goals of Haskell. See point 1 of section 2.4 in "A History of Haskell: Being Lazy With Class"[1]. It succeeded at being suitable for writing large systems, too. It's easily the least-bad language I've used for writing software where garbage collection is acceptable. It hits a sweet spot between expressiveness, maintainability, and performance that I haven't experienced from any other language.

Question: Have you used Haskell to write real software? I find that people who have used it tend to have much more precise criticism than "isn't designed for writing real software". It certainly has lots to criticize, just like every other language. But most of the criticisms I see of it seem to have gone through 20 rounds of telephone, with basically no relation to the reality of using Haskell.

[1] http://haskell.cs.yale.edu/wp-content/uploads/2011/02/histor...

Re:Go and Simplicity Debt Redux by kjksf on Sunday June 18, 2017 @08:47PM (#14583857)
It says "It should be suitable for teaching, research, and applications, including building large systems."

So building production software is stated as 3rd most important goal.

In contrast, here's Rob Pike's talk about Go: https://talks.golang.org/2012/splash.article

The title: "Go at Google: Language Design in the Service of Software Engineering"

It puts building production software as the first most important goal.

It then goes in depth about how design decisions were driven by things the authors learned from Google's vast experience of writing production software.

It methodically describes pain points of large-scale software production and how Go's design decisions are trying to address those pain points.

Unlike Haskell, Go wasn't designed for teaching. It wasn't designed for research.

Go was designed for writing production software that needs to be reliable.

Re:Go and Simplicity Debt Redux by Tehnix on Monday June 19, 2017 @03:07AM (#14585074)
>So building production software is stated as 3rd most important goal.

Ehrm, no? It is to be taken with no implicit meaning on ordering, i.e. teaching == research == applications, more or less.

All of these priorities are weighed in when there are talks in the community about removing or adding features.

Haskell is a lot better for writing _reliable_ software. It just has a higher barrier to entry, if you come from an imperative background (not much if it's your first language).

>Unlike Haskell, Go wasn't designed for teaching. It wasn't designed for research.

Several times I've heard mentioned that the strength of Go was the simplicity and on boarding new developers, along with them not getting confused about what code means. I'll agree it certainly wasn't designed for research though, since it seems to want to ignore the progress in CS over the last 20 years.

Haskell is very serious about stability, they don't just add or drop features without a long deprecation cycle. Most experimental things are language extensions, which are entirely opt-in.

The main problem Haskell has had for adoption (IMHO) was the lack of good _pedagogical_ material that would hold the users hand and teach them the concepts of the language - there have been superb efforts into fixing this in recent years such as with the Haskell Book etc.

Re:Go and Simplicity Debt Redux by wtetzner on Sunday June 18, 2017 @11:25PM (#14584452)
> So building production software is stated as 3rd most important goal.

Nowhere in that sentence do they claim the list is ordered by importance.

> Go was designed for writing production software that needs to be reliable.

That might be true, but it doesn't actually say anything about how successful they were in reaching that goal.

Re:Go and Simplicity Debt Redux by geodel on Monday June 19, 2017 @08:50AM (#14586479)
> but it doesn't actually say anything about how successful they were in reaching that goal.

How would measure that? To me it is simple: lots of cloud related infrastructure is written in that. So it seems successful.

Re:Go and Simplicity Debt Redux by wtetzner on Friday June 23, 2017 @01:49PM (#14621152)
Well, all that really says is that the marketing for Go was successful, and that Go is sufficient to build said infrastructure (just as the languages preceding Go were).
Re:Go and Simplicity Debt Redux by skybrian on Sunday June 18, 2017 @05:12PM (#14582972)
The slogan "avoid success at all costs" suggests that they don't want a lot of production usage, at least.
Re:Go and Simplicity Debt Redux by lclarkmichalek on Sunday June 18, 2017 @05:24PM (#14583028)
It's "avoid 'success at all costs'", which has _quite_ the different meaning.

Although, if the slogan has too high of a barrier to entry, I don't know what you'd think of the language itself.

Re:Go and Simplicity Debt Redux by mrkgnao on Monday June 19, 2017 @07:33AM (#14586098)
No, it's meant as a warning against the trappings of explosive popularity. A language like C++/Java/JS is difficult to modify because of how entrenched the usage of the language becomes. In that sense avoiding "success at all costs" (which is how it should be parsed) allows "agile" development of the language.
Re:Go and Simplicity Debt Redux by kmicklas on Sunday June 18, 2017 @04:35PM (#14582775)
Haskell is much more suited to production use than Go though. Better concurrency, more invariants checked at compile time, easier to refactor, etc.
Re:Go and Simplicity Debt Redux by mjibson on Sunday June 18, 2017 @04:55PM (#14582879)
I think the people who make and use Go have had a different experience than you, and judge a language to be suited to production with different criteria. Simplicity, great concurrency (that is, way better than most others even if not the best), speed of compiling, static binary, garbage collection.
Re:Go and Simplicity Debt Redux by leshow on Sunday June 18, 2017 @05:17PM (#14583005)
I'm not OP, and I don't necessarily agree, but Haskell can produce static binaries, has GC, and has a great story for concurrency. It uses a M:N threading model similar to Go.
Re:Go and Simplicity Debt Redux by computerex on Sunday June 18, 2017 @05:31PM (#14583065)
No one said Haskell cannot be used in production. It is inherently a pedagogical language, that anyone must concede simply because history:

https://wiki.haskell.org/Haskell_in_research

Languages like Go or Nodejs are inherently more production ready and easier to deploy and maintain in production because of their vast ecosystems.

Re:Go and Simplicity Debt Redux by jolux on Sunday June 18, 2017 @07:35PM (#14583613)
>because of their vast ecosystems.

But this is an argument more about community than about language design. Granted there are a lot of problems with the Haskell community but deifying poor design decisions as "simplicity" is generally not one of them. For the horror that is string types, though, maybe.

Re:Go and Simplicity Debt Redux by kjksf on Sunday June 18, 2017 @08:39PM (#14583828)
The size of community is a direct result of the popularity of the language.

Haskell had almost 20 year head start over Go. That Go already surpassed it in the number of libraries speaks to the fact that people are picking Go over Haskell.

Following Occam's Razor, people pick Go over Haskell because they find it a better language, where "better" for them is probably different than how you define it, given that you think Go is "poorly designed" and it's a given that "poorly designed" language can't possibly be "better" than even mediocre language and I gather you place Haskell a bit higher than "mediocre".

Re:Go and Simplicity Debt Redux by kazinator on Monday June 19, 2017 @05:19PM (#14590553)
> Haskell had almost 20 year head start over Go.

Doesn't mean a thing when Google enters into the picture; and, in a way, it is not exactly true. Go can be regarded as a new version of Limbo.

Re:Go and Simplicity Debt Redux by jolux on Sunday June 18, 2017 @09:30PM (#14584041)
Go is a prime example of the "worse is better" doctrine, that's why it's popular.
Re:Go and Simplicity Debt Redux by sangnoir on Monday June 19, 2017 @05:07AM (#14585524)
> Go is a prime example of the "worse is better" doctrine, that's why it's popular

Also known as making trade-offs; a universal engineering theme. Engineering projects that refuse to make trade-offs don't fare too well - you have to pick a point that's acceptable to you on a strength/weight graph or you will be forced to use exotic materials that tend to come with their own cost (yet another trade-off: cost/strength). This is fine in a prototype or in a research paper, but when it comes to production, you will not win the fight against reality.

Edit: For programming languages, I imagine the graphs are roughly features vs. complexity (directly correlated) and then complexity vs. hiring pool size (inversely populated). You have to pick a point on both graphs, and Google picked values some people on HN disagree with and they find that offensive for some reason.

Re:Go and Simplicity Debt Redux by jolux on Monday June 19, 2017 @03:10PM (#14589514)
>This is fine in a prototype or in a research paper, but when it comes to production, you will not win the fight against reality.

Indeed, that's the argument I'm making. Where's the disagreement?

>or programming languages, I imagine the graphs are roughly features vs. complexity (directly correlated)

You know Simple Made Easy is a ubiquitous recommendation here and I don't really have anything to add to it. In Haskell as in Lisp all the complex "features" are described in terms of far simpler features. Languages that build in these features explicitly are complex, languages that let you choose don't have to be.

This is why C++ is complex and Common Lisp is simple, even though they have a pretty similar feature set all things considered.

As far as I can tell Go was designed by people who think C got most stuff right, and they intended to make a language that was hard to screw up in. I think they failed here though because neither option types nor generics are that hard to understand and eliminate huge classes of errors.

As I understand it in Go it's pretty common to cast stuff from interface{}. This is a bad pattern because it eliminates type safety. Somebody wrote on HN a while ago, and I'm inclined to agree, that you either have a static type system with generics or you have a dynamic type system. Go is no exception.

Re:Go and Simplicity Debt Redux by kazinator on Monday June 19, 2017 @05:16PM (#14590535)
Go is a prime example of "being backed by Google is even better than worse", which is why it's popular.
Re:Go and Simplicity Debt Redux by whateveracct on Sunday June 18, 2017 @09:00PM (#14583912)
Re: concurrency, Haskell also has STM which is absolutely amazing compared to anything Go has.
Re:Go and Simplicity Debt Redux by artursapek on Sunday June 18, 2017 @07:07PM (#14583500)
That's natural since protobuf is also developed by Google
Re:Go and Simplicity Debt Redux by mhh__ on Sunday June 18, 2017 @04:27PM (#14582718)
Haskell is probably the worst teaching language I can think of (Of the set of languages that are considered good/production worthy)
Re:Go and Simplicity Debt Redux by dmit on Sunday June 18, 2017 @05:50PM (#14583147)
I've heard from multiple people teaching Haskell that it's much easier to grasp for people with no prior programming experience compared to those with one or more languages under their belt. It makes sense on some level - core Haskell is about taking plain data and transforming it into something else. Much easier to explain than public static enterprise beans. I think that learning Java/Python/JavaScript/C#/PHP as a first language burdens you with too much baggage, while a lot of what Haskell teaches can be successfully applied regardless of what language you end up working with.

It's truly unfortunate that Haskell got the reputation of being mainly about monoids in the category of endofunctors, and zygohistomorphic prepromorphisms. The core principles are simple, solid, and lend themselves well to writing production code.

Re:Go and Simplicity Debt Redux by leshow on Sunday June 18, 2017 @05:15PM (#14582995)
Uh, what? Learning Haskell covers a huge surface area, many things you learn are applicable to tons of other languages. How does that make it a poor teaching language?
Re:Go and Simplicity Debt Redux by mhh__ on Sunday June 18, 2017 @05:48PM (#14583140)
I'm interpreting "Teaching language" to be the first language students learn. How can one explain the need for monadic IO properly without explaining how regular printf and the like work. Also, Haskell is quite scary to the beginner (Although I personally find it much simpler/more consistent than the Java and C++)

If it's (say) the third language they learn, then Haskell is absolutely perfect for the exact reason/s you have stated. Personally, I actually learnt Haskell by accident (Read SPJ's book about lazy functional language implementation, realized SPJ started Haskell then learnt more from there).

Re:Go and Simplicity Debt Redux by wtetzner on Sunday June 18, 2017 @11:38PM (#14584488)
> Also, Haskell is quite scary to the beginner (Although I personally find it much simpler/more consistent than the Java and C++)

Is it? Or is it just harder for people who have already learned a mainstream programming language?

Re:Go and Simplicity Debt Redux by kmicklas on Sunday June 18, 2017 @04:33PM (#14582760)
That's only if you're used to imperative languages. Of course even in functional land a slimmed down language like Scheme is probably better for teaching.
Re:Go and Simplicity Debt Redux by danaliv on Sunday June 18, 2017 @07:19PM (#14583551)
Funny; it's always reminded me of Pascal.
Re:Go and Simplicity Debt Redux by holydude on Sunday June 18, 2017 @03:36PM (#14582430)
So which programming languages / tech do you think are the real deal ?
Re:Go and Simplicity Debt Redux by kmicklas on Sunday June 18, 2017 @04:40PM (#14582803)
In the general space of competition with Go, probably the various JVM languages (Java, Scala, Kotlin, etc.), Rust, Haskell, Nim, ML, etc.