Live data from Hacker News

Why I went from Python to Go (and not node.js)

orel.li

31–40 of 202 posts

Re: Why I went from Python to Go (and not node.js)

#31
post #20

Another gonatic? I'm immediately reminded of the days when everyone who liked D proclaimed it would overtake C++ and rule the world with terrible, contrived examples: "let me show you why my language is better than yours by completely misunderstanding how to solve a problem, then implementing that broken/overengineered solution in your language, then compare it to something my language's API can do for me, just so we…

Big difference is that D did not have a Google backing it and D had a fairly major falling out by different factions.

This was a great pity because I think it probably is one of the best languages ever made and didn't get the take up it absolutely deserved.

Re: Why I went from Python to Go (and not node.js)

#32
post #27
post #24

Earlier quoted context omitted.

ah, so, I don't think I wrote that section particularly well. I hold Erlang and Haskell in very high regard; I was really trying to mock my own superiority complex, which I think is fairly common in the Python community. I guess what I was really trying to get at is that Go is verymuch an industry language. Haskell I would argue against being an industry language not because it can't be used in industry; that's not a…

You're digging in. > Haskell I would argue against being an industry language FYI, the problems the Haskell community has been working on are things like scalability, performance and safety because they're critical to industrial problems . Toy approaches don't work at the scale we operate at -- you need real computer science. You want 1,000,000 Haskell threads in your app? You've got it. Want to write numerical model…

The point is that Go is more accessible than Haskell, not that it's better.

Re: Why I went from Python to Go (and not node.js)

#33
post #20

Another gonatic? I'm immediately reminded of the days when everyone who liked D proclaimed it would overtake C++ and rule the world with terrible, contrived examples: "let me show you why my language is better than yours by completely misunderstanding how to solve a problem, then implementing that broken/overengineered solution in your language, then compare it to something my language's API can do for me, just so we…

>The insight to async I/O is that this server, for this I/O bound task, will perform as well as your GOMAXPROCS example:

Will it?

Luvit, which is implemented on Node's libuv outperforms Node in the trivial case because of higher lua performance (and lua->c interop performance).

Re: Why I went from Python to Go (and not node.js)

#34
post #27
post #24

Earlier quoted context omitted.

ah, so, I don't think I wrote that section particularly well. I hold Erlang and Haskell in very high regard; I was really trying to mock my own superiority complex, which I think is fairly common in the Python community. I guess what I was really trying to get at is that Go is verymuch an industry language. Haskell I would argue against being an industry language not because it can't be used in industry; that's not a…

You're digging in. > Haskell I would argue against being an industry language FYI, the problems the Haskell community has been working on are things like scalability, performance and safety because they're critical to industrial problems . Toy approaches don't work at the scale we operate at -- you need real computer science. You want 1,000,000 Haskell threads in your app? You've got it. Want to write numerical model…

> /me wanders back to a multi-million line Haskell codebase running systems in 25 countries, processing billions a year in financial transactions.

Curious... Can't be a bank, too conservative. Hedge fund? I know Jane Street love their OCaml so functional does have a place in that world. But 25 countries? You'd have to be huge.

Re: Why I went from Python to Go (and not node.js)

#35
post #20

Another gonatic? I'm immediately reminded of the days when everyone who liked D proclaimed it would overtake C++ and rule the world with terrible, contrived examples: "let me show you why my language is better than yours by completely misunderstanding how to solve a problem, then implementing that broken/overengineered solution in your language, then compare it to something my language's API can do for me, just so we…

People please .. stop the four line code comparisons. Write something serious instead and then see how it compares.

Like for example show me how to suspend the HTTP request and wake it up later when you receive a message back from some long running process.

Or simpler: show me how to start a long running async task from a request handler.

Re: Why I went from Python to Go (and not node.js)

#36
post #15

"As a Django developer, there wasn’t a straightforward and obvious way to just do things in the background on a page request. People suggested I try Celery, but I didn’t like that option at all. A distributed task queue? What? I just want to do something in the background without making the user wait; I don’t need some super comprehensive ultimate computing machine. The whole notion that I would need to set up and co…

well, the complaint isn't entirely that it's hard, per se, but that there are many different ways to do things concurrently in Python, and that it presents too many choices to be made for the novice programmer. In Go, you just say `go myfunction()` and you're done. There's a lot of value in that.

Re: Why I went from Python to Go (and not node.js)

#37

Ah, code comparisons. I don't see much difference in the Go code vs Javascript, except for the extra comments and logging in the js. How about this? var cluster = require('cluster') , http = require('http') , os = require('os') if (cluster.isMaster) { os.cpus().forEach(cluster.fork) } else { http.createServer(function(req, res){ res.writeHead(200) res.end('Hello world') }).listen(8000) }

Thanks, his uneven code comparison was bothering me. The main difference I see is that the nodejs code is easier to read.

Re: Why I went from Python to Go (and not node.js)

#38
post #27
post #24

Earlier quoted context omitted.

ah, so, I don't think I wrote that section particularly well. I hold Erlang and Haskell in very high regard; I was really trying to mock my own superiority complex, which I think is fairly common in the Python community. I guess what I was really trying to get at is that Go is verymuch an industry language. Haskell I would argue against being an industry language not because it can't be used in industry; that's not a…

You're digging in. > Haskell I would argue against being an industry language FYI, the problems the Haskell community has been working on are things like scalability, performance and safety because they're critical to industrial problems . Toy approaches don't work at the scale we operate at -- you need real computer science. You want 1,000,000 Haskell threads in your app? You've got it. Want to write numerical model…

The perception out there is that Haskell is an academic language, also that it is a "difficult" language.

This is not fair on Haskell but that is what people think and that really is the issue that Haskell has to overcome.

Re: Why I went from Python to Go (and not node.js)

#39
post #5

Earlier quoted context omitted.

Goroutines running Go code are multiplexed onto a variable number of system threads (GOMAXPROCS, in the gc implementation), Goroutines running C code, for example via cgo, or when they call a blocking system call, have their own thread.

Yes I get that. I just wanted to point out that a single threaded model is not necessarily a bad thing. It happens in GO too by default.

I think that's more of a matter of scheduler still being immature. Erlang only added an SMP scheduler in R11 due to the complexities of managing internal state without sacrificing it's soft-realtime abilities. It was also only really reliable after R12.

I'm sure Go will mature here and the defaults will evolve along with that. Whether that will take years or not is up for debate but at least it's a possibility and doesn't cost the programmer anything other than a recompile if they start with careful use of goroutines today.

Re: Why I went from Python to Go (and not node.js)

#40
post #24
post #21

Dimissing Erlang and Haskell with a wave of the hand, while seriously considering node.js? Carry on, nothing to see here.

ah, so, I don't think I wrote that section particularly well. I hold Erlang and Haskell in very high regard; I was really trying to mock my own superiority complex, which I think is fairly common in the Python community. I guess what I was really trying to get at is that Go is verymuch an industry language. Haskell I would argue against being an industry language not because it can't be used in industry; that's not a…

I understood the intent fairly quickly. Some people are easily offended I guess.
Post reply on HN