Live data from Hacker News

Go is amazing, period.

poincare101.blogspot.com

161–170 of 241 posts

Re: Go is amazing, period.

#161
post #118

How would you call foreign functions in C or C++ from Go? Is there something like a foreign function interface?

Go has utility called CGo that allows you to create interfaces to C libraries in Go. I've heard you can use some magic to get Go to talk to C++ by exporting functions back to C somehow (disclaimer: I'm not a C/C++ person).

Re: Go is amazing, period.

#162
post #146
post #142

Earlier quoted context omitted.

It seems you deleted your comment asking why you were downvoted. Here's why you were downvoted: > Way more than 5 minutes. Where are generics or do I have to learn some new construct? Wait a minute, is this thing object oriented or what? If not, why not? Do I have to learn some new philosophy? Already feeling a sense of dread having been through this game 10s of times before with other languages. If you didn't get pa…

It was no longer relevant and seemed to attract more downvotes. I have spent years with x86 + MIPS assembly language, C, C++, C#, Visual Basic and Q[uick]BASIC; months with Java, Scheme, Python, PHP; days/weeks with AS3, HaXE, Erlang, Scala, E, Objective-C, Ruby, Delphi, Pascal, Concurrent Clean, Prolog, ADA. I've probably missed a few. My point is (a) I'm not a lazy developer that doesn't enjoy learning new things o…

Given all the languages you already programmed with, and given that the Go specification is relatively short (approximately the same as Scheme), maybe you overestimate the efforts it would require to learn it. But you don't need to, that's all fine.

Re: Go is amazing, period.

#163

As someone who is 38, and has programmed in everything from 6510/68k/MIPS/ARM assembler to C/C++ to ActionScript/haxe/JavaScript to D to Python, et al, I also think Go is pretty great. In addition to the cool things in the language, I really love what they are doing with the build system. The Go programming I've been doing has been on Windows but targeting an ARM CPU (the PXA168 in the Chumby 8 device) and cross-comp…

Nice. How is the arm compiler holding up? I wrote the original 5g and ken did a large bug fix and optimizer sweep at some point so I'm interested in hearing how it has been going?

Re: Go is amazing, period.

#164
post #146

Earlier quoted context omitted.

It was no longer relevant and seemed to attract more downvotes. I have spent years with x86 + MIPS assembly language, C, C++, C#, Visual Basic and Q[uick]BASIC; months with Java, Scheme, Python, PHP; days/weeks with AS3, HaXE, Erlang, Scala, E, Objective-C, Ruby, Delphi, Pascal, Concurrent Clean, Prolog, ADA. I've probably missed a few. My point is (a) I'm not a lazy developer that doesn't enjoy learning new things o…

Given all the languages you already programmed with, and given that the Go specification is relatively short (approximately the same as Scheme), maybe you overestimate the efforts it would require to learn it. But you don't need to, that's all fine.

Heh I think you inadvertently proved my point. I spent 6 months with Scheme, working through half of the SICP for personal growth. Just because the specification is simple it doesn't mean the patterns and lessons are straightforward, and I'm a pretty slow learner. If you read the Go FAQ you will note that about 1/3 of it is along the lines of "Why doesn't Go...". When I see that sort of language it's clear that between the lines there's a lot to learn, and the only way for me to learn a language is to write code.

But after all of this I think I'm going to have to write one of my site-specific crawlers in Go for fun; since Go has a STOMP binding it should be easy to integrate into my existing architecture. Where things will get interesting is finding a compatible serialization library (and so we start getting into the real world problems of using a new language to solve interesting problems... hopefully one of the .NET protocol buffer implementations will work correctly with the one I imagine exists for Go).

Re: Go is amazing, period.

#165

Here's a summary of the article: * author cannot write portable C sockets code * author cannot handle C/C++ * author believes his app would be too slow in Python, later abandons App, but retains his bias against Python * Go has no parens for if/for * Go has unicode support * Go has closures "like salt shakers" * Go is cohesively designed * Go has nice libraries Go may or may not be a good language, but this kind of a…

I usually wouldn't respond to mean comments, but, this one really throws me off (I'm the OP). There is a very strong difference between "cannot write" and the need for something to be simple. I can definitely handle C/C++, and I don't think writing something in a higher-level language changes that. If something is doing processing with 4000 threads with around 10 years worth of by-the-minute data, it sure as hell wil…

A tip: if you have say 4 cores, then using 4000 threads will most likely be slow due to lots of context switches. I say most likely because it depends on the details, but it's a safe guess.

Re: Go is amazing, period.

#166
post #156

Earlier quoted context omitted.

I think the "Where are the generics" is the bigger issue there.

Why do you feel that? From the Go FAQ, which now I feel obliged to at least read in its entirety because of how much heat this post has stirred: "Why does Go not have generic types? Generics may well be added at some point. We don't feel an urgency for them, although we understand some programmers do. We haven't yet found a design that gives value proportionate to the complexity, although we continue to think about i…

But apparently you consider "no generics" a deal-breaker without seeing why generics haven't been added yet, and why it isn't an issue for the many developers writing real-world production Go code.

Re: Go is amazing, period.

#167

Earlier quoted context omitted.

Thanks for answering! I have no idea why someone downvoted your reply. People: downvoting is for mean and/or stupid comments, not things you disagree with. Anyway, in that case I imagine we'll see a Go preprocessor that takes all the line-initial braces and moves them up a break before sending code to the compiler. People get pretty worked up about this stuff.

I work in a place where people don't use spaces and don't use empty lines to separate logical groups of lines. It's a real pain for me who is a code format junkie as our code ends up being an ugly pack of unrelated crap that's really hard to read. It's Python code and I find it uglier than some fairly large C++ project I used to work on. Anyway, I wish there was a gofmt in Python because at least, I'd drop all hopes…

It's Python code and I find it uglier than some fairly large C++ project I used to work on.

I've always argued that if your team can't bother to even indent code properly than you have much bigger problems than any language formatting rules can solve.

Re: Go is amazing, period.

#168
post #165

Earlier quoted context omitted.

I usually wouldn't respond to mean comments, but, this one really throws me off (I'm the OP). There is a very strong difference between "cannot write" and the need for something to be simple. I can definitely handle C/C++, and I don't think writing something in a higher-level language changes that. If something is doing processing with 4000 threads with around 10 years worth of by-the-minute data, it sure as hell wil…

A tip: if you have say 4 cores, then using 4000 threads will most likely be slow due to lots of context switches. I say most likely because it depends on the details, but it's a safe guess.

That is part of the problem; if you have 4 cores, your program should be using 4 OS-threads. Your programming language's runtime should take care of distributing your 4000 lightweight/green threads to the 4 actual threads.

This is what e.g. Haskell does, and Go as well, I think.

Re: Go is amazing, period.

#169
post #72

Earlier quoted context omitted.

What's it like to use a compiled language for a web server?

It's really nice. You can build your Go program, deploy it as a single binary and it just runs. No need to hide it behind nginx or some other dedicated web server. The Go http package is DoS hardened and very fast. It's refreshing how little mechanism there is.

Well, even if I like go, I would not run a go program as root to listen on port 80.

Can you drop the privileges from within go like apache or nginx are doing it?

Re: Go is amazing, period.

#170
post #166
post #156

Earlier quoted context omitted.

Why do you feel that? From the Go FAQ, which now I feel obliged to at least read in its entirety because of how much heat this post has stirred: "Why does Go not have generic types? Generics may well be added at some point. We don't feel an urgency for them, although we understand some programmers do. We haven't yet found a design that gives value proportionate to the complexity, although we continue to think about i…

But apparently you consider "no generics" a deal-breaker without seeing why generics haven't been added yet, and why it isn't an issue for the many developers writing real-world production Go code.

I'm confused. I never called it a deal-breaker, just a surprise. The language designers, in their FAQ, acknowledge it as an opinionated gap where their own opinion hasn't been fixed, so I'm not imagining it as a gap either.

Your comment about "real-world" code is even more puzzling, as if all "real-world" code is somehow equivalent in abstraction needs. There are guys who've written serious code running in billions of cellphones where generics would be unimportant. Same thing for scientific or massive data crunching applications, e.g. Google's infrastructure.

In the space I work in - enterprise applications integrating large, disparate systems where you have zero control over interfaces and data formats but somehow need to get everything talking together nicely, generics are invaluable in structuring your code and making it reusable.

To be fair, I happen to be building a little search engine of my own and Go may turn out to be great for building the crawler components (the processing is site-specific), and I may end up using it for that purpose if I have the time to explore it or see value in it (if I find memory pressure to be an issue then saving 1/3 RAM on my EC2 instances over C# is a definite win, but since most of the work is I/O constrained I may never run into an issue at all).

Post reply on HN