code review 4959047: gorun: new tool for running Go source files (issue 4959047)

83 views
Skip to first unread message

n13m...@gmail.com

unread,
Aug 30, 2011, 8:26:27 PM8/30/11
to golan...@googlegroups.com, golan...@googlegroups.com, re...@codereview.appspotmail.com
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golan...@googlegroups.com (cc: golan...@googlegroups.com),

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
gorun: new tool for running Go source files

gorun enables running a go file from the command line,
and will also cache compilations so that further runs
do not have to compile the code again unless necessary.
gorun caches files under a temporary directory, and
ensures that concurrent runs work correctly.

Unlike my previous contributions, this tool has been
developed by me within time that was dedicated to
Canonical Inc., and I've received written confirmation
from the company that Canonical waives rights to the
code, allowing me to rightfully make this donation,
according to point 4 of the CLA.

This code is certainly broken on windows, and will
require love from a caring developer.

Please review this at http://codereview.appspot.com/4959047/

Affected files:
M src/cmd/Makefile
A src/cmd/gorun/Makefile
A src/cmd/gorun/doc.go
A src/cmd/gorun/main.go
M src/pkg/Makefile


r...@golang.org

unread,
Aug 30, 2011, 8:54:22 PM8/30/11
to n13m...@gmail.com, golan...@googlegroups.com, golan...@googlegroups.com, re...@codereview.appspotmail.com
I have deep philosophical issues about this tool. Things like this have
come up many times before.

Regardless of any LGTMs that may come, please let me think about it for
a while.


http://codereview.appspot.com/4959047/

Gustavo Niemeyer

unread,
Aug 30, 2011, 9:25:01 PM8/30/11
to golan...@googlegroups.com, r...@golang.org, re...@codereview.appspotmail.com
> I have deep philosophical issues about this tool. Things like this have
> come up many times before.

Yeah, I know you do.. I've seen your comments in previous
conversations, and I can share some of your feeling about this.

The reason this tool was created, and the background for this
submission, is that this is a way for people to get comfortable with
Go when coming from languages that work in a similar way. I see this
as barrier remover so that people can let misconceptions die and then
engage into actual Go, and it has been useful in my endeavour of
pushing Go in a Python-heavy environment.

> Regardless of any LGTMs that may come, please let me think about it for
> a while.

Will do.

Thanks for the GTUG talk, btw. Appreciated watching it.

--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog

-- I never filed a patent.

Jan Mercl

unread,
Aug 31, 2011, 6:38:30 AM8/31/11
to golan...@googlegroups.com, re...@codereview.appspotmail.com
On Wednesday, August 31, 2011 2:26:27 AM UTC+2, Gustavo Niemeyer wrote:

Description:
gorun: new tool for running Go source files

IMHO this tool doesn't belong to the Go tree. Moreover it supports - and thus possibly encourages use of - source code which is currently not even valid Go per specs (shebang).

Gustavo Niemeyer

unread,
Aug 31, 2011, 9:08:45 AM8/31/11
to golan...@googlegroups.com, re...@codereview.appspotmail.com
> IMHO this tool doesn't belong to the Go tree. Moreover it supports - and
> thus possibly encourages use of - source code which is currently not even
> valid Go per specs (shebang).

This doesn't change what I've pointed out: it's a valid way for people
to _experiment_ with the language with a familiar workflow while
getting hooked into the actual benefits. I'm not suggesting any
changes to the language with this tool.

Rob 'Commander' Pike

unread,
Aug 31, 2011, 9:17:19 AM8/31/11
to n13m...@gmail.com, golan...@googlegroups.com, re...@codereview.appspotmail.com
Why not just put it in a public repo?

-rob

Gustavo Niemeyer

unread,
Aug 31, 2011, 9:36:04 AM8/31/11
to Rob 'Commander' Pike, golan...@googlegroups.com, re...@codereview.appspotmail.com
> Why not just put it in a public repo?

It already is, and is documented as well:

https://wiki.ubuntu.com/gorun

I'm submitting because given the tool nature it feels reasonable to
have it in the tree, and because I see people interested on that every
once in a while (Brad mentioned it before, the Debian packager
mentioned he'd like to have that in the package, etc).

That said, it doesn't really bother me too much to leave it outside,
to be honest, if you feel strong about not having it in the tree for
whatever reason.

Brad Fitzpatrick

unread,
Aug 31, 2011, 12:59:45 PM8/31/11
to Gustavo Niemeyer, Rob 'Commander' Pike, golan...@googlegroups.com, re...@codereview.appspotmail.com
I still want something like this in the tree.

People see me using my own gorun while I'm demoing the language to them, and then they get confused when they download Go and can't use it easily.

I don't think Go's getting started ramp is nice enough.  hg will go soon enough, but currently it's hg checkout + Makefiles.  We don't even have a tool to initialize a new command or package directory, afaik.

Russ Cox

unread,
Aug 31, 2011, 1:03:06 PM8/31/11
to Brad Fitzpatrick, Gustavo Niemeyer, Rob 'Commander' Pike, golan...@googlegroups.com, re...@codereview.appspotmail.com
> enough, but currently it's hg checkout + Makefiles.  We don't even have a
> tool to initialize a new command or package directory, afaik.

It's actually hg checkout + goinstall.
I have been assuming that most systems ship with mkdir. :-)

Brad Fitzpatrick

unread,
Aug 31, 2011, 1:05:44 PM8/31/11
to r...@golang.org, Gustavo Niemeyer, Rob 'Commander' Pike, golan...@googlegroups.com, re...@codereview.appspotmail.com
See y'all in this thread next quarter!

Mike....@gmail.com

unread,
Sep 1, 2011, 9:56:11 AM9/1/11
to n13m...@gmail.com, golan...@googlegroups.com, r...@golang.org, gus...@niemeyer.net, jan....@nic.cz, r...@google.com, brad...@golang.org, r...@golang.org, golan...@googlegroups.com, re...@codereview.appspotmail.com
A possible compromise is to have it in $GOROOT/misc ? Would match well
with goplay . And maybe document its exists so its not lost.

http://codereview.appspot.com/4959047/

Russ Cox

unread,
Sep 1, 2011, 10:00:34 AM9/1/11
to n13m...@gmail.com, golan...@googlegroups.com, r...@golang.org, gus...@niemeyer.net, jan....@nic.cz, r...@google.com, brad...@golang.org, r...@golang.org, Mike....@gmail.com, re...@codereview.appspotmail.com
We have goinstall precisely so that we can say no
to things and still have them be accessible.

I assume gorun is already goinstallable.
I don't see the problem with telling people
that if they want to use this, they can run
1 command:

goinstall whatever.com/whatever/gorun

and then boom they're all set. If anything
that's even more impressive than not
having to run the command.

n13m...@gmail.com

unread,
Sep 3, 2011, 3:04:43 PM9/3/11
to golan...@googlegroups.com, r...@golang.org, gus...@niemeyer.net, jan....@nic.cz, r...@google.com, brad...@golang.org, r...@golang.org, Mike....@gmail.com, golan...@googlegroups.com, re...@codereview.appspotmail.com
Reply all
Reply to author
Forward
0 new messages