Live data from Hacker News

The Go Programming Language, or: Why all C-like languages except one suck.

syntax-k.de

61–70 of 110 posts

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#61
post #44

Earlier quoted context omitted.

There was one other programmer who worked with Carmack on Quake 3, John Cash. My point is, even having one Carmack level developer on a team is a bridge to far for most. Yes, you can write huge projects using just C, but you honestly don't think most people would recommend it unless every little drop of performance was really that important or you had no other choice or you had a super guru with an amazing track reco…

Playstation 2 and Nintendo 64 games were written in assembly? Really? I thought C and C++ were common by then.

Playstation 2 had it's own devkit that was C or C++ I believe.

But yes, N64 games were written in assembler.

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#62
post #27

C, for the level of abstraction it targets is an extremely good language, and this is the reason why it is still alive, and why a lot of big successful projects are written using C. The problem is its standard library. The "get this new language" teams should instead focus on how to incrementally improve C. D was a (bad IMHO) attempt, just retry and make it better, a step after the other. If we will wait the ANSI com…

I'm genuinely curious as to why you thought D was a bad attempt? The GC? [not trolling]

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#63

Earlier quoted context omitted.

"they did switch to C++, which makes absolutely minimal usage of the language features" This is true of almost every C++ project I've ever worked on. Unfortunately they all used a slightly different minimal set of language features...

I guess you never worked on boost.

On it? No. With it? Yes.. Unfortunately.

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#64
post #42
post #36

Earlier quoted context omitted.

I don't think so; I think you also need polymorphism and probably exceptions. I think GC would also greatly improve expressiveness, because it makes functional style much easier to implement without redundant copying. But minimally some kind of polymorphism, and no, discriminated unions aren't enough - but Go's interfaces would probably do. Also, some way of hiding data members that doesn't require obscuring casts wo…

I think the point is "for the level of abstraction it targets". Add all those abstractions that are generally a good thing in a perfect world, and practically you shifted the language enough to be unsuited for many tasks we use it today.

Polymorphism doesn't have to add runtime overhead. You can achieve polymorphism without RTTI through code duplication, as C++ templates do. (You can also use uniform value representations, like C void *, although this is limited in its applicability.)

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#65

If C isn't suitable for projects with more than 10K lines, then praytell, what language should my kernel be written in? I've been meaning to try Go for a while (the fast compile times alone intrigued me), but this type of post really just puts me off - if you're telling me that C isn't suitable for large projects, then that tells me you may not know C well enough to make that judgement.

> If C isn't suitable for projects with more than 10K lines, then praytell, what language should my kernel be written in?

The Xen hypervisor (which shares a lot of characteristics with an OS kernel) is written in OCaml, which seems to have proven a good choice in practice: http://gazagnaire.org/pub/SSGM10.pdf

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#66

"[Issue 9] is a C-like language...It is intended to be a systems programming language..." What? Google's Issue 9 is neither a C-like language nor a systems language.

Figures this would get downvoted for not blindly buying into the propaganda: The syntax is clearly not C-style, that's just plainly-apparent. And just because a language is natively-compiled doesn't make it a systems language.

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#67
post #56

Earlier quoted context omitted.

In Go, the accepted way to report errors is to take advantage of multiple returns, such as: result, err := somePotentiallyFailingFunction() if err != nil { // Try to recover here ... // Not recoverable? panic() } And this call to panic works the way you prefer. Note that doing the following: result := somePotentiallyFailingFunction() won't compile since the number of values on the left doesn't match the right, so if…

Ok but exceptions also give you alot of context about the error like exactly where it occured. How is that handled in Go?

Do you mean that exceptions, when they bring down your program, indicate the line where the exception was thrown? If so, then `panic` in Go does the same thing. Using goroutines and panic/recover, you can do the same things you do with try/catch/throw.

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#68
post #52

Earlier quoted context omitted.

You are ahead of yourself by a few years. Q3 came out in 1999, which means it was written in the late 90s, so think PSOne and late SNES/Genesis titles.

Aside from the PS2, I don't think so. N64 came out in '96, Dreamcast came out in '98 and PS2 came out in early 2000. In '99, we were only two years away from Xbox and GameCube. I know that at least N64 games were written in C.

PSX games were often written in C, as well. I suspect that developers had started to migrate to C near the end of the SNES era, although I'm not sure how many SNES games were written in C...

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#69

If C isn't suitable for projects with more than 10K lines, then praytell, what language should my kernel be written in? I've been meaning to try Go for a while (the fast compile times alone intrigued me), but this type of post really just puts me off - if you're telling me that C isn't suitable for large projects, then that tells me you may not know C well enough to make that judgement.

He might not know C, but the creators of Go certainly do, so don't let this post discourage you.

> But the creators of go certainly do.

The only person who knows C better than the lead designer of go. (Ken Thompson IIRC.) Is in a casket right now.

EDIT: I didn't mean that in a ill-spirited tone. I'm just pointing out that the people working on go are the best alive.

Re: The Go Programming Language, or: Why all C-like languages except one suck.

#70

So, what's fundamentally wrong with JS? Not a lot. At this point the article lost all credibility with me.

Some of the implementations in JS went wrong, but fundamentally it really doesn't have anything horrible going on for what it's meant to do. Unfortunately some of the implementation details do allow for seriously horrible code and some seriously horrible traps. But if you can clear the fog, and use "the good parts", it's actually pretty nice. As for the article, I think it's very well written and seems to have a good…

wat
Post reply on HN