Live data from Hacker News

I Love Go; I Hate Go

dtrace.org

71–80 of 329 posts

Re: I Love Go; I Hate Go

#71
post #10

The most frustrating thing for me, by far, is that Go won't let you import unused packages. When you are commenting stuff out to debug a program, or adding debug statements and removing them later, it constantly requires you to go back to the top of the file and comment out the unused libraries, only to uncomment them later when you've solved your problem. The fact that there is not a compiler flag to disable this be…

i was shocked by that at first too. Then I came to love it. It's sooooo go. Don't import stuff you aren't using. Don't declare a var and just leave it there un-used. When I go back to ruby and commit that crime, I see why golang did what it did. There's something magical about a golang program that will compile without error. It's worthy of checking in to git. And months later, there will be no unsed imports FOR SURE…

Define unused imports/variables as warnings but produce an executable that first prints "This program is for debugging purposes only, it built with 133 warnings." and beeps loudly.

Re: I Love Go; I Hate Go

#72
post #10

The most frustrating thing for me, by far, is that Go won't let you import unused packages. When you are commenting stuff out to debug a program, or adding debug statements and removing them later, it constantly requires you to go back to the top of the file and comment out the unused libraries, only to uncomment them later when you've solved your problem. The fact that there is not a compiler flag to disable this be…

Everyone else is suggesting goimports, but here's another trick:

    import _ "unused/package"

This is usually used to benefit from the packages' side-effects (e.g. trigger init() - mostly used in SQL drivers to register the driver).

Re: I Love Go; I Hate Go

#73
post #61

Earlier quoted context omitted.

What interpreters did these orgs write in GCed languages?

A few examples from Oracle/Sun using the Graal VM engine, written in Java: https://github.com/graalvm From Microsoft: http://ironpython.net/ http://ironruby.net/ https://msdn.microsoft.com/en-us/library/dd233052%28v=vs.110... https://msdn.microsoft.com/powershell Xerox PARC used Cedar for the software implemented on Xerox 1132 (Dorado) and Xerox 1108 (Dandelion) systems, including interpreters delivered on the system…

These are just experiments on the margins. In each case, the flagship languages are not implemented on top of GC'd runtimes or interpreters. Apple's Objective-C and Swift runtimes are both C++. Microsoft's C# CoreCLR is C++. Google's V8 and Dart have runtimes written in C++. Oracle's HotSpot is C++. Go's core runtime is in a Go-minus-GC subset.

It didn't have to be this way - Swift could have been written atop the JVM, v8 could have been implemented via Boehm, etc. For whatever reason, when it counts, the stuff under the hood doesn't use garbage collection.

Re: I Love Go; I Hate Go

#74
post #49

Oh. Go love-hate relationship post. My turn. So I really like channels and coroutines built into language and used everywhere: it makes some patterns compose nicely and language very productive. But just as in the article - some of Golang choices are opinionated and IMO just stupid. Lack of assertions is one: Sure programmers are prone to ignoring errors, but Go is not helping at all. Just bans assertions and provide…

> How do you decrement an atomic in Go? Ooh. How do you delete from a slice in Go? With append() of course! http://stackoverflow.com/questions/25025409/delete-element-i...

That solution (append(a[:0], a[1:]...)) doesn't look remotely performant. I don't have a copy of go handy to test, but exploding most of the list into individual arguments and passing them to a variadic function, just to pack them all back into an array, seems quite circuitous to me.

Is that really the _best_ way to delete from a slice in Go?

Re: I Love Go; I Hate Go

#76
post #72
post #10

The most frustrating thing for me, by far, is that Go won't let you import unused packages. When you are commenting stuff out to debug a program, or adding debug statements and removing them later, it constantly requires you to go back to the top of the file and comment out the unused libraries, only to uncomment them later when you've solved your problem. The fact that there is not a compiler flag to disable this be…

Everyone else is suggesting goimports, but here's another trick: import _ "unused/package" This is usually used to benefit from the packages' side-effects (e.g. trigger init() - mostly used in SQL drivers to register the driver).

But then you have to remove blank identifier to actually use package.

Re: I Love Go; I Hate Go

#77

Honest question: How does a post with just 4 points and posted 11 minutes ago get to be on the front page? Even amazing it is number 2 right now.

As Tomte and jdoliner pointed out, 4 points in 11 minutes would get you on the front page at any time, let alone a slow time like this one. As for why the post would get rapid votes, that's easy: moth-to-flame subject matter.

It's not great to post comments like this taking a thread so badly off topic, let alone jumping to conclusions that the admins are manipulating what is obviously (once you're familiar with it) baseline HN behavior. Love-hate-Go posts are a drug here; and so are all things Rust, which is why those stories are currently #1 and #2. If we did anything to posts like that it would be to downweight them, but I'm tired, and a good pro-and-con language vent seems like a fairly innocuous thing for HN to do overnight (with apologies for our Pacific-timezone-centricity), so have at it.

Re: I Love Go; I Hate Go

#78

Here's a way to love go, write a language in it https://github.com/grubby/grubby

I would really like to see some mruby bindings for Go. It would be simpler than re-implementing ruby in Go.

https://github.com/mitchellh/go-mruby There are others, but that one looks complete.

Re: I Love Go; I Hate Go

#79
post #61

Earlier quoted context omitted.

A few examples from Oracle/Sun using the Graal VM engine, written in Java: https://github.com/graalvm From Microsoft: http://ironpython.net/ http://ironruby.net/ https://msdn.microsoft.com/en-us/library/dd233052%28v=vs.110... https://msdn.microsoft.com/powershell Xerox PARC used Cedar for the software implemented on Xerox 1132 (Dorado) and Xerox 1108 (Dandelion) systems, including interpreters delivered on the system…

These are just experiments on the margins. In each case, the flagship languages are not implemented on top of GC'd runtimes or interpreters. Apple's Objective-C and Swift runtimes are both C++. Microsoft's C# CoreCLR is C++. Google's V8 and Dart have runtimes written in C++. Oracle's HotSpot is C++. Go's core runtime is in a Go-minus-GC subset. It didn't have to be this way - Swift could have been written atop the JV…

The question was "What interpreters did these orgs write in GCed languages?".

It doesn't matter where those interpreters are being used, the fact is that they exist.

> Microsoft's C# CoreCLR is C++.

Yes, but they have moved their compilers to C# with the Rosylin project with MDIL and .NET Native moving more code to C# side.

Also check the Phoenix compiler framework, a LLVM like project from MSR using C#.

> Go's core runtime is in a Go-minus-GC subset.

Of course, there needs to exist a Genesis for the GC, but once it is there, 99% of the remaining infrastructure makes use of it.

If you take Nashorn engine running on Jikes, it is an 100% Java stack running a JavaScript interpreter.

> For whatever reason, when it counts, the stuff under the hood doesn't use garbage collection.

Most of the time it is just building on top of whatever already exists instead of starting from scratch.

Taking Swift as an example bootstraping the language would increase the burden designing it, as they are still far from fully stable design.

If they would throw away in man years invested into the LLVM, which happens to be written in C++, it would take ages before pure Swift compilers would ever manage to catch up.

However these shortcuts open the door for those not savvy in compiler design to use as ammunition against secure languages.

Re: I Love Go; I Hate Go

#80
post #77

Honest question: How does a post with just 4 points and posted 11 minutes ago get to be on the front page? Even amazing it is number 2 right now.

As Tomte and jdoliner pointed out, 4 points in 11 minutes would get you on the front page at any time, let alone a slow time like this one. As for why the post would get rapid votes, that's easy: moth-to-flame subject matter. It's not great to post comments like this taking a thread so badly off topic, let alone jumping to conclusions that the admins are manipulating what is obviously (once you're familiar with it) b…

That seems like a dangerous system, though. Just a few coordinated upvotes can get a post to the front page. And if it's so easy, you'll almost certainly have people/companies abusing that to promote their content.
Post reply on HN