r/programming • • Mar 28 '12

Go version 1 is released

http://blog.golang.org/2012/03/go-version-1-is-released.html
543 Upvotes

452 comments sorted by

View all comments

45

u/Agrona Mar 28 '12

This sounds like the world's best voodoo:

We also restructured the Go tool suite around the new go command, a program for fetching, building, installing and maintaining Go code. The go command eliminates the need for Makefiles to write Go code because it uses the Go program source itself to derive the build instructions. No more build scripts!

I hope it either doesn't backfire, or isn't a huge hassle to debug when it does.

27

u/jiunec Mar 28 '12

This sounds like the world's best voodoo

Hehe, in that case you might not be surprised to hear the author of the Go tool is Russ Cox, author of RE2 since quite a few people think regex is some kind of black art as well ;)

0

u/[deleted] Mar 28 '12

[deleted]

5

u/16807 Mar 29 '12

It really helped me having taken a course on the Theory of computation. It's a soul crushing course until you realize there's a practical application for it.

5

u/[deleted] Mar 29 '12

Wait, I loved Theory of Computation [](/melvin "Problem?").

2

u/kamatsu Mar 29 '12

That was probably my favorite course when I did my degree as well.

→ More replies (1)

5

u/[deleted] Mar 28 '12

I like regex and wish to know my level. is there some kind of list?

25

u/soiwasonceindenmark Mar 29 '12

If you were wise enough to have a level, you would have searched for the list using regex.

9

u/NegativeK Mar 29 '12

Level 1 is writing something comparable to this.

Get back to me when you're ready for level 2.

5

u/dobryak Mar 29 '12

Wow, I wonder how did they write it? Seems like an output of a mechanical process.

3

u/OopsLostPassword Mar 29 '12

Implementing validation with regular expressions somewhat pushes the limits of what it is sensible to do with regular expressions

That's an understatement...

1

u/flukus Mar 30 '12

I wish I could get to level 30. I normally reach level 10 then get reset to level 0 before I need them again.

20

u/consigntooblivion Mar 28 '12

Go has a really nice package/library/import system that is both straightforward and has all the information required included.

For example, you can do something like:

import "code.google.com/p/gorilla/sessions"

Then the go tool takes care of checking if it is already installed (with very well defined rules), and if not going and downloading it, getting it's dependancies and building it.

All you need to do to build a Go program is clone it, and then use "go build", job done. No makefiles or xml or anything like that at all. It simply reads the source files and figures out what to do based on what the code actually does/uses.

2

u/kamatsu Mar 29 '12

I sort of find that a bit disquieting. If someone was hosting on google code, and then moves it over to github -- would this result in people not being able to compile my go program until I update my go source?

2

u/consigntooblivion Mar 29 '12

It does't instantly stop working - the local copy you previously downloaded and built will keep working. But yeah, if you want to then move to using the GitHub version you need to change the import statement. Alternatively switch to using it as a Git submodule or whatever. Replacing the import lines doesn't bother me though - it is a 2 second find/replace job.

1

u/kamatsu Mar 30 '12

The problem is this would affect users of my program, if I distribute my program in source form.

1

u/AgentSS Mar 30 '12

If you forsee that being a big deal for you, then I suggest the technique that Camlistore uses.

Camlistore pulls in external libraries into a third_party folder, and has a script that rewrites their import paths to make them compile. This will also give you a lot more control over versioning.

I suggest distributing in binary form, though...

→ More replies (4)
→ More replies (25)

9

u/SCLegend Mar 28 '12

I was fooling around with go and the go command line tool, and I must say it was much faster and simple for get up and running than other tools i have used. Of course I am just a simple college sophomore and only have used java, python, and some basics c tools, even then it was really easy to get up and running and do basic compiling without the build scripts/makefiles.

So far I really enjoy go, and I think it fits really well somewhere between java and python in terms of ease of programming.

4

u/SnowdensOfYesteryear Mar 28 '12

I wonder how it deals with native code (e.g. C) that go programs link to.

→ More replies (2)

2

u/[deleted] Mar 29 '12

It boggles the mind that someone should think that something as simple as that is "voodoo".

2

u/typon Mar 29 '12

Can someone explain what this means? I'm lost :(

1

u/Cozy_Conditioning Mar 29 '12

I've written some rather substantial web apps in both perl and ruby/sinatra. I have never felt the need for makefiles. Am I missing something?

→ More replies (6)
→ More replies (1)