Live data from Hacker News

Looking at your program’s structure in Go 1.7

pauladamsmith.com

51–54 of 54 posts

Re: Looking at your program’s structure in Go 1.7

#51
post #13

Earlier quoted context omitted.

It's opinionated, and not the good kind. Some people like having simply a `projects` directory with all coding projects inside. For almost any language, I can clone into this directory and run the associated build scripts. But Go has to be special and use a special directory or else it throws a hissy fit. Aside from that, I do enjoy the language a fair amount.

You can make a sub directory of your `projects` your GOPATH. Something like `projects/go` I have multiple GOPATH for personal reasons and use long running tmux sessions which exports the different GOPATH.

That's what I currently do. It's really just a minor annoyance, but it is an extra layer of friction for any newcomers to the language (and a pretty bad first impression)

Re: Looking at your program’s structure in Go 1.7

#52
post #24

This sort of visualization would be nice for LLVM IR! The Go implementation is located here: https://github.com/golang/go/blob/master/src/cmd/compile/int...

Why not use a proper graph? http://pp.ipd.kit.edu/firm/GraphSnippets

Because you will end up with unwieldly graphs like these:

https://twitter.com/chewxy/status/433807908875145216

https://twitter.com/chewxy/status/433811541373116416

This is from an old JITting Javascript engine I wrote in Go... a simple program like this:

    function clamp(x, min, max) {
 	y = 2
 	if (x  max) {
 		x = max
 	}
 	return x
    }
can generate pngs that are thousands of pixels wide and high (depending on what the nodesep and ranksep were set).

I wish I did think of the visualization that Go uses. That's fantastic compared to graphs

Re: Looking at your program’s structure in Go 1.7

#53
post #16

Earlier quoted context omitted.

Consider checking in the whole gopath to the VCS, and supply a makefile that calls `GOPATH=$(pwd) go build`. You see this for Java projects where the whole source code is nested half a dozen folders deep (src/com/foo/bar/baz/myproject/...) so i don't think it's unfamiliar.

What if I don't use Makefiles, because I live in the 21st century?

You could make a shell script instead.

Re: Looking at your program’s structure in Go 1.7

#54
post #52
post #24

Earlier quoted context omitted.

Why not use a proper graph? http://pp.ipd.kit.edu/firm/GraphSnippets

Because you will end up with unwieldly graphs like these: https://twitter.com/chewxy/status/433807908875145216 https://twitter.com/chewxy/status/433811541373116416 This is from an old JITting Javascript engine I wrote in Go... a simple program like this: function clamp(x, min, max) { y = 2 if (x max) { x = max } return x } can generate pngs that are thousands of pixels wide and high (depending on what the nodesep and…

Graphviz/dot sucks. Here is yComp for the same function: https://imgur.com/a/5eP9k

The blocks and red edges represent the control flow graph and I can easily see the two if structures.

It lets you zoom. Mouseover nodes to get more details.

Post reply on HN