Live data from Hacker News

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

syntax-k.de

101–110 of 110 posts

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

#101
post #79

Earlier quoted context omitted.

For what it's worth, I've done a lot in Lua, dropping to C (on rare occasions) to offload heavy processing elements where a scripting language would choke. Many game developers do their interface and game scripts in Lua then run the engine in C as well. It keeps the C code light and clean and brings down the number of manhours required to build and maintain a project. I don't know what FLINT is or what Julia is used…

Lua is not suitable from my point of view due to the lack of proper integer types (and many other features).

I understand it's not for every purpose (and I have no stake in if you use it or not), but it can be metaprogrammed and extended with C. I'm not really a programmer in my day job though, I use it mainly for automation of things I don't want to do by hand.

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

#102
post #85

One concern I have with garbage collected system programming languages is GC pauses. I have worked with several java applications that were simply not capable of handling fast, continuous, time critical processing tasks because every now and then they would pause for garbage collection. Most of the time they were fine, but suddenly you'd get brief but unacceptable drops in performance. Does anyone know if go is likel…

Yes, Go suffers from this, and badly too since its GC has to stop all threads due to data sharing. Rust fares better here, since its GC is per-thread.

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

#103
About this point :

> What's even better: you can put labels on your nested loops and break out of multiple levels using them. Finally!

This is possible in other languages, too, even if it's a little known fact.

For example in java :

    ext: for (int i=0; i

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

#104
post #39

The Java comments are wrong IMHO. Yes it has some legacy cruft. Yes you can import 10 million libraries and build abstractions on abstractions. Yes you can architect your application to resemble a Rube Goldberg machine. Guess what? Those same points apply to an language. Heck the evolution of a Python programmer https://gist.github.com/289467 currently on the front page which does the same thing for Python which is u…

The Java comments are wrong IMHO. Yes it has some legacy cruft. Yes you can import 10 million libraries and build abstractions on abstractions. Yes you can architect your application to resemble a Rube Goldberg machine. Guess what? Those same points apply to an language.

Potentially, yeah, but guess what? It does not happen in every language. That's why it's most often brought up for Java. Because it's not just the potentiality that matters, but the actuality too. In other words, it also takes a culture, and Java very much has that kind of culture.

Heck the evolution of a Python programmer https://gist.github.com/289467 currently on the front page which does the same thing for Python which is usually pretty clean

See? Usually, as in, "Usually pretty clean", is the key word here. Whereas Java program design is usually pretty convoluted.

And the "Evolution of a Python programmer" is mostly a joke, meant to show the tendency of some Python types to use some newer/cooler/functionaler (sic) features in place of more simple and readable ones. It's not what commonly happens in Python projects though.

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

#105
post #35

dynamic_cast >(funky_iterator >(foo::iterator_type (obj)) Yeah. Right. Don't get me wrong, I love templates, but contemporary C++ using STL looks like a classic case of the "If all you have is a hammer"-syndrome. GCC had to implement special diagnostic simplifications just so you can actually find out that that 5-line error message was a simple const'ness mistake when using a std::string method. Even worse, they can…

Every language has its pathological corner cases. Modern C++ using the STL is almost as terse as modern dynamic languages but runs 100x faster.

Modern C++11 might (I do not know enough; I'm waiting for examples to pop up), but it's only been finalized for 3 months and not yet implemented fully by any compiler.

I suspect it's "only" x2 longer. And about the 100x faster -- you might want to re-evaluate dynamic languages if that was the case last time you tried.

LuaJIT2 loses to C++ in most comparisons, but only by 20% or so, while being much more dynamic than Java.

V8 is about x3 slower than C++ in real life benchmarks. PyPy in my experience is about x5, Python x10. That's significant slowdown, but it is a far cry from x100, and they are a thousand times easier to develop in than C++.

My weapons of choice: Python when it doesn't need to be very fast, Cython when you need to speed that Python up, C [not ++] when you really want it to run quickly and have full control. And K when you want to have fun.

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

#106
post #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]

It's not an attempt to incrementally build on the C base, it rewrites all the rules, has a GC, D v1 and D v2 are pretty different things, and so forth...

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

#107

Earlier quoted context omitted.

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…

I am not talking about any APIs in JS or any "implentation in JS". JS, the language, as specified, is wrong at the core. It has a lot of insensible semantics. It's not even at a local maximum. I could just write a list of 10 changes to the language right now that would spur near-unanimous agreement of benefit with no downside.

I'm not talking about api's either. I'm talking about js as an implementation of ideas about what a language should do. It is built on a lot of great ideas and most are well implemented.

Since you aren't providing your sure-win idea changes, I can't be sure what you don't like but I can guess. All of them are well documented at this point. And they are easy to understand and avoid.

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

#108
post #85

One concern I have with garbage collected system programming languages is GC pauses. I have worked with several java applications that were simply not capable of handling fast, continuous, time critical processing tasks because every now and then they would pause for garbage collection. Most of the time they were fine, but suddenly you'd get brief but unacceptable drops in performance. Does anyone know if go is likel…

Currently, there is a world stop, yes. The garbage collector is parallel, but not concurrent. A concurrent garbage collector would make that disappear. How bad it impacts you depends on the workload, personally I've never felt it. YouTube uses Go[1] and mentioned[2] world stop is significant in their case, but tolerable.

[1] http://code.google.com/p/vitess/

[2] https://groups.google.com/forum/?fromgroups#!topic/golang-nu...

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

#109
post #71
post #56

Earlier quoted context omitted.

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

The error type is an interface. You can return values that contain contextual information as long as the error value you return has an Error() method returning a string. type ParseError struct { line int } func (e ParseError) Error() string { return "Parse error at line: " + fmt.Sprint(e.line) } Note: The current release may vary slightly on the details. I'm using a pre-release build. But older versions are similar.

And then in the code for handling the error, you can do

   switch err.(type) {
      case db.IOError:
          // Database exception here
      case io.FileNotFoundError:
          // File exception
      default:
          // Pass it to our caller for them to handle.
          return nil, err
   }
Which gives you the ability to selectively catch errors based on type.

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

#110

> What makes me stay away from it is the non-free nature. Yes, there is Mono, but I wouldn't like to base my stuff on a language that is there because of Microsoft's benevolent permission which it could turn into patent-lawsuits any time. We all know the tricks that company (well, actually any large company) has up its sleeves. Microsoft has standardized C# and the CLR through ECMA, and issued a promise stating that…

I think the author is correct in excluding languages that are non-free. Microsoft's promise means almost nothing in the real world. They could retract that at any point in time and leave any project built on that technology at risk. Mono is a non starter for any open project built today.
Post reply on HN