Go 1.2 Is Released
Written by Mike James   
Wednesday, 04 December 2013

Just after celebrating its 4th birthday, Go gets a decimal point upgrade. Can it break out of its niche?

 

goicon2

Go is Google's replacement for C and as such it tries to be simple and lightweight. The big problem it seeks to solve is balancing simplicity of implementation while supporting modern programming ideas. Most people who encounter it do think that it does a good job but only as far as it goes. There are lots of sophisticated programming features that it doesn't support and which its designers admit to not knowing how to incorporate into the language without making it like other high-level languages. 

For this reason even a decimal point upgrade is viewed as a chance to see what has and has not been included in the language. 

The first thing to note is that the Go language team is trying to create updates more frequently. It is only 7 months or so since the release of version 1.1. 

The biggest change to the language is the introduction of a new three-index slice. In Go a slice is a portion of an array. It is Go's way of providing what look like dynamic arrays, but implemented as a view onto a static array. For example,

var array [10] int

creates a static array holding ten integers;

slice:=array[2:4]

creates a slice that maps to array elements array[2] to array[3], i.e. up to but not including array[4]. Slices can be resliced so modifying the way they map onto the underlying array. The new syntax allows you to specify a maximum capacity of the slice. For example:

slice:=array[2:4:7]

fixes the slice at a maximum of five elements, i.e. 2 to 7, even if it is resliced. This can be used to restrict access to the data in the array beyond a given point.

The other major change is that Goroutines are more strongly preemtively scheduled. This fixes something that looked like a bug in that a Goroutine could hog the system if it didn't return and only one user thread was available. However, for it to work you still have to make a function call as the scheduler is only invoked on entry to a function. At the same time the stack size has been increased and the limit on the number of threads has been removed. 

In addition the standard library has been improved and added to and now nil pointers are detected and handled.

Overall the changes are small and not going to satisfy the critics who demand additional features such as generics, exceptions, tail call optimization and so on.  

Programmers who try Go seem to like its approach and yet they don't tend to become fanatical ambassadors for it as is the case for Ruby, Python, Haskell etc. Perhaps Go just isn't radical enough or perhaps it is the basic uncertainty of whether it will still be around next year or the year after. Being open source doesn't give it a secure future when Google is holding the reins. 

 

goicon1

More Information

Go 1.2 is released

Four years of Go

Golang

Related Articles

A Programmer's Guide To Go With LiteIDE

Go Is Four

Go Programming Language Turns 3       

Getting started with Google's Go

Why invent a new language? Go creator explains

Ready to Go - Go Reaches Version 1

Go in Google App Engine

Google App Engine Go-es Forward

Go with Google - Yet Another Language!

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Banner


Copilot Improves Code Quality
27/11/2024

Findings from GitHub show that code authored with Copilot has increased functionality and improved readability, is of better quality, and receives higher approval rates than code authored without it.

 [ ... ]



Data Wrangler Gets Copilot Integration
11/11/2024

Microsoft has announced that Copilot is being integrated into Data Wrangler. The move will give data scientists the ability to use natural language to clean and transform data, and to get help with fi [ ... ]


More News

 

Last Updated ( Thursday, 05 December 2013 )