The Portuguese is trying to push through the fatten SPA coffers law again (pt link). The techdirt article has nice quotes about it such as SPA douchebaging “this happens everywhere in Europe except in Portugal” and pretty much spot on about everybody, including the authors and part of the government, being against it. You need to read portuguese to learn that despite being an ordinary bill it’s being market confidential which means public knowledge would be detrimental to Portugal, the EU, NATO or someone else. To sum it up, SPA is the Portuguese Authors Guild who’s main function is paying salaries to people who are not authors nor benefit authors in any way and accumulating debt. To solve that they wrote a bill legislating pathetically high levies on digital media and tried to get the previous government to rush it through on its last days. That failed due to public pressure which explains why now that it’s trying to be rushed again it’s marked state secret. This is happening on a country crippled by tax hikes generated by the utter failure of the government to stop government spending on bailouts of private frauds. Obviously, hiking a new tax that goes directly into the pockets of a private association of no social value is high on priorities.

Just to remind us how broken KPI is the Turkish CA issued fake Google certs. And how did this happen ? A signing root ended up on a firewall which went on create fake certificates in order to be able to tamper with secure connections. Speaking of which, France’s Free briefly sabotaged user traffic to remove ads which for some reason some freetards said was a good thing. There’s two things wrong with this, first looks pretty much like criminal communications interception and sabotage. Second it’s stupid from a carrier standpoint as it breaks common carrier status, usual last line of defense against stupid and expensive government ideas. So I hope someone at Free gets really burned about this.

There’s a disturbing number of func right in the first line. Obviously Go is strongly typed and I’m immediately sitting in Introduction to C trying to figure out to prototype a function that returns a list of functions that return void * and take two functions as arguments each taking two pointers to int as arguments having the function an argument that’s an array for pointers to void. This isn’t a good feeling. On the plus side Go’s syntax seems more natural reading left to right as “a function fib that takes no arguments and returns a function that returns an int”.
Then on the next line we have something I always hated with a passion, :=. I understand the point of making = and == very distinct but if you want that change == not =. := is just non natural except for a very strict group of computer scientists.

Then we have a return statement with a repetition from the fib() proto. Some people will say this is just good programing making sure you got the right thing, me I was saying just a couple of days ago every time you have to write exactly the same thing in two places you’re doing something very wrong. Of course you’re going to return func() int, you’ve said it 2 lines ago.
And then there’s something I put right up there with i += i++ + ++i. What’s a,b = b,a+b supposed to mean ? Do you do a = b and then b = a+b ? Is it a list assignment of (b,a+b) to (a,b) ? I can’t tell. I’m sure somehow Go has got ()less lists and it’s a list assignment but it confuses the hell out of. Also, = ? There’s two assignment operators ? One for initialization and another for changing values ? Really ? At this point we got :=, = and ==.

One point for Go, this example shows closure. On the other hand everything is strongly typed except variables which are inferred. f := fib() means, f is a variable of type whatever fib() returns so if fib’s interface ever changes some interesting stuff will happen and the interpreter will never be the wiser. You get all the hassle of typing and none of the benefits.

Let’s try to digest this in the context of Number is a pointer to itself. You create a new Number called e. First, new(Number) makes me sick after all these years of trying to kill new in JS. Then you say *e = x which I have no idea what’s supposed to do. Looks like pointer manipulation and you’re throwing away the new(Number) and pointing e to x. Or you could be deferring x somehow and making the value of e be the same as x.

func sub1(x *Number) *Number {
return *x
}

No clue what this is supposed to do. You’re taking an argument and returning.

Well, looks like it is. You’re splicing stuff off x and counting how many times you can do it before you run out of elements. This also tells me arguments are passed by value so this Number arrays are being copied left and right.

After all the weirdness above main is pretty simple. As far as I can tell Number is a list of Number objects and * can either push or pop depending on being a lvalue or a rvalue.
Hopefully the next one is better.

import (
"fmt"
"math"
)

So this should be a list of strings. Which means a,b = c,d isn’t list assignment. Hum.

make. Is it like new ? But different ? (turns out new allocates and returns a pointer like in C++ but make allocates some specific types and doesn’t return a pointer - bad) chan seems to be a qualifier so ch is a chan of floats. Then you can run a loop going a function on ch. Maybe this is the parallelization feature I’ve heard about. This is probably the first neat thing on the language so far so lets see where this goes. I’m sure term is defined to take a float64 but you need to type cast the int to keep the interpreter happy and you do it in a awkward way too, is float64() a function ? A keyword ? Syntax for cast ? Is it even important ?

A couple of lines down we find <-ch which looks like an iterator or generator. The syntax is awkward versus <= but the principle seems sound, you fill ch with values by going term on it and then pull them out as needed. The syntax does allows lazy evaluation but go func(ch) is kinda strange.

So <- is 2 operands, left is pop and right is push apparently, makes some sense. Not sure I like it though. Hopefully this is a back pressure mechanism and you evaluate term to fill ch when it reaches a low watermark. The syntax seems hard to follow and what if a single generator function fill more than one channel ? Confusing.

First time I read this main it felt like i was reading Conway’s Quantum Superpositional Perl. Turns out this is just a bad intro example that does something really fancy. ch is your 2.. channel and you can take a prime number from it right of the bat cause we know 2 is prime. Then you create a new channel that filters on this prime make ch this channel. So by now ch emits 2,3,5,7,9,.. . Then you extract the 3 and add a new filter to the channel filters using 3 so now you have 2,3,5,7,11,.. . And so on. Despite the awkward syntax this is actually very cool.

So what’s wrong with Go anyway ?

The syntax is very very awkward. It makes it hard to read both at the statement level and at the package level. It has a lot of brilliant stuff like streams and concurrency but the syntax is like if a C programmer read about Perl, wanted to make a language as awesome as Perl but looking like Python and not totally alien to Java programmers. As a result we get some stuff that’s proven a mistake in Javascript and madness like
type T struct {
a int
}
func (tv T) Mv(a int) int { return 0 } // value receiver
func (tp *T) Mp(f float32) float32 { return 1 } // pointer receiver
var t T

t.Mv(7)
T.Mv(t, 7)
f := T.Mv; f(t,7)

which is a declaration of an object with 2 methods crammed into C. The 3 function/method calls are equivalent.

Looking at the examples and some of the documentation it seems Go must undergo the same process JS is/should be undergoing, remove a bunch of optional syntax and confusing shorthands that allow easily misreadable idioms. When that happens Go will kick ass!

Remember those evil pirated music MP3Tunes guy was accused of evil pirating ? Turns out the files were evilly being pirated by the EMI itself. We used to tell kids not the take candy from strangers. Now it’s better just to tell them not to take mp3s form record labels.