News for hackers. Stuff that matters.
Re:Go 1.3+ Compiler Overhaul by enneff on Thursday December 19, 2013 @03:28AM (#6933504)
One recent use of the Go parsing and printing packages is goimports, a tool that automatically adds and removes import statements based on the code you've written.

Try loading this snippet, checking the "Import" box, and clicking "Format": http://play.golang.org/p/jS4s_Xz26v

To use it locally:

    $ go get code.google.com/p/go.tools/cmd/goimports
Re:Go 1.3+ Compiler Overhaul by charlieflowers on Thursday December 19, 2013 @08:15AM (#6934435)
I haven't delved into Go, but have occasionally "glanced" at it with curiosity. One of the most powerful principles I got a whiff of was that it was designed up front with the goal of providing a powerful tool chain -- an open parsing library and the like.

That provides some incredible power and may be the thing about Go that impresses me the most.

What if we also made programming language decisions about syntax, modularity constructs, etc., all with that goal in mind? (And perhaps Go has to a large degree).

Re:Go 1.3+ Compiler Overhaul by Intermernet on Thursday December 19, 2013 @03:52AM (#6933559)
I was on play.golang.org last night and didn't see that button.

When did that get added? That's brilliant!

Re:Go 1.3+ Compiler Overhaul by enneff on Thursday December 19, 2013 @02:52PM (#6937329)
We added it this week. :-)
Re:Go 1.3+ Compiler Overhaul by moomin on Thursday December 19, 2013 @04:14AM (#6933618)
Clojure has Slamhound. Yeah, I know you didn't want to hear about LISP...
Re:Go 1.3+ Compiler Overhaul by charlieflowers on Thursday December 19, 2013 @08:07AM (#6934401)
Plus, I love Lisp! It even has a lot of the characteristics that would allow what I'm talking about. I was just trying to articulate that what I'm saying requires more than just SEXP's and Lisp macros (although that does go a long way).

And Slamhound is definitely barking up the same tree. Very interesting!

Re:Go 1.3+ Compiler Overhaul by moomin on Thursday December 19, 2013 @11:35AM (#6935666)
Yeah, SEXPs and LISP macros to a full refactor aware environment is like getting to Riemann surfaces from set theory.*

*The small problem with this example is that in fact the latter has been achieved.

Re:Go 1.3+ Compiler Overhaul by charlieflowers on Friday December 20, 2013 @01:42AM (#6940272)
I suspect that this is a very clever joke. And possibly that I might be the butt of the joke. But I suspect that even so, the joke is so good that I'd still laugh heartily at it.

Unfortunately, I freely admit that the joke goes right over my head. I used to know something about Riemann surfaces, so I could invest some time and eventually get the joke perhaps, but I just don't have time now. :)

Re:Go 1.3+ Compiler Overhaul by moomin on Friday December 20, 2013 @03:38AM (#6940558)
Sorry, the chain is just

Set Theory Natural Numbers Integers Rationals Real Numbers Complex Numbers Calculus Riemann Surfaces

(as the Apple ads say, some steps skipped)

The only point I was making was that the level you were thinking at was much higher than the level SEXPs are at. Trying to envisage how we get there remains hard. TL;DR I was agreeing with you. :)

Re:Go 1.3+ Compiler Overhaul by vanderZwan on Thursday December 19, 2013 @04:55AM (#6933738)
ennef is not charlieflowers (in fact he is Andrew Gerrand, one of the official Go devs).
Re:Go 1.3+ Compiler Overhaul by axaxs on Thursday December 19, 2013 @11:18AM (#6935546)
Can this become part of Gofmt triggered by a flag? I love it, and feel it should really be part of an installation.
Re:Go 1.3+ Compiler Overhaul by enneff on Thursday December 19, 2013 @04:26PM (#6938013)
Goimports is a fork of gofmt, so you can use it as a drop-in replacement. We're considering whether to merge the functionality back into gofmt. Goimports is still pretty experimental, so this might not happen until Go 1.4, if it does at all.