Thursday 1 January 2015

Countsource in Go

I have made one of my Go utilities public on GitHub. It is called countsource, and is a small command line utility for counting source code lines. It can also count binaries, but only number of files and file size. There is also a config file to configure what to count.

Available here.

I love Go

Here's a confession: I love the Go programming language.

I got the taste for it during a master's degree level computer course at UiT The Arctic University of Norway. Some of the assignments were done using Go, and I felt comfortable with the speed of development and the speed of execution.

I've made several utilities with this language, and I like using Go for this kind of stuff. Go is a complete and fully functional language and seems somehow "transparent", meaning the OS functions are easily available. To me, anyway. So it feels very easy to use.

Some of the advantages include:
  • it's staticly typed
  • it compiles very quickly
  • strict compile time features
  • garbage collection
  • support for concurrency included at the language level
  • runs at a speed very close to compiled C
  • has a formatting utility included (use "go fmt myprogram.go") to make any Go program consistent
Try it out on the Go website.