Tuesday, November 17, 2009

Sports Funding

So the Australian Federal government got back its report on sports funding. In a nutshell it says stop spending big bugs on a handful of professional athletes and put the money where it will have an impact on the general health of the population. Personally I could not agree more.

There are 22 Million people in Australia. I don't see any reason why we should be more capable at sport then Americans of whom there are 300 million. so It stands to reason that they will produce ten times as many world class athletes as we will. It should be noted that we also have no chance of outspending the country that is still the worlds largest economy.

The Dummy spit by the head of our Olympic Committee was to be expected. But then again I have little respect for an organization which globally almost sees its self as above the law. Heck they have managed to pressure government to make special laws for them at several Olympic games recently. Then again the AOC position seems to be based on the tricle down economics. That seeing Australians win gold will make Obese kids want to get out and play sport. No it dosn't work, instead they'll send a hero TXT. WHile waithing for their high sugar high fat food items to be put into a brown paper bag (produced by a proud sponsor of the Australian Olympic team naturally).

The Sydney Morning Herald has a number of articles exploring both sides of this issue, though none of them allow you to leave comments. Personally, as a tax payer I agree with the report. I'd rather see my tax dollars go into local sporting facilities then into the chase for Olympic gold.

Monday, November 16, 2009

Why Go is a good thing

I've seen quite a few posts and comments on blogs along the lines of go is just a crap version of X I can't understand why google is wasting time on it, instead of (just using | improving) X. There are several answers to this.

Firstly Go is probably different from X and does not have the same stated goals as X. Especialy where X turns out to be a high level programming language that has a very large runtime, or runs in a VM or is interpreted.

Secondly Diversity is good. Think of Go as just another mutation of C, which has some new and useful features. Having written a few tiny programs I can see two so far. The first is that even though we are statically typed it is amazing how rarely a type actually appears outside of a method signature. The implicit typing that occurs when you set variables to initial values gets things correct an awful lot of the time. And the big one is concurrency. Everyone knows that programming concurrent software is hard. As the trend these days seems to be to multi core CPU's it is also becoming a very important area. Big thing is that Every program I have written so far has included gorouteens. they are a great way to generate data (if any place you would be inclined to use a generator in Python you'll be creating a go routine.

It occurs to be that a list comprehension style syntax for defining generators would by handy here. But thats just sugar as it where and I can definitely live without it, much as I have been able to live without anonymous functions in python.

I think that Go is a worth while addition to the programming language ecosystem. And this is true weather it survives or becomes extinct.

Generics or Bust

I have to add my voice to the choir calling for generics to be added to Go. As others have noted Go contains no fewer than four parametrized types: arrays, slices, maps and channels. Such types are so mandatory that it seems impossible to build a programming language without them.

And it is an annoying asymmetry that I as a programmer can't define an equally parametrized linked list or binary tree type. I expect that these will come eventually. My hope is that it will be sooner rather than later though.

Saturday, November 14, 2009

The Go Language

So there is a new language in town. Having gone through all of the docs I have to say it looks interesting. The need to destinguish between new and make is a little messy, the language FAQ agnoledge this however.

I like the type system, with the implicitly implemented interfaces. It does look like Go programs will involve quite frequent casting. Ditto for the built in concurrency primitives, and I expect that most programs will make quite frequent use of them. Where in Pthon I might use a generator I could well see myself using a goroutine in Go, and getting my generated items from a channel.

A lot of effort has been made to make the language terse, which is a nice feature for a low level language to have. And yes making switch statements default to breaking at the end of each case unless told otherwise. Thank you finally a language that reflects how switch is actually used!

Personally i don't see why they didn't just call the looping construct loop, rather then for. seeing as it is a general purpose looping construct that can be invoked in several ways that look nothing like a traditional for loop. Still this is a minor thing.

What does look certain is that Go programs aren't going to look much like C or java, once enough people learn how to use the language natively. The basic constructs are just different.

Now that I've gotten this far its time to try some actual programming in Go. To this end I've retrieved the list of 99 Lisp problems and I'll see how I go in solving them using Go. Step one will be to build a linked list typo work with. It will be interesting to see how much mindshare Go can capture. And when we can expect a Windows version, lets face it lack of Windows support is glaring omission at present, even if I don't use Windows I still recognise its importance in the marketplace. (Now there's a scary thought Go.net ... its only a matter of time i suspect.)

Wednesday, November 11, 2009

Lost in a Sea of Ideas

The following is a repost as the original got spammed with junk comments and Blogger dosn't have an easy way to remove large numbers of comments in one hit without dropping the entire post.


I have found myself lost in a sea of new concepts lately. Firstly I read Andrew Poltkin's presentation on Rule based systems in Interactive Fiction. I have to say it was discouraging in terms of the RPG I was writing. Short point being that This is harder then you think it is.

Then I came across the following article (PDF). Which is an interesting read. And raises a point that I missed the last time I saw it. Namely stop treating JavaScript as it it was a class based language with awkward syntax.

The thing is that It is a prototype based language with two kinds of links, and a couple of missing functions. The big problem with learning to write JavaScript properly is that most tutorials make this mistake, And their is a lot of truly awful JavaScript code samples out their.

I don't really have any new insights on prototype based inheritance (yet), so if your interested have a look at Douglas Crockford's JavaScript site. I won't pretend that I get everything Douglas is getting at but I'm convinced that he understands it and that this is a good place to start hacking.

So where does this leave my project?

Up in the air a little. As I'm determined to do it right as it where. And need to teach myself how to operate effectively in a prototype based language. I'm pretty well sold that a rule based approach might be the best thing I can do. I encountered this when I tried to add conditional logic to my RPG, My conditional tests required inimate knowledge of how the engine stores its data, which seemed way to coupled. What I seemed to need was a simpler data organisation. I can't think of anything simpler then a flat database of facts, and that sounds pretty rule based. So Murphy's law is in full swing and I'm going back to the drawing board. Just as soon as I've learnt some new tricks

Monday, November 02, 2009

To misquote a classic

A long, long time ago...
I can still remember
How that code used to make me smile.
And I knew if I had my chance
That I could make those servers dance
And, clients, they'd be happy for a while.

But XML made me shiver
With every page I'd deliver.
Bad news in the log-file;
I couldn't take one more crash.