7 ms·
I thought it was a pretty poor language, obviously written by people who'd either never heard of functional languages or never "got" the point of them. More he
by rwmj 13y ago
I thought it was a pretty poor language, obviously written by people who'd either never heard of functional languages or never "got" the point of them. More here:
https://rwmj.wordpress.com/2013/07/03/golang-bindings-for-libguestfs/#content https://rwmj.wordpress.com/2013/07/03/golang-bindings-for-li...
There's still room out there for the C replacement language. Something with ML/OCaml-level of expressiveness but with a replaceable garbage collector might be the sweet spot.
- swdunlop 13y agoYour blog post has some assertions that are either overbroad ("No type inference.") or just unsupported ("The whole design of GOROOT/GOPATH is completely broken".) Everyone is welcome to their opinion, but it'd be nice if they actually supported it with some explanation if they want to bandy it about in public.
- rwmj 13y agoWell you can't call 'var' type inference (Edit ':=' .. it's still laughable compared to real type inference). But I'll explain the GOROOT stuff in a bit more detail ... Basically the way it's set up prevents golang modules from being packaged up for Linux distros. There are two main problems. Firstly the 'go' utility tries to recompile installed modules, which isn't going to work as those modules are in files and directories owned by root and 'go' is not running as root. By very carefully setting up timestamps it's usually possible to avoid this, but it's fragile. Secondly if you do install a golang package, you can't compile an alternative copy in GOPATH, because the one in the (root-owned) GOROOT overrides it. Which is dumb and backwards.
- burntsushi 13y agoThere are a myriad of possibilities that await you on the Archwiki. [1] Also, you should not be installing third party packages in `GOROOT`. If you do, then yes, you're going to be in some trouble. [1] - https://wiki.archlinux.org/index.php/Go_Package_Guidelines https://wiki.archlinux.org/index.php/Go_Package_Guidelines
- rwmj 13y agoThat web page summarises how we package golang libraries so far, and it's (a) fragile and (b) doesn't let people install their own development copies of libraries, as I said in the gp post.
- burntsushi 13y ago> doesn't let people install their own development copies of libraries Then maintain two different and distinct `GOPATH` directories. One for development libraries and one for other stuff.
- mseepgood 13y ago> Well you can't call 'var' type inference 'var' is not the type inference, ':=' is the type inference.
- pcwalton 13y agoIt's not HM-style type inference, which is presumably what the parent comment was referring to.
- harrytuttle 13y agoPerhaps you don't "get" Go?
- burntsushi 13y ago> No type inference. Because obviously it’s 2013 and I want to write types everywhere. The `:=` does a fair bit for the programmer in cutting back on writing types. For me, the most needed place for type inference would be for writing anonymous closures (like what Rust has). In most other places, I am quite content with writing the types, particularly at the top level. > Like what’s the point of all the odd rules around := vs = The former is short-hand for variable declaration with assignment and type deduction, while the latter is just regular assignment. The primary benefit here is type deduction, which partially relieves the lack of type inference. > and what types you can and can’t assign and pass to functions Huh? > And why do you have to declare imports, when the compiler could work them out for you (it’ll even moan if you import something which is not used!) The compiler absolutely cannot work them out for you. If you have a package `github.com/PeepA/wat` and a package `github.com/PeepB/wat`, how will the Go compiler know which `wat` package to import? The Go compiler merely moans if an import (or its alias) hasn't been used in the source file that it was imported in. I like this feature, even if it is a mild bother while debugging. > Hello, world is about 8 lines of code. Camel case! Java rang, wants its boilerplate back. It's two lines. [1] > No breakthrough on error handling. Breakthrough? I'm not sure what you were expecting, but I think the error handling is pretty sane and at least far better than error handling conventions established in C. It could be adjusted if sum types were added to the language, but that has its own trade offs. If you desperately want exception-style error handling, then you can use panic/defer/recover, but it's frowned upon to overuse it. > The whole design of GOROOT/GOPATH is completely broken. It’s actually worse than Java’s broken CLASSPATH crap which is some kind of achievement, I guess. I have the exact opposite opinion. Did you know that you probably shouldn't be setting `GOROOT`? [2] After Go is installed, you just need to set `GOPATH` and add `$GOPATH/bin` to your `PATH`. That's it. > It’s not even enforced error checking, so bad programmers will still be able to write bad code. That is true, but Go's compiler forces you to address errors returned by functions that also return another value. You either need to explicitly ignore it or use the variable the error is stored in. (Lest you get an "unused variable" compiler error.) This doesn't cover all cases---like completely ignoring the return value(s) of a function---but don't throw the baby out with the bath water! [1] - http://play.golang.org/p/ihEoJ0yL9I http://play.golang.org/p/ihEoJ0yL9I [2] - http://dave.cheney.net/2013/06/14/you-dont-need-to-set-goroot-really http://dave.cheney.net/2013/06/14/you-dont-need-to-set-goroo...
- acuozzo 13y agoGo was neither designed to replace nor compete with existing functional languages. Even if it were demonstrably true that functional programming languages are a "better" (leaving this loosely-defined for now) choice than Go in 100% of the circumstances in which one would choose to use Go, your argument still wouldn't hold water, as it neglects other important characteristics of a programming language that are neither quantifiable nor useful in the context of comparing programming languages, such as perceived simplicity and the ability to hold the entire programming language in one's head. What's the value in denouncing a programming language because it isn't designed with your favorite programming paradigm in mind? That's just dick. Also, are you really going to call-out Rob Pike and Russ Cox on whether or not they truly understand Functional Programming like you do? Really? Really?
- rwmj 13y agoI didn't say Go was designed to replace or complete with functional languages. I said it would be good if Go's designers understood functional languages, but whatever their history or how internet-famous they are, they don't.
- jbooth 13y agoGo was designed to write systems-y back-end services. Functional languages are a terrible mismatch for this. 'No side effects' is great for certain types of coding, and terrible for systems integration where side effects are the whole point of what you're doing. Could you please explain what you mean when you say they don't understand functional languages as well as you? The lack of eval() and code-as-data in Go? Something else?
- RogerL 13y agoI kind of think Rob Pike knows about functional programming. Go was written at Google to solve very specific problems Google had. Looming large was the need for a C family language that implemented concurrency, fast compiles, and so on. The C family requirement is quite simple: most google engineers are young and don't know functional programming, have experience with Google's existing C/C++ code base, and they will be using Go to replace and extend existing systems already in C/C++. A new functional paradigm, nice as it is, would just get in their way. I'm not enamored by many features of the language, but I'm really hard pressed to say that those features do not solve Google's problems.
- mseepgood 13y agoThe first Go program was a LISP S-expression parser: http://blog.golang.org/first-go-program http://blog.golang.org/first-go-program Stephen Wolfram writes about the birth of Mathematica: "Macsyma was written in LISP, and lots of people said LISP was the only possibility. But a young physics graduate student named Rob Pike convinced me that C was the “language of the future”, and the right choice." http://blog.wolfram.com/2013/06/06/there-was-a-time-before-mathematica/ http://blog.wolfram.com/2013/06/06/there-was-a-time-before-m...
- pjmlp 13y agoYeah, now we have to live the "present of buffer overflows".
- tptacek 13y agoYes, what a dummy Rob Pike is, to have jettisoned all the functional goodness of C.
- masklinn 13y ago> Something with ML/OCaml-level of expressiveness but with a replaceable garbage collector might be the sweet spot. That's Rust: http://pcwalton.github.io/blog/2013/06/02/removing-garbage-collection-from-the-rust-language/ http://pcwalton.github.io/blog/2013/06/02/removing-garbage-c...
- TylerE 13y agoKind of a shame that the Rust crew doesn't seem to "get it" the way the Go team does. The Rust stdlib is TERRIBLE. Even basic stuff like file IO isn't implemented sanely. A shame as the language itself is pretty good, other than the idiotic semi-colon decision.
- pcwalton 13y agoIt's a work in progress. We have not hit 1.0 yet. Regarding the semicolon rules, you won't like this observation, but in my 3 years of writing Rust the semicolon rule has literally has never led to a single bug.
- marshray 13y agoI get the feeling that your knowledge of the rules is not necessarily representative of typical post-1.0 developers. :-) However, I don't recall it being a problem in my experimentation with Rust either.
- TylerE 13y agoIn my case, it's not a problem with understanding them, it's a burning desire that they not exist.
- klibertp 13y agoYou realize that it's a matter of aesthetics at best? You could set your editor of choice to substitute character ; with <pink elephant> when displaying code and back when saving it to disk. Have you tried this approach? (It's not an original idea - there is a plugin for Emacs which does exactly this for CamelCase - it displays parts of camel cased words as separate words. Helpful if you have looong camel cased name and are irritated because <back by word> and <forward by word> doesn't take you where you should be)
- deleted 13y ago[deleted]
- coldtea 13y ago>I thought it was a pretty poor language, obviously written by people who'd either never heard of functional languages or never "got" the point of them. Or "got it" and didn't find it any that good, for the types of problems they work on.