Go = Google Oberon ?
Dr Maurer of
http://www.murus.eu/
announced he is rewriting parts of his Murus and jMurus software for the new Google language 'Go'. Now, ths
means something. Dr Maurer is a real Modula-2 diehard. So if he changes over to 'Go' it must be something
special.
So I paid some attention to 'Go' as well. When you look at some smaller sources you see a resemblance to
Modula-2 and Oberon. Many 'Go' keywords are borrowed from Oberon and Modula. Also the syntax of 'Go' is based
on Oberon. Even parts of the underlying thoughts are strongly influenced by the school of Niklaus Wirth.
Still, when you go deeper into the 'Go' language, you soon find out that 'Go' is just another C compiler. Here
http://golang.org/doc/go_tutorial.html
you find the following piece of text:
Note the piece in red. I hoped that fluency in Modula-2 and Oberon would also do when trying to read the 'Go'
documents. But that was too much asked. The tutorial is only comprehensible when you are a C, C++ or Java
programmer. It teaches them to use some kind of type casting. But 'Go' is too chaotic to be used as such by
true followers of Professor Wirth. I guess Dr Maurer was spoiled a bit by his Java attempts and now embraces
'Go' because 'Go' is C-ish while still leaning somewhat against Modula-2.
An example
The Go tutorial starts with an example:
package main
import (
"os"
"flag" // command line option parser
)
var omitNewline = flag.Bool("n", false, "don't print final newline")
const (
Space = " "
Newline = "\n"
)
func main() {
flag.Parse() // Scans the arg list and sets up flags
var s string = ""
for i := 0; i < flag.NArg(); i++ {
if i > 0 {
s += Space
}
s += flag.Arg(i)
}
if !*omitNewline {
s += Newline
}
os.Stdout.WriteString(s)
}
Similarities with Oberon, for this small example:
package main
import "fmt"
func main() {
fmt.Println("Hello, world")
}
and it compiled to a lean executable of no more than 1 Megabyte. After stripping, only 750 Kb remained. Not
bad for some good code. A comparable Mocka executable is something like 30 KB. And obc makes a very small
executable file, of less than 4 kilobyte. So far for 'Go' I guess.
Page created on 4 August 2011 and
Page equipped with FroogleBuster technology