Welcome to Gaia! ::

Is this something I could pick up easy from Java? What benefits does Go have over Java? Has anyone used it for a project yet? Should I wait until there is more widespread support for it? It looks like the general C syntax I am used to from Java.
Sitwon's avatar

8,500 Points
  • Gaian 50
  • Member 100
  • Contributor 150
The classic "hello, world" example compiles to 1.3MB. Sure it's a statically-linked native binary, but still. 1.3MB. Almost too big to fit on a 3.5" floppy. And to put that in perspective, QNX used to have a demo of their OS with a GUI that would boot off a single 3.5" floppy. This just prints "hello, world" to the console.

(To be fair, the statically-linked C version of "hello, world" comes out to over 800KB when compiled with gcc.)


Anyways, that observation aside, Go looks like an enticing new language to me. I've been following it loosely since it's original announcement and now that it's hit 1.0 I'll probably start playing around with it for some personal projects. I'm pretty excited about learning and using it.

If you're fluent in Java you should be able to pick it up. It has some very different mechanics in some places, but no worse than going from Python to Ruby.

One very important thing to note is that Go isn't Java and it's not trying to be. Go's syntax might be a little reminiscent of Java, but it's really aimed at over-throwing languages like C and C++. Go, unlike Java or C#, is a native-compiled language. It make platform-specific native binaries. Not bytecode to be run in a VM.
That's interesting. Do you know why the hello world is so big?
Sitwon
(To be fair, the statically-linked C version of "hello, world" comes out to over 800KB when compiled with gcc.)
Dear God. I didn't realize that. Even pulling out all of the tricks:
$ cat hello.c
#include <stdio.h>
int main() { printf("%s", "Hello, World") }
$ gcc -static -ffunction-sections hello.c -o hello -Os -Wl,-O1 -Wl,--gc-sections -Wl,--strip-all
$ ls -s hello
704 hello

burning_eyes

... Looks like most of it is just glibc cruft.

Let's hope, now that Ulrich Drepper has moved on, that the eglibc maintainers get a little more weight behind the idea of slimming it down.
Sitwon
One very important thing to note is that Go isn't Java and it's not trying to be. Go's syntax might be a little reminiscent of Java, but it's really aimed at over-throwing languages like C and C++. Go, unlike Java or C#, is a native-compiled language. It make platform-specific native binaries. Not bytecode to be run in a VM.
What do you mean with over-throwing? The "becoming it's successor" kind of overthrow?
Gabriel Faust's avatar

Original Gaian

The20
Sitwon
One very important thing to note is that Go isn't Java and it's not trying to be. Go's syntax might be a little reminiscent of Java, but it's really aimed at over-throwing languages like C and C++. Go, unlike Java or C#, is a native-compiled language. It make platform-specific native binaries. Not bytecode to be run in a VM.
What do you mean with over-throwing? The "becoming it's successor" kind of overthrow?
When language is involved in a coup d'etat, the reigning oligarchy gets two distinct options;
  • learn from the new guys
  • fall to the wayside, still referred to as "why you should/n't do x" and used occasionally in a classroom environment

For examples of the secondary, learning relatively modern languages usually start with "BASIC's GOTO statement is a bad example of referring to a line of code" or "What's COBOL?".

We learn from the mistakes and perfections of the past generation, which is why wysiwyg editors no longer behave like Visual Basic and why auto garbage handling is in bluray players.

When a new language takes center stage, we don't get rid of the last language, but we start using it as a jewel to polish and to comparatively cut other languages to mimic. Sometimes we start mimicing a language's behavior with languages in coding behavior, sometimes we make updated versions to keep in touch with our userbase.
Sitwon's avatar

8,500 Points
  • Gaian 50
  • Member 100
  • Contributor 150
The20
Sitwon
One very important thing to note is that Go isn't Java and it's not trying to be. Go's syntax might be a little reminiscent of Java, but it's really aimed at over-throwing languages like C and C++. Go, unlike Java or C#, is a native-compiled language. It make platform-specific native binaries. Not bytecode to be run in a VM.
What do you mean with over-throwing? The "becoming it's successor" kind of overthrow?
While C is still a fantastic language, it is a bit outdated. In order to bolt on the modern abstractions we like to use we are forced to write very verbose code. On the other hand C++ is a very powerful language with many more abstractions than C, but it's still not very easy on the programmer and has an archaic syntax. At first glance, Go mixes the clean appeal of C with some powerful new abstractions like C++. The language authors kept the syntax and grammar simple and predictable, and they adopted some modern ideas from other high-level languages while eschewing others which they feel do more harm than good. It's something of a culmination of what we have learned from that past three or four decades of high level languages with an eye towards where we are going (eg, saas and concurrent programming).

So what I mean by over-throwing is that I hope Go begins to displace C and C++ as the defacto choices for native-code development. Furthermore, I hope that improving the tools available to developers writing native-code software will subsequently improve the quality of their code and reduce the time and cost to develop it.
Sitwon
So what I mean by over-throwing is that I hope Go begins to displace C and C++ as the defacto choices for native-code development. Furthermore, I hope that improving the tools available to developers writing native-code software will subsequently improve the quality of their code and reduce the time and cost to develop it.
I strongly disagree.

While I agree that C has too few abstractions and that C++ has too many, and while I will agree that it'd be nice for something better to come along, I disagree that Go is that language. I don't believe it has the right abstractions. (Honestly, you're sounding like those Pascal evangelists.) One look at the new features of C++11 and the discussions going on in the C11 working group, and you see they're not standing still.

I see a place for C for many years to come - especially since the language is small and can be easily implemented in a small compiler and standard lib. (The 800k size created by GNU tools is unfortunate, and I blame Drepper.) I even see some place for C++ until we find better concurrent and FRP abstractions.

I've been meaning to take a look at Rust (which looks interesting), but what I'm looking for in a language doesn't seem to exist - or if it does, they're using different language to describe it.

I suppose I should design my own.
Sitwon's avatar

8,500 Points
  • Gaian 50
  • Member 100
  • Contributor 150
psychic stalker
Sitwon
So what I mean by over-throwing is that I hope Go begins to displace C and C++ as the defacto choices for native-code development. Furthermore, I hope that improving the tools available to developers writing native-code software will subsequently improve the quality of their code and reduce the time and cost to develop it.
I strongly disagree.

While I agree that C has too few abstractions and that C++ has too many, and while I will agree that it'd be nice for something better to come along, I disagree that Go is that language. I don't believe it has the right abstractions. (Honestly, you're sounding like those Pascal evangelists.)
I'm not evangelizing, I'm just saying that it's exciting to have something different in the space that has the potential to be a competitor and truly challenge the status quo. Even if Go isn't the language to displace the these granddaddies it's a major infusion of fresh blood and ideas.

psychic stalker
One look at the new features of C++11 and the discussions going on in the C11 working group, and you see they're not standing still.
Great, but C++ isn't going to suddenly become less complex, if anything newer standards tend to make it more elaborate.

psychic stalker
I see a place for C for many years to come - especially since the language is small and can be easily implemented in a small compiler and standard lib. (The 800k size created by GNU tools is unfortunate, and I blame Drepper.) I even see some place for C++ until we find better concurrent and FRP abstractions.
I agree that C will have a place for many years to come, and I don't think C++ would or should disappear. But it couldn't hurt to have a third option that strikes a balance between these two extremes, and maybe adds a little something different to the mix as well.

psychic stalker
I've been meaning to take a look at Rust (which looks interesting),
I only recently found out about Rust and haven't had a chance to learn much about it or get excited about it. Also, Rust isn't backed by Ken Thompson and Rob Pike.

psychic stalker
but what I'm looking for in a language doesn't seem to exist - or if it does, they're using different language to describe it.

I suppose I should design my own.
YES. As I've been telling you to do for years now. Right after you finish writing that book on C++. =P
Sitwon
psychic stalker
but what I'm looking for in a language doesn't seem to exist - or if it does, they're using different language to describe it.

I suppose I should design my own.
YES. As I've been telling you to do for years now. Right after you finish writing that book on C++. =P
Bah. Someone already wrote that book: Koenig and Moo.
Sitwon's avatar

8,500 Points
  • Gaian 50
  • Member 100
  • Contributor 150
psychic stalker
Sitwon
psychic stalker
but what I'm looking for in a language doesn't seem to exist - or if it does, they're using different language to describe it.

I suppose I should design my own.
YES. As I've been telling you to do for years now. Right after you finish writing that book on C++. =P
Bah. Someone already wrote that book: Koenig and Moo.
Well then you have no excuses for putting off writing your language.

Seriously, you're going to throw away at least the first implementation anyways so the sooner you get started on it the sooner you can throw it out and start all over.
Sitwon
psychic stalker
Sitwon
psychic stalker
but what I'm looking for in a language doesn't seem to exist - or if it does, they're using different language to describe it.

I suppose I should design my own.
YES. As I've been telling you to do for years now. Right after you finish writing that book on C++. =P
Bah. Someone already wrote that book: Koenig and Moo.
Well then you have no excuses for putting off writing your language.

Seriously, you're going to throw away at least the first implementation anyways so the sooner you get started on it the sooner you can throw it out and start all over.
How encouraging.

I swear you'll hate what I come up with. it'll be all concatenative and FRP and s**t.
Sitwon's avatar

8,500 Points
  • Gaian 50
  • Member 100
  • Contributor 150
psychic stalker
Sitwon
Seriously, you're going to throw away at least the first implementation anyways so the sooner you get started on it the sooner you can throw it out and start all over.
How encouraging.
I was referring to the Fred Brooks quote, "plan to throw one away; you will, anyhow."

psychic stalker
I swear you'll hate what I come up with. it'll be all concatenative and FRP and s**t.
What makes you think I'll hate it? I've never used a concatenative language before but I've been very curious to try one. In particular I'm wanting to play with Factor at some point.
I read the wiki on concatenative programming languages and I still don't get what it is supposed to be.
29582351c3
I read the wiki on concatenative programming languages and I still don't get what it is supposed to be.
Think of it like Forth, but curried like Haskell with anonymous parameters.

Basically, everything is a function. But everything take any number of parameters. So, the number 3 is a function named 3 taking n parameters and returning a tuple of 3 plus n values. And any function that consumes 3 consumes also its parameters. It's like Unix shells except the text on stdin is also on the parameter list and anything not used by the program is returned as more parameters.

@Sitwon: I'm thinking of something vaguely reminiscent of Eiffel with syntax like REBOL and functions like Forth.

... With a C-like syntax.

You'll hate it.

Quick Reply

Submit
Manage Your Items
Other Stuff
Get Items
Get Gaia Cash
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games