News for hackers. Stuff that matters.
Re:Brad Fitzpatrick on the future of Go by kyllo on Tuesday October 14, 2014 @01:55PM (#8454716)
Rust addresses all of these problems. It's memory safe through compile-time reference counting and borrow checking (not garbage collected), and it has exceptions and generics. It also has a more powerful type system with type inference.

Having tried out both Go and Rust I don't see any reason to prefer Go, at least once Rust has a 1.0 release, which is supposed to happen the next 2-3 months.

Both languages were designed to replace C++, but only Rust has the features to actually succeed at that, IMHO.

Re:Brad Fitzpatrick on the future of Go by rakoo on Tuesday October 14, 2014 @05:19PM (#8455889)
> Both languages were designed to replace C++

AFAIU Go was designed to replace C++/Java/Python as _the_ language to use at Google, not as languages themselves. Which is why there is so much focus on simplicity, tooling, productivity (like compile speed and easy deployment).

Criticizing Go for not having enough features is missing the whole point: Go was created in part because C++ has too many features.

To my understanding, it was built for systems creators, not for programmers; it was built as a goto language who have to write program that is both efficient and simple to write and maintain. OTOH, I do see Rust as a C++ replacement, which makes it complementary to Go's focus (sadly it seems that D is lost in the middle, though...)

Re:Brad Fitzpatrick on the future of Go by doorhammer on Tuesday October 14, 2014 @05:47PM (#8456017)
This is the feeling I get. I don't write much Go (I'm just now getting into it) but all of the major features I hear about seem to be directed at creating code and projects that are tractable at "Google Scale". Everything has been designed for massive teams, from fast compile times, or having a standard formatting scheme, to choosing syntactically insignificant whitespace (specifically the podcast mentioned finding instances where python snippets were embedded in another language somewhere which would shoot the whitespace to crap).

The language being dead simple also seems to be to that end, with things like removing ternary operators or not having the pre-increment being smaller sacrifices, and no generics being a larger one.

All in all it seems like the underlying philosophy of Go is focused on Google specific context and engineering goals, and it's a happy accident when they work out well for programmers in the general case, whereas something like C++ or Rust isn't catering to those specific parameters (though they're obviously capable of working in that role, perhaps just not in the "ideal" way that the Go language maintainers would prefer).

Re:Brad Fitzpatrick on the future of Go by threeseed on Tuesday October 14, 2014 @07:21PM (#8456376)
> Everything has been designed for massive teams

Weird. Because I see the opposite.

Go would be fantastic for microservices or targeted applications. But features like exceptions are critical when you have 100+ developers spread across the world working on the one codebase and you want to ensure consistent error handling behaviour across the application.

Re:Brad Fitzpatrick on the future of Go by kyllo on Tuesday October 14, 2014 @07:40PM (#8456452)
Well, Google's C++ Style Guide[1] disallows exceptions, so it makes sense that they wouldn't put exceptions in Go either.

Come to think of it, Go does seem pretty similar to the subset of C++ that Google allows their developers to use. If you think of it that way, it starts to make sense to think of Go as an intended replacement for C++ at Google.

[1]http://google-styleguide.googlecode.com/svn/trunk/cppguide.h...

Re:Brad Fitzpatrick on the future of Go by tomp on Wednesday October 15, 2014 @05:53AM (#8457743)
The Style Guide also says that the decision is mostly due to large amounts of existing Google code that is not exception-safe.

> Things would probably be different if we had to do it all over again from scratch.

Re:Brad Fitzpatrick on the future of Go by higherpurpose on Tuesday October 14, 2014 @02:06PM (#8454781)
I think at this point Go is more of a replacement for Java than C++.
Re:Brad Fitzpatrick on the future of Go by tptacek on Tuesday October 14, 2014 @04:56PM (#8455761)
People love to say this, but the observation falls apart quickly under scrutiny. People working in Java are doing so to retain access to the JVM and to the zillion libraries built on it. The JVM with its ecosystem is a colossal asset for Java; one of the greatest in all of commercial software development. (I say this as someone who does not enjoy Java).

Meanwhile: Golang neatly fills in a sweet spot just "below" Python and Ruby, where finer-grained control of memory and more predictable performance characteristics are required, but bare-metal performance isn't. That sweet spot actually describes a huge fraction of all the use cases for C/C++ in Internet software.

So this is a meme I'd like to see die. It somehow manages to simultaneously get Golang, Java, and C++ wrong all at the same time. The only way to make it worse would be to work in some kind of Lisp comparison, based on Golang's parsimony with parenthesis.

Re:Brad Fitzpatrick on the future of Go by nextw33k on Friday October 17, 2014 @03:33AM (#8469822)
That observation is based on history. COBOL used to reign where Java sits now. The nature of corporations is changing, for the last nearly 20 years Java has enabled corporates to capitalise on investments in new hardware at a greater pace than COBOL did.

Golang is the new Java, you are watching it being born. Its not ready for the corporate world, its not on any large organisations radar (apart from its creator for course). The point is that Golang solves the problems of the future, it offer parallel execution to normal programmers.

In the future banks and large companies are going to stop having data centres of their own, CPU's are going to have 32+ cores. Java does not solve those problems natively.

Java is great, its got 40+ years of life left in it, but don't say that Java is strong because of its ecosystem. Ecosystems change from decade to decade.

Re:Brad Fitzpatrick on the future of Go by threeseed on Tuesday October 14, 2014 @06:49PM (#8456253)
Couldn't agree more.

Anyone who thinks Go will ever be a replacement for Java is frankly clueless about enterprise software development. Go has almost non-existant integration with enterprise systems e.g. SAP, Hadoop. It lacks operational management capabilities e.g. JMX. And seriously the range of libraries on the JVM covers pretty much everything e.g. banking/finance use cases.

And concerningly there is not a single reasonably sized Go project to get an understanding of how it works with 20, 50, 100 or 500+ developers working on the same codebase.

Re:Brad Fitzpatrick on the future of Go by kyrra on Tuesday October 14, 2014 @07:23PM (#8456391)
Docker is fairly large, cloc output:

   ----------------------------------------------------------
   Language             files     blank    comment       code
   ----------------------------------------------------------
   Go                     750     14601       9901     115877
   CSS                      8       107        194      10010
   HTML                    11       362         21       3594
   Bourne Shell            28       391        323       2044
   Bourne Again Shell      25       249        185       1475
   Javascript              12       111         48        756
   Python                   1        23         24        192
   C                        1        20         19        179
   YAML                     4        25         13        162
   XML                      1         6          2         60
   make                     2        27          5         60
   Perl                     1        11         37         29
   vim script               2         8          3         13
   ----------------------------------------------------------
   SUM:                   846     15941      10775     134451
   ----------------------------------------------------------
And I believe there are a number of projects internally within Google but they tend not to talk about internal product technologies (at least at how large they are).
Re:Brad Fitzpatrick on the future of Go by threeseed on Tuesday October 14, 2014 @07:42PM (#8456459)
No Docker is not fairly large. It's tiny. 1M - 10M LOC is the size of most of the codebases I've worked on.

Most people simply don't have an understanding of enterprise applications. The majority of the apps are single codebase, Servlet/Spring type monstrosities. They are 10+ years old and have had hundreds of contract developers who come in, add a few new features and then go onto the next contract.

And my point is that I am yet to see what Go would be like in these situations.

Re:Brad Fitzpatrick on the future of Go by tptacek on Tuesday October 14, 2014 @07:59PM (#8456524)
It seems a little unfair to ding Golang for not providing evidence of something Golang was designed to avoid. "Where's all the boilerplate? Where are all the 10 layers of XML mapping? What would an AbstractStrategyFactory even look like?"
Re:Brad Fitzpatrick on the future of Go by pjmlp on Wednesday October 15, 2014 @03:06AM (#8457445)
Rest assured, if Go manages to become a success in the enterprise you will get them.

It happened to every language without exception.

Re:Brad Fitzpatrick on the future of Go by mlvljr on Wednesday October 15, 2014 @07:00AM (#8457867)
But will it happen to one without exceptions, as well?? :)
Re:Brad Fitzpatrick on the future of Go by placeybordeaux on Wednesday October 15, 2014 @10:24AM (#8458543)
Panic/Recover will be used as expections.
Re:Brad Fitzpatrick on the future of Go by ayrx on Tuesday October 14, 2014 @10:46PM (#8456959)
If "enterprise applications" mean over-architectured monstrosities filled with boilerplate code, a hundred levels of indirection and horrible XML configuration files then thank god Go doesn't encourage that.
Re:Brad Fitzpatrick on the future of Go by kasey_junk on Tuesday October 14, 2014 @08:09PM (#8456559)
I think when people claim that Go is a replacement for Java, what they really mean is "Go has similar performance characteristics as the JVM and also doesn't require manual memory management".

Anyone who has ever worked in enterprise software can tell you, Go is (currently) exceptionally poorly suited for that style of development. I don't think that is an accident though. I think there is at least the implication that enterprise software development models and architectures are flawed at the core. Go seems to be designed from the start to prevent you from developing that way.

I may be reading more into the Go culture than I should, and I certainly don't think that there is proof that enterprise software can't be successful, but Go clearly steers you into building small, self contained servers that do one thing well and can go without change for a long time.

Re:Brad Fitzpatrick on the future of Go by cnbuff410 on Tuesday October 14, 2014 @07:06PM (#8456324)
> there is not a single reasonably sized Go project

I'm not sure if I misunderstood your statement, but Go has Docker, CoreOS and numerous other projects which have more than 20 developers working on the same codebase.

Re:Brad Fitzpatrick on the future of Go by threeseed on Tuesday October 14, 2014 @07:29PM (#8456416)
Docker and CoreOS are tiny compared to many enterprise Java apps. And they don't have 20 full time, active developers all contributing at the same time (at least not from the commit log).

Take for example eBay or Amazon and the huge array of different use cases they support. Those are the typical sized Java applications we are talking about. Insurance, Banking, Finance etc. Legacy integration, payments, reporting, various web front ends. One codebase.

Re:Brad Fitzpatrick on the future of Go by socket on Tuesday October 14, 2014 @10:44PM (#8456951)
You are mistaken if you think Amazon is backed by "enterprise" Java apps from a single codebase.
Re:Brad Fitzpatrick on the future of Go by e12e on Wednesday October 15, 2014 @04:31AM (#8457602)
For what it's worth, a pristine checkout of Eucalyptus[1], that has parts written in Java, appears to be around 430k loc of java (comments and white space included).

Also, OT, didn't realize Eucalyptus had worked so much towards friendly development, and was moving towards including RiakCS as a S3 work-a-like backend[2].

[1] https://github.com/eucalyptus/eucalyptus [2] https://github.com/eucalyptus/eucalyptus/wiki/Scalable-Walru...

[edit: yes, I realize you were probably talking about Amazon the shopping cart, not Amazon the IT infrastructure provider]

Re:Brad Fitzpatrick on the future of Go by SiVal on Wednesday October 15, 2014 @02:28AM (#8457386)
I was under the impression that Amazon was primarily a collection of services written mostly in Perl. Socket, do you know?
Re:Brad Fitzpatrick on the future of Go by kyllo on Wednesday October 15, 2014 @09:57AM (#8458418)
What I've heard from a friend who's a SDE there is that because they have a Service-Oriented Architecture the individual teams can use just about whatever language they feel is best for the particular job. The other teams don't care because they're just making service calls. I'm sure that was mostly Perl in the 90s, but today it is mostly Java, because their HR strategy is basically to hoover up all the fresh CS grads, whose strongest language is almost always Java. And also because when Amazon started building their SOA, Java/XML/SOAP was all the rage.
Re:Brad Fitzpatrick on the future of Go by kyllo on Tuesday October 14, 2014 @02:18PM (#8454851)
Perhaps, but the problem is, with no generics or exceptions, it might just be too low-level and not expressive enough to really be a suitable Java replacement.
Re:Brad Fitzpatrick on the future of Go by agmcleod on Tuesday October 14, 2014 @02:42PM (#8454991)
Yeah i just see Go as an alternative for web technologies, where Rust is much more system level focused. I could be wrong, but that seems to be the direction I see with Rust.
Re:Brad Fitzpatrick on the future of Go by naasking on Tuesday October 14, 2014 @03:40PM (#8455295)
> Yeah i just see Go as an alternative for web technologies

I don't see any web technology Go could replace. Not even dynamically typed langauges.

Re:Brad Fitzpatrick on the future of Go by tptacek on Tuesday October 14, 2014 @04:50PM (#8455727)
We could not have handled the load at Microcorruption, emulating CPU state for thousands of concurrent users, using Ruby --- which remains the front-end language for the site.

We could easily have done so in Java, but we'd be in Java's concurrency model, which is much more difficult to reason about.

Re:Brad Fitzpatrick on the future of Go by kyllo on Tuesday October 14, 2014 @05:35PM (#8455971)
So, you did it in Go instead of Java, right?

I think this is exactly what people mean when they say Go is more of a replacement for Java than it is a replacement for C++: In the sense that when Ruby and Python become too slow, people normally reach for Java, but now they have Go as an alternative option, with a better concurrency model than Java's.

Re:Brad Fitzpatrick on the future of Go by tptacek on Tuesday October 14, 2014 @06:21PM (#8456144)
We never even considered writing it in Java. We wanted something with the performance characteristics of C, which is what we would have used had we not had Golang.
Re:Brad Fitzpatrick on the future of Go by seunosewa on Wednesday October 15, 2014 @05:50AM (#8457731)
Golang does not have the "performance xteristics of C"!
Re:Brad Fitzpatrick on the future of Go by tptacek on Wednesday October 15, 2014 @07:08PM (#8462371)
I must just be crazy.
Re:Brad Fitzpatrick on the future of Go by threeseed on Tuesday October 14, 2014 @06:56PM (#8456283)
There are alternatives to Java's concurrency model whilst still staying on the JVM:

http://docs.paralleluniverse.co/quasar/

Re:Brad Fitzpatrick on the future of Go by vec on Tuesday October 14, 2014 @04:11PM (#8455481)
I'm starting to use Go as an arguably better Node. Very fast, easy (pseudo)concurrency, relatively nice HTTP capabilities in the stdlib. It wouldn't be my first choice for building a full library, but it works well as an internal component in a service oriented architecture or a background worker for a queuing system.
Re:Brad Fitzpatrick on the future of Go by sagichmal on Tuesday October 14, 2014 @04:37PM (#8455645)
Go is very uncontroversially a better Node. It also predates Node.
Re:Brad Fitzpatrick on the future of Go by spion on Tuesday October 14, 2014 @05:01PM (#8455787)
Depends on what you mean by "better".

Better language? Not really, if you want types TypeScript is a much better option. With node+typescript+react you can get end-to-end typechecked code with no FFI involved - thats really, really cool.

Better concurrency? Oh yeah, definitely. Better core libraries? Yes, by far.

Better package ecosystem and management? Definitely not.

Re:Brad Fitzpatrick on the future of Go by sagichmal on Wednesday October 15, 2014 @02:06PM (#8460467)

    > Better language? Not really,
There is no conceivable universe in which the expression "JavaScript is a better language than Go" evaluates to true.
Re:Brad Fitzpatrick on the future of Go by spion on Friday October 17, 2014 @05:26AM (#8470093)
Unless/until Go gets generics, I stand by my statement. A horrible type system that severely limits expressiveness is worse than no type system. Even TypeScript's type system is miles ahead compared to the one in Go.
Re:Brad Fitzpatrick on the future of Go by kyllo on Thursday October 16, 2014 @07:16PM (#8468461)
...except for in JavaScript itself:

    ~$ node
    > "JavaScript is a better language than Go" ? true : false
    true
    > "JavaScript" > "Go"
    true
Re:Brad Fitzpatrick on the future of Go by general_failure on Tuesday October 14, 2014 @06:12PM (#8456106)
I doubt it. The node ecosystem is second to none.
Re:Brad Fitzpatrick on the future of Go by aikah on Wednesday October 15, 2014 @01:28AM (#8457277)
All the things node is designed to do and it does it at least as fast as Go.

We can argue that the Go concurrency model is better.I think nodejs's is good enough,easier to understand and to deploy. If your goal is to write lightweight webservers that do a specific task,nothing beats node in my opinion.

Re:Brad Fitzpatrick on the future of Go by e12e on Wednesday October 15, 2014 @04:36AM (#8457612)
> easier to ... deploy

Ehm, really? Tree of javascript, possibly with some compiled libraries easier to deploy than a static binary?

I'm not saying node is hard to deploy, but I think maybe I'm misunderstanding what you mean here?

Re:Brad Fitzpatrick on the future of Go by cft on Tuesday October 14, 2014 @04:26PM (#8455576)
Prime candidate is any highly scalable TCP socket server. Currently, there's no better language for it
Re:Brad Fitzpatrick on the future of Go by pjmlp on Tuesday October 14, 2014 @04:50PM (#8455725)
Erlang? That switch that is routing your phone calls?
Re:Brad Fitzpatrick on the future of Go by coldtea on Tuesday October 14, 2014 @10:07PM (#8456853)
It hasn't rooted anybody's phone calls for a long time. Even Ericsson doesn't use Erlang based phone routing anymore...
Re:Brad Fitzpatrick on the future of Go by kasey_junk on Tuesday October 14, 2014 @08:51PM (#8456683)
Almost certainly not TCP socket based nor built on commodity hardware.
Re:Brad Fitzpatrick on the future of Go by rdtsc on Wednesday October 15, 2014 @02:22AM (#8457373)
Erlang is a better for it. WhatsApp runs their infrastructure on it. Can easily do millions of concurrent TCP connections on a single machine.
Re:Brad Fitzpatrick on the future of Go by pjmlp on Tuesday October 14, 2014 @02:46PM (#8455010)
Given how the JVM ecosystem looks like and what is planned for Java 9+ in terms of mechanical sympathy, I have my doubts.
Re:Brad Fitzpatrick on the future of Go by steveklabnik on Wednesday October 15, 2014 @11:04AM (#8458774)
Why do you say Rust has exceptions? We have fail!(), which does roughly the same thing as Go's panic(). So much so that we decided to rename it to panic!().
Re:Brad Fitzpatrick on the future of Go by kyllo on Thursday October 16, 2014 @12:28AM (#8463363)
You're right. I must have misunderstood something I read.
Re:Brad Fitzpatrick on the future of Go by steveklabnik on Thursday October 16, 2014 @08:30AM (#8464531)
Cool :)
Re:Brad Fitzpatrick on the future of Go by kyllo on Thursday October 16, 2014 @09:01AM (#8464641)
Ahh, I remember what it was. I saw a code snippet like this:

    let input = reader.read_line().ok().expect("Failed to read line");
And I thought "Cool, Rust has exceptions!"

I'm probably too used to thinking in Python. Or maybe I'm just dyslexic and I read "expect()" as "except()".

Either way, your comment prompted me to dig into it further and find out how Rust actually handles errors. So, thanks!

Re:Brad Fitzpatrick on the future of Go by steveklabnik on Friday October 17, 2014 @08:29AM (#8470581)
Thanks for elaborating! I wrote that line in the docs, actually. I wonder if I should add an explicit note about exceptions not being a thing.