6 ms·
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 syn
by stcredzero 16y ago
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.
- masklinn 16y agoIf 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.
- enneff 16y agoCan 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.
- grogers 16y agoOne 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.
- deleted 16y ago[deleted]
- uriel 16y agoIf 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.
- speleding 16y agotl;dr? He explicitly mentions "defer"
- antareus 16y agoAny complexity not covered over by the language will end up in the user's program.
- supersillyus 16y agoAny 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.
- antareus 16y agoBad 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.
- nwmcsween 16y agoDisagree and I have a very prominent argument, C.
- CountHackulus 16y agoI'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.
- uriel 16y ago> 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.
- sausagefeet 16y agoI got the impression he wanted something close to Ocaml than to D. D is much more complicate than what he is proposing.
- munificent 16y agoI 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.
- krakensden 16y agoGo 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!"
- jbarham 16y agoI especially like "short variable declarations" (aka type inference, http://golang.org/doc/go_spec.html#Short_variable_declarations 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.
- masklinn 16y agoYes, an other exceptionally new feature invented by the Go masters which nobody had ever thought about before.
- munificent 16y agoGo 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.
- stcredzero 16y agoEvery 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?"