views:

5814

answers:

17

I've been looking on golang.org for a Windows compiler, but I can't seem to find it. I can only see Linux and OS X compilers. Does anyone know if Go programming can be done on Windows, or is it something that Google hasn't implemented yet?

+23  A: 

It hasn't made it onto the Go Lang FAQ yet, but from the changelog:

Why doesn't Go run on Windows? We understand that a significant fraction of computers in the world run Windows and it would be great if those computers could run Go programs. However, the Go team is small and we don't have the resources to do a Windows port at the moment. We would be more than willing to answer questions and offer advice to anyone willing to develop a Windows version.

mbarnett
So- if you wanna run Go, grab your friendly neighborhood Ubuntu VM (or whatever your favorite distro) and go to town...
Dave Swersky
Although this answer is heavily upvoted, it is now out of date.
Kinopiko
@ Kinopiko- How so?
Baddie
http://code.google.com/p/go/wiki/WindowsPort
Maxwell Troy Milton King
+4  A: 

Despite the fact that Go is only two days old, this question has already become a FAQ on the Go mailinglist. (Unfortunately, it has not yet been added to the FAQ list on the website.)

Basically, Go is done by a very small group of people, so they simply do not have the time nor the resources to do a Windows port. That very small group of people also happens to be the people who invented Unix, so that was kind of a natural first target.

Jörg W Mittag
AFAIK, they develop Go during their 20% time, not full time. (That's what I read, anyway.) Anyway, my answer was meant to be very-large-tongue-very-deep-in-cheek.
Jörg W Mittag
Actually, the history page states that while it started out as a spare-time project, it is now a full-time project for at least some of the developers. I edited the answer to basically remove the remarks about part-time constraints.
Jörg W Mittag
And I'm upvoting you for that :)
OscarRyz
They invented Unix? So this is a retirement project?
Henk Holterman
Well, they also invented Plan9, the successor to Unix. And Inferno, the successor to Plan9. And C. And Limbo, the garbage collected systems programming language that Inferno is written in. (So, in some sense the successor to C and predecessor to Go.) And the Newsqueak concurrent programming language (also in some sense a predecessor of Go, especially the Goroutines.) And the Very Concurrent Garbage Collector that is used in Limbo, Inferno and also in some implementations of Standard ML. And UTF-8. So, it's not like they haven't kept busy in the 40 years between Unix and Go.
Jörg W Mittag
+1  A: 

Not yet.

The authors of Go have very very deeply roots on non Windows operating systems ( Trivia: who of them created no less than the very UNIX operating system )

So, don't expect to have a Windows port from them any time soon.

The language is open source, so it will be just a matter of time ( make it from 6 - 8 ehrm months ) for a Windows implementation will be available.

OscarRyz
Your connection between an author of Unix writing the compiler in his spare time and "don't expect a Windows port" is interesting, given that they point out in the changelog (see mbarnett's answer) that it's just because they do not have the resources.
Jed Smith
Just another (soft) wording for "don't care".
ttvd
Yes, is like Linus creating a port of git for Windows himself. That will never happen ( the port is being created by others though )
OscarRyz
A: 

Thats smart, no windows port. In the true spirit of sun trying to cut out microsoft, now .NET is more powerful than ever, and IBM controls java. Microsoft may suck, but they suck on 90+ % of computer, no microsoft, no go.

thomas
That was.. insightful
shylent
It's... a systems programming language. You may not have noticed, but that particular market isn't exactly dominated by Microsoft.
Bob Aman
+3  A: 

So if you, like me, are on Windows a lot of the time and want to do some Go programming right now, you can do it on a VM. I use VirtualBox running Ubuntu in seemless mode. I already had it set up because I like Linux better than Windows for a lot of things.

Building and working with Go has been totally painless for me. I have a Bash open in a terminal to run my build and try my app. The source directory is a shared folder between Windows and Linux (a VirtualBox feature but I'm sure VMWare has the same thing). I edit my code in Komodo Edit on Windows and use Mercurial for the same source code on both OSes.

Rob Russell
A: 

Although there is no Windows version at the moment, it can presumably be compiled using Cygwin on a Windows platform.

You could compile it under cygwin w/ lots of rework, but even then, you would end up with a 6g/8g compiler that outputs ELF, not a native windows binary. However, this would still be a good first step.http://code.google.com/p/golang-on-cygwin/Once builds are successful, the next step would be fixing the compiler to generate windows executable code.
Alan S
A: 

Various efforts to port Go to windows are underway.

The most advance and that can already build and run some code is here: http://code.google.com/r/hectorchu-go-windows/

uriel
+9  A: 

Early Port of Go to Windows...

Alistair Collins
A: 

I guarantee it will be on Windows. :-) It is too cool not to. A lot of game developers will embrace this language over time. Great work GO team !!!!

bret
+6  A: 

Full disclosure: I am the lead developer on this project and owner of the company in question. Nevertheless, I think it's a direct answer to the question. I spent a long time pondering whether to jump in here, and even dug through the FAQs on Meta Stack Overflow to see what the general feeling on etiquette for this kind of answer was, and it seems to be OK, so here goes.

My company is currently working on a Go compiler for Windows that, as far as I know, is the only 100% Windows-native (ie, it doesn't require Cygwin or MinGW to run) and also the first commercial Go compiler in the works. We have this product fast tracked, and expect to have a public beta test sometime in the first quarter of 2010.

Russell Newquist
A: 

Initial Windows Port of Go Language can be downloaded from here: http://code.google.com/p/go-windows/

A. Romo
A: 

As suggested above I got ubuntu on the windows machine (with virtualbox) & then got go.

anonymous
+3  A: 

Have a look at

Summary

  1. Download and extract the zip-file on WindowsPort.
  2. Add four environment variables and edit your PATH. See below.
  3. Compile, link and execute your HelloWorld.go

Environment variables needed on Windows:

  • GOARCH = 386
  • GOBIN = <your path to go\bin> I.e C:\go\bin
  • GOOS = windows
  • GOROOT = <your path to \go> I.e. C:\go
  • PATH add %GOBIN%

HelloWorld.go

package main

func main() {
    println("Hello World!");
}

Compile with 8g, link with 8l and then execute. Example:

8g HelloWorld.go
8l -o HelloWorld.exe HelloWorld.8
HelloWorld
Jonas
A: 

Another Win32 build of Go (released 2010-08-04):

http://code.google.com/p/gomingw/downloads/list

Kolo32
A: 

If you're looking for a Windows port of Go, like I was; This video over at YouTube was very helpful. Got me all setup and coding in about 15 minutes:

Beginner's Guide - Using Go on Windows

I hope this helps.

lucifer
A: 

I used Go Language on Windows with IntelliJ plugin. http://www.philipandrew.com/?p=46

Phil