News for hackers. Stuff that matters.
Re:The language I wish Go was by stcredzero on Thursday October 21, 2010 @09:10AM (#1815213)
tl, dr; This post ended up way longer than I expected. Super science summary: I wish Go had tuples, unions, constructors, no Nil, exceptions, generics, some syntax sugar, and ponies that shoot Cheez Whiz out of their noses.

There's always D, if you want more whiz bangs. It's been oft quoted, that good library design involves leaving someone wanting more. I think one form of good language design involves this too. Go is supposed to be minimalist. I think it's a good sign if people keep wishing it were just a little less minimalist.

Re:The language I wish Go was by masklinn on Thursday October 21, 2010 @09:14AM (#1815226)
If you read the post instead of just the funny tldr, you realize that many of the demands would make Go simpler and/or more orthogonal and/or smaller.
Re:The language I wish Go was by enneff on Thursday October 21, 2010 @09:42AM (#1815303)
Can you flesh that claim out a bit more? I read the post and it was almost all extra stuff that would make the language spec longer, not shorter.
Re:The language I wish Go was by grogers on Thursday October 21, 2010 @11:08AM (#1815723)
One example was that tuples elegantly handle multiple return values anyways, so you don't need to bother with them if you have tuples (and tuples are good in their own right).

Another is that generics already exist in the language - map works even for user defined types. But since you can't make your own generics, map is all you get. With generics map is just a standard library feature rather than a core language feature, and you could write your own containers too if you wanted.

These might not make the language spec strictly shorter, but definitely more orthogonal.

Re:The language I wish Go was by uriel on Thursday October 21, 2010 @11:02AM (#1815692)
If you have actually used Go, you would realize that many of his demands display seriously lack of familiarity with the language.

For example, he completely missed defer.

Re:The language I wish Go was by speleding on Thursday October 21, 2010 @11:44AM (#1815937)
tl;dr? He explicitly mentions "defer"
Re:The language I wish Go was by CountHackulus on Thursday October 21, 2010 @11:17AM (#1815783)
I'll have to agree with the D comment. As someone who actually writes in D (for fun), I felt that it was more like a checklist for D than a wish list for Go. Though yes, I will concede that Go + those changes != D.

Unfortunately, the Cheez Whiz ponies aren't implemented yet, but if D ever hits 3.0 maybe it can be pushed into the spec.

Re:The language I wish Go was by sausagefeet on Thursday October 21, 2010 @01:34PM (#1816546)
I got the impression he wanted something close to Ocaml than to D. D is much more complicate than what he is proposing.
Re:The language I wish Go was by munificent on Thursday October 21, 2010 @03:02PM (#1816964)
I do think D is probably closer to where my heart is. I think my ideal low-level language is a bit like C + some of ML's type system. I think it may be possible to get that without being as heavyweight as D, but I'm not sure.
Re:The language I wish Go was by uriel on Thursday October 21, 2010 @11:24AM (#1815818)
> Unfortunately, the Cheez Whiz ponies aren't implemented yet, but if D ever hits 3.0 maybe it can be pushed into the spec.

I'd wait first for the any of the existing D2 compiler(s) to at least implement the features that are in D2 'spec', as it currently stands there are no implementations of D2, and that is without going into all the bugs in the most used compilers.

Re:The language I wish Go was by krakensden on Thursday October 21, 2010 @12:08PM (#1816056)
Go actually has a fair amount of syntactical sugar, the language design document has a fair amount of "ooh! And we did this cool thing to save you from typing an extra line!"
Re:The language I wish Go was by jbarham on Thursday October 21, 2010 @12:24PM (#1816128)
I especially like "short variable declarations" (aka type inference, http://golang.org/doc/go_spec.html#Short_variable_declaratio...). Just type one more character than you would in Python for assignments, but you get static typing.
Re:The language I wish Go was by masklinn on Thursday October 21, 2010 @02:12PM (#1816742)
Yes, an other exceptionally new feature invented by the Go masters which nobody had ever thought about before.
Re:The language I wish Go was by munificent on Thursday October 21, 2010 @03:01PM (#1816960)
Go is supposed to be minimalist.

Every language is designed according to that rule. No language designer thinks, "Let me just slap some extra unneeded stuff in there." They just differ on what they consider necessary.

In Go's case, I think many of the things they've omitted from the language are actually useful features and they've just pushed the complexity onto the users. For example, no exceptions just ends up meaning "if err != nil { return nil; }" everywhere.

Re:The language I wish Go was by stcredzero on Thursday October 21, 2010 @07:52PM (#1817973)
Every language is designed according to that rule.

False. Ruby and Perl were both designed (at least for a time) by adding stuff people were asking for or talking about. Not all language designers set a high priority on the thought, "Can we do without it?"

Re:The language I wish Go was by antareus on Thursday October 21, 2010 @10:24AM (#1815482)
Any complexity not covered over by the language will end up in the user's program.
Re:The language I wish Go was by supersillyus on Thursday October 21, 2010 @01:27PM (#1816510)
Any complexity not covered over by the language will end up only in the programs that need it, as opposed to being included in every program. If the complexity is common enough, it's probably worth centralizing (like, say, an object system or type checking), but designing a language so that tricky things that 95% of code doesn't use have special support results in a language that will wow folks on the internet but piss off those using it for real large projects.
Re:The language I wish Go was by antareus on Thursday October 21, 2010 @02:07PM (#1816713)
Bad culture/developers will screw up a project regardless of what language you use. You cannot prevent this by giving them successively castrated languages. They will still find ways to make things difficult because they don't know what they are doing. I like minimal languages from an aesthetic perspective, but ultimately they're just tools. The second they prevent me from expressing my intent as cleanly as possible, I become much less impressed by any claims they made about purity.

The defer statement is certainly Go-esque, but not as clean as RAII, because I can still forget to write the defer statement after opening a file. This violates DRY when doing file I/O. You can argue that Go never purported to support these concepts in the first place, but, at the end of the day, I'm writing code over and over again needlessly. Not elegant in the slightest.

Re:The language I wish Go was by nwmcsween on Thursday October 21, 2010 @08:06PM (#1818008)
Disagree and I have a very prominent argument, C.