

Introducing the Go Playground - enneff
http://blog.golang.org/2010/09/introducing-go-playground.html

======
sgt
What is the point of Go? What niche does it fill? Is it easy to start working
with Go and integrate existing C libraries with it?

~~~
enneff
We initially called Go a "systems language," because we wanted to use it to
build systems software. What we mean by that is high-performance networked
programs that run on multicore machines. The kind of server stuff people
traditionally use C or C++ for. Since Go's release last November, we've seen
interest in Go from a lot of different places. There was the high-performance
computing crowd that we were targeting, but beyond that we saw a lot of users
of interpreted languages who craved more speed with the same ease-of-use.

We're yet to see which major niche Go fills, if any. There's a growing
community of people from different backgrounds using it, and they seem to
enjoy it. I personally think it's a lovely language to write all kinds of code
in. I recently rewrote our continuous build client in Go, and I found it a
cinch to write it in clear, reliable, maintainable way. It's definitely worth
checking Go out because, even though it ticks a lot of the same boxes as
existing languages, it's quite different from anything else out there in many
subtle ways. Certainly for writing server daemons it totally kicks ass.

It's easy to get started. The standard library is featureful
(<http://golang.org/pkg/>), and there's a lot of good documentation
(<http://golang.org/doc/docs.html>). As for integrating with existing code, Go
comes with a tool called cgo (<http://golang.org/cmd/cgo/>) which allows you
to write Go code that links with C code. It's pretty easy to use, and there
are many third party libraries (<http://godashboard.appspot.com/project>) that
use it. There's also Go support for SWIG for linking against C++ code.

~~~
mahmud
Everything that Go has is already in Java.

In fact, Go looks like Java with an ActionScript 3.0 syntax.

Is there anything going on for it that Java doesn't have, or do better?

[Edit:

By the way, I keep hearing Go is an excellent language for writing daemons.
Why is that? when it doesn't even have anything resembling exception handling,
much less a condition system?

This is the Go spec: <http://golang.org/doc/go_spec.html>

]

~~~
enneff
> Everything that Go has is already in Java.

If you think that, then you need to take a closer look at Go, or Java, or
both. In short: Go compiles to native code (no VM), it has a totally different
type system (no classes, not everything is an 'object' like in Java), it
permits fine control over memory layout and allocation, it has powerful
concurrency primitives (goroutines and channels), and more. Do yourself a
favour and look beyond the syntax. It really is very different to Java (or
Actionscript?! that's one of the more bizarre comparisons I've heard).

~~~
mahmud
Java compiles to native code too, when and where it matters.

I have looked at Go, as much as the spec would permit me, and what I found was
a safe C (or a faster, native Pike) with better concurrency primitives and a
dash of higher-order functional goodness.

With respect to the finer control over memory allocation; anything one
couldn't have done with pools in a GC'ed language? I would love to see how Go
handles intricate manual memory layout specification under heavy load, and how
sufficiently smart the compiler/runtime is as it tries to guess the best GC
strategy :-)

I wish you all the best.

~~~
kaib
> With respect to the finer control over memory allocation

I think you are understanding it wrong. Go lets you control memory layout,
think deciding how things are laid out in a struct. In Java you get
indirection and pointers instead. System programming refers mainly to this
ability of layout out your data in memory. This makes a world of difference
when you are doing high performance code and can control cache locality.

Edit, found the link:
[http://marc.info/?l=git&m=124111702609723](http://marc.info/?l=git&m=124111702609723)

------
fauigerzigerk
I would love to see Go on GAE, and yes I generally love to make obvious
statements that have been made countless times before ;-)

~~~
Chickencha
There's an issue in the issue tracker for it that you can star if you haven't
already:
[http://code.google.com/p/googleappengine/issues/detail?id=23...](http://code.google.com/p/googleappengine/issues/detail?id=2382)

It might not make a difference, but it can't hurt.

------
signa11
personally for me, the fact that you can include a "live programming" in the
documentation is pretty cool. almost the feel of a "repl" :)

------
jlgbecom
I've been really excited about Go, but I've been stuck in one of those
dilemmas where I don't _really_ learn a language until I work on a tangible
project with it, and I can't seem to come up with anything I need to write in
Go.

I'm sure something will surface eventually, and I hope soon, because
everything about Go makes me very excited about programming.

------
KaeseEs
Has any headway been made on the issue of generic programming in Go? I haven't
heard anything since the discussion on Russ Cox's blog about it a few months
ago ( <http://research.swtch.com/2009/12/generic-dilemma.html> ). It would be
very, very interesting if the techniques described by Stepanov in Elements of
Programming could be applied in Go without a runtime performance hit or the
destruction of Go's fantastic compile times (commenter Rivorus from the blog
post seemed to think this was possible, and that even the baroqueness of C++
templates could be avoided).

e: Unfortunately I'm too busy with class and work lately to really learn more
than a trivial amount of Go, but it's nice to hear news every so often so that
I can remain abreast of developments and hopefully not be flat-footed when I
do have time to dive in

------
kuszi
nice feature but Go is available online at <http://ideone.com> since several
months

~~~
enneff
Ideone is pretty cool, although it seems slower, and the editor doesn't
indent.

Also, it's running a _really_ old version of Go. (<http://ideone.com/spBzw>)
It's at least 400 revisions out of date. We intend to keep the golang.org
Playground up-to-date.

~~~
kuszi
I like the examples at the Go Playground. Ideone uses gc-2010-07-14 so it
seems to be quite ancient but ok - it is not the up to data version, but I
really do not get your comment about speed (do you mean the execution time,
response time or what?) and the indent feature (It seems to me there is no
auto indent feature and the "Tab" key moves you to the examples list).

~~~
enneff
There's a bug in the interface code for non-Chrome browsers. In Chrome, the
tab key works, and the text area auto-indents. It's a small comfort but it
makes a world of difference for me.

There have been language changes as recently as this week. Go moves fast
(although it's unusual for existing code to break).

~~~
kuszi
> "There's a bug in the interface code for non-Chrome browsers" - thank you
> for the explanation, now this suggestion is clear.

------
fictorial
I am more interested in the server-side sandbox. There are a few like codepad,
SPOJ but not many that with source available.

~~~
kranner
> not many that with source available.

Do you know of any that do come with source? I'd love to have a look.

<http://codepad.org/about> has a useful 'Paranoia' section: it was the
starting point for me to build my own code-judging service. I couldn't find
anything else at the time.

edit: codepad cites geordi: <http://www.xs4all.nl/~weegen/eelis/geordi/>

That's non-standard C++ so it might not be immediately useful, but I managed
to find some nice info in the source on which system calls to consider
dangerous.

~~~
_delirium
<http://hackage.haskell.org/package/mueval> is a Haskell one, used by
<http://tryhaskell.org/>

~~~
kranner
Thanks.

