Earlier quoted context omitted.
I guess it is something like the Valley of The Uncanny for languages. Yes, it looks deceivingly similar to C++, C & Java, but is not any of those. When your eyes see the syntax, your brain expects the functionality to be the same. However Go does introduce fairly radical new paradigms (goroutines, type inference...) that really upsets that initial feeling of familiarity. I (unlike the majority) like Erlang's complete…
I agree except for the whole ";" "," "." line endings issue. When I can't copy and paste to move lines around without "fiddling" with the line endings, I get angry.
Go Rocks - How Can We Avoid Something This Bad In The Future?
51–60 of 68 posts
Re: Go Rocks - How Can We Avoid Something This Bad In The Future?
#52I work on Rust, which is in a similar space to Go. IMHO this article is oversimplifying. (1) Recursive anonymous functions: This is the first time I've heard this criticism. MLs usually don't have this functionality either. It's not too much trouble to give the function a name. (2) Tail call optimization: TCO isn't free. It requires all callees to pop their arguments, which slightly penalizes every call in the progra…
(2) Someone has to do cleanup anyhow. Either the caller or callee. (I am no expert in calling conventions) Anyhow, isn't this practically free, because the stack is in the L1 cache?
(3) To implement lightweight threads (ala. Erlang, Go, Stackless) you already can't allocate your activation records on the C-stack. So the main cost for call/cc is already paid for. Besides, Go lacks any form of non-local jumps, so escape continuations alone (setjmp/longjmp) would already be an improvement.
Re: Go Rocks - How Can We Avoid Something This Bad In The Future?
#53I work on Rust, which is in a similar space to Go. IMHO this article is oversimplifying. (1) Recursive anonymous functions: This is the first time I've heard this criticism. MLs usually don't have this functionality either. It's not too much trouble to give the function a name. (2) Tail call optimization: TCO isn't free. It requires all callees to pop their arguments, which slightly penalizes every call in the progra…
Can you elaborate on how popping arguments penalizes every call? It seems like, for non-variadic calls at least, it should take the same amount of time to add a constant to %esp whether you're doing it in the RET instruction or in the caller; but factoring that code into the callee should improve code density and therefore icache hit rates. What am I missing?
Re: Go Rocks - How Can We Avoid Something This Bad In The Future?
#54I wrote a bunch of go code this morning. It's definitely got a few really neat ideas in it. I tend to write erlang or c++ mostly for my day job. I do really wish the designers had a bit more erlang experience. Just a touch. Just enough so that I had a way to propagate the death of a goroutine through a bunch of other goroutines without building all of that manually. For example, code I wrote today: http://pastebin.co…
> I do really wish the designers had a bit more erlang experience. I feel the same way. I had this hope that this would be what I would learn instead of Erlang. You know it has goroutines and channels -- kind of like processes and casts. Well except that it is not the same. Erlang's processes that have explicit pids and messages are cast to those processes by referring to their pid, make a lot more sense to me than a…
Re: Go Rocks - How Can We Avoid Something This Bad In The Future?
#55I really wanted to learn something from this post, but it's mostly just hyperbole and whining. "It turns out that, in Go, you can't write a self-recursive anonymous function - there's no way to make it refer to itself. Well, you can do a dirty hack that's the "official work-around" (I'll let you google for the bug report)." To summarize this argument: 1. It is impossible to have a self-recursive anonymous function in…
func outer(a int) {
func inner_helper(b int) {
...
}
}
Pascal allowed nested functions 40 years ago...Re: Go Rocks - How Can We Avoid Something This Bad In The Future?
#56Earlier quoted context omitted.
Wow, that's not intuitive. :) Throwing in a "defer close(ch)" and that range thing did exactly the right thing. I'm not sure my API is right, but I know how to get it right now. Thanks a lot.
I'm surprised you say it's not intuitive. What is it just that you didn't know you could close channels?
Re: Go Rocks - How Can We Avoid Something This Bad In The Future?
#57No syntactically lightweight way of writing anonymous recursive functions? I can't make myself care about that; I just spent 30 seconds trying, and failed. That's just not a use case worth optimizing for in a practical systems language. Also, it's true that the Go spec doesn't guarantee tail calls are optimized. If Go were designed to be a functional language, that'd be problematic. However, guaranteeing TCO isn't fr…
just like C was meant to be a practical language for writing Unix tools. thanks for your comment.
Re: Go Rocks - How Can We Avoid Something This Bad In The Future?
#58I don't think Go's creators are as ignorant of academic ideas as you say. I've seen Rob Pike refer to OCaml a lot for instance. They just don't seem to like many of those ideas.
I cannot recall him ever saying the word "OCaml".
Re: Go Rocks - How Can We Avoid Something This Bad In The Future?
#59Earlier quoted context omitted.
I'm a full time OCaml dev these days and I run into OCaml's 'lack of lightweight anonymous recursive functions' maybe three times a year. It costs 3 lines of code to declare the function (called loop() or whatever) and then call it. I've never realized I was supposed to want to switch languages because of it. Otherwise, this comment makes me more interested in Go than I have been before. OCaml has a bazillion feature…
what about pattern matching? that is imo one of the saddest omissions from go - it's not a "huge" feature like continuations, but i find it makes a language significantly more pleasant to work with.
There are pros and cons for both models, but they are roughly equivalent and I never missed pattern matching in Go.
Re: Go Rocks - How Can We Avoid Something This Bad In The Future?
#60Earlier quoted context omitted.
what about pattern matching? that is imo one of the saddest omissions from go - it's not a "huge" feature like continuations, but i find it makes a language significantly more pleasant to work with.
Channels + select are a pretty good replacement for what one usually uses pattern matching in Erlang. There are pros and cons for both models, but they are roughly equivalent and I never missed pattern matching in Go.