Google Go programming language - any role in the BSD world?

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer
Go is an open source project, distributed under a BSD-style license.

Code:
// Copyright (c) 2009 The Go Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//    * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//    * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
Hm, I was doing some searching to see what I'm going to learn when I finish learning Python/Django. Maybe this is worth looking into, it seems interesting. My other choice was Java, though I'm not too sure if that would pay off and be worth learning.
 
I've been interested in concurrency issues ever since I started programming back in the 1980's. I've read some of what Rob Pike has written about CSP-style channels in languages like Newsqueak and Limbo, but since I never got around to installing Plan 9 or Inferno, I haven't had a chance to try them out for myself. So I'm hoping we get a port of Go to FreeBSD.
 
varnie said:
it is very fascinating and interesting but i didn't see Go in FreeBSD ports available.

Google released go a few days ago. It's going to take some time for someone to pick it up and create a port for it. That's assuming someone is willing to put the effort in :e
 
Whenever I read something like this, I wonder just how many Java-like languages we really need... (From a 10-minute cursory skimming of the go site, it appears to be very similar.)
 
A search on their mailing list, turned up this, which suggests it shouldn't be to horrible a task to port to FreeBSD. I've been thinking of trying to get it working on my laptop, but more pressing matters need doing first.


From what I've seen so far, Go looks as ugly as Lisp, Perl, and C++ having a threesome in the back yard. However, I find it strangely appealing, who knows, perhaps it will replace C & C++ to some extent in 10 or 15 years, if it gains suitable access to common C/C++ libraries by then.


The goroutine stuff alone, looks like a sexy boost over C programming, as long as we can still fork();.
 
TerryP said:
From what I've seen so far, Go looks as ugly as Lisp, Perl, and C++ having a threesome in the back yard. However, I find it strangely appealing,

You know- I could be having the worst day of my life, and come on here, and find a post that cheers me up. That cracked me up :p. You've also earned my 150th post.
 
Terry, are you actually referring to the act or the possible offspring?
(please refrain from using the terms 'spawn', 'kill', and 'child')
 
Ruler2112 said:
Whenever I read something like this, I wonder just how many Java-like languages we really need... (From a 10-minute cursory skimming of the go site, it appears to be very similar.)

One big difference: Go doesn't produce bytecode to run in a virtual machine. In this respect, it's more like C or C++.

But, as I said above, my main interest is in how Go handles concurrency. Specifically its use of CSP-style channels. I think having good language support for concurrency is going to be one of the key elements of success in today's multiprocessor, multicore world. Parallel computing is still too hard (or too easy to get wrong, to put it in another way.) So I'm interested in anything that addresses those issues.
 
Userland was not what I was thinking of when I posted this. FreeBSD development and coding (that BSD world) was.
 
DutchDaemon said:
Userland was not what I was thinking of when I posted this. FreeBSD development and coding (that BSD world) was.

I think Go is more likely to be used for userland apps than for kernel or world. At least until it gets out of its current experimental phase.
 
Sure, but that's really a no-brainer.. So that would be a superfluous topic in the userland forum ;) I'm sure it will be in ports soon and used like all the other languages in /lang/.
 
On second thought, I probably went too far when I said that's more likely that Go will be used for userland apps than for world.

I can see it being used to implement various server daemons.
 
TerryP said:
From what I've seen so far, Go looks as ugly as Lisp, Perl, and C++ having a threesome in the back yard. However, I find it strangely appealing, who knows, perhaps it will replace C & C++ to some extent in 10 or 15 years, if it gains suitable access to common C/C++ libraries by then.

And it ain't the first time. From where do you think D came? Not that I don't find D (not so) strangely appealing. :)

TerryP said:
The goroutine stuff alone, looks like a sexy boost over C programming, as long as we can still fork();.

To me, this language looks like an attempt to make so called "cloud" computing more accessible to the programmer. And the logo I've seen looks strangely like Plan 9's Glenda...so maybe she was involved in the romp, too. I am not very excited about it, but will follow it to see where it goes.
 
mascots

estrabd said:
And the logo I've seen looks strangely like Plan 9's Glenda...so maybe she was involved in the romp, too.

Plan 9's Glenda and Go's gopher were both created by Renee French -- who is married to Rob Pike.
 
Thanks to the excellent porting effort by Devon O'Dell go does work on FreeBSD. Build instructions are the same as for other platforms, just set GOOS=freebsd.
Code:
[roberto@t42 ~/gosrc]$ cat hello.go
package main

import "fmt"

func main() {
   fmt.Printf("hello, world\n")
}
[roberto@t42 ~/gosrc]$ 8g hello.go
[roberto@t42 ~/gosrc]$ 8l hello.8
[roberto@t42 ~/gosrc]$ ./8.out
hello, world
[roberto@t42 ~/gosrc]$ uname -a
FreeBSD t42 8.0-PRERELEASE FreeBSD 8.0-PRERELEASE #0: Mon Nov 23 08:42:00 CLST 2009     root@t42:/usr/obj/usr/src/sys/GENERIC  i386
 
Go build instructions on FreeBSD

Follow these instructions to build Go on FreeBSD

The following packages are required, install them from ports or packages at your convenience.

bash
gmake
bison
mercurial

The rest assumes that you are using bash, and that you are going to build the system under $HOME/go, binaries going to $HOME/bin.
Create $HOME/go and, if needed $HOME/bin, then

Code:
export GOROOT=$HOME/go
export GOARCH=amd64
export GOOS=freebsd
export GOBIN=$HOME/bin
hg clone https://go.googlecode.com/hg/ $GOROOT
cd $HOME/go/src/
./all.bash

If the build is successful, it should end with

Code:
--- cd ../test
X known bugs; 0 unexpected bugs

Where X is the number of bugs known at the moment

For the i386 platform, use GOARCH=386

Regards,
Roberto.
 
rdeiriar said:
Thanks to the excellent porting effort by Devon O'Dell go does work on FreeBSD. Build instructions are the same as for other platforms, just set GOOS=freebsd.

Sweet! I'll install this first thing after upgrading to 8.0.
 
If you have any questions, email me. I'm having some issues getting to a FreeBSD/i386 SMP machine right now and there's apparently a latent bug in there. If anybody could help out with that, it would be nice.

--dho
 
Back
Top