Sunday, November 15, 2009

Go: Google’s new open source programming language

Google never seems to just be satisfied with the status quo, and when they run out of fields to compete in they create their own! Google’s new “Go” programming language is one of their newest ventures, a language which is an amalgamation of Python and C++.

The Go language, in development since September 2007, has been unveiled by Google along with the release of a free and open source compiler. In fact, Google has released both a stand-along compiler implementation with cryptic names such as 6g (amd64 compiler), 8g (x86 compiler), and 5g (ARM compiler) and one which is a front-end for GCC (gccgo).

Born out of frustration with existing system languages, Go attempts to bring something new to the table, and mix the ease of dynamically typed and interpreted languages with the efficiency of compiled languages.

So why make a new programming language?

Google believes that the current languages have run their course. The prominent languages in use today (C/C++, Java, C#) are all based around a similar syntax, and updating and adding new features in these language consists of piling on libraries, with little or no upgrade to the core of the language itself. What Google intends to do requires more than just the addition of a new library.

Hello World in Go:

package main

import "fmt"


func main() {
fmt.Printf("Hello, ??n")
}


The landscape of computing has changed a lot since C, and as Google notes “Computers are enormously quicker but software development is not faster.” Languages have had to morph quite a bit to take on support concepts such as parallel processing, and garbage collection.

Go, on the other hand has been designed by Google from the ground up as “a concurrent, garbage-collected language with fast compilation”.

In order to not alienate the majority of developers though, its syntax is quite similar to C, and would not take much time for a developer to catch on to.

Go has accomplished some impressive feats. The language is designed to compile fast and Go can compile a “large" program in a few seconds on a single computer. It is designed to simplify the creation of application which can better utilize today’s multi-core processors. The language supports concurrent execution and communication between concurrent processes natively, and is fully-garbage collected.

Goroutines allowed are Google’s answer to threading in Go, and any function call which is preceded by the go statement runs in a different goroutine concurrently. A feature called channels allows for easy communication and synchronization between such routines.

Unlike other object oriented languages, Go has a much “simplified” type structure, which disallows sub-classing! Go offers a different flavour of object oriented programming using interfaces, which Google believes will simplify use.

By using interfaces, explicit type hierarchies need not be defined, instead, a type will satisfy all interfaces which are subsets of its methods. The relationships between types and interfaces need not be defined explicity! This can have some interesting implications as people can add interfaces to connect unrelated types even later in the development of an application.

Go seems inspired by Python as well. Python has been one of Google’s favoured languages and was the sole language supported on Google’s AppEngine when it launched. Like Python, Go supports “slices”, which allow you to refer to parts of arrays using a simple syntax. Thus for an array “a” with 100 elements, a[23,42] will result in an array with elements 23 through 42 of a. Go also tracks the length of arrays internally, further simplifying array usage. Additionally, Maps in Go allow you to create “arrays” with custom index types, and are a native feature of the language.

One consistent point in the features of Go is that it is better to have one excellent implementation of commonly used features such as garbage collection, strings, maps etc. rather than have them rethought and re-implemented in each program.

As nearly all Google products, Go is “beta” and not yet suitable for production use. By releasing it early Google hopes to garner a community around it and hopes that enough people will be interested in it to justify continued development.

Get out there and grab Go now! Like any Google product it has the capacity to become standard for the next generation.

Tuesday, November 3, 2009

NC State’s New Fingernail Size Chip Stores Data Worth Space in 20 HD DVDs

North Carolina State University engineers have developed a material to allow a small fingernail size chip that stores data worth space in 20 HD DVDs. It is equivalent to 250 million pages of text.

It is far greater than the storage capacity allowed by any computer memory system.

The team of the researchers has been led by Dr. Jagdish “Jay” Narayan, John C.C. Fan Family Distinguished Professor of Materials Science and Engineering and director of the National Science Foundation Center for Advanced Materials and Smart Structures at NC State. The team employed the strategy of selective doping. It involves adding impurities to specific materials thereby causing a change in its properties.

The research is expected to result in more efficient production of energy and a better fuel economy for vehicles. Besides, the heat produced by semiconductors during the production is also expected to be reduced dramatically, making the entire process more effective in turn.

Metal nickel was added to a ceramic, magnesium oxide. It resulted in nickel atoms, 10 square nanometers in size. The 90% reduction in size (a pinhead has a diameter of 1 million nanometers) is dramatic.

“Instead of making a chip that stores 20 gigabytes, you have one that can handle one terabyte, or 50 times more data,” Narayan says. The discovery also aides “spintronics”. The emerging technology harnesses the production of energy that’s produced by spinning electrons. The process releases no heat. The team manipulated the electron spin. It resulted in harnessing the energy of the electrons as well. The results of the study may be highly significant for all those aiming at producing more efficient semiconductors.

Motorola Droid vs. Apple iPhone [Comparison Round-up]


So the Motorola Droid – the ‘Google phone’ we’ve all been waiting for – is finally here and ready to take on the undisputed king of the hill, Apple’s iPhone.
 
Thankfully, price watcher BillShrink has already declared that the end cost of usage for both the iPhone and the Motorola Droid, over two years, would be the same: approximately $2800-$3800, depending on your tariff plan. Keeping that in mind, the only thing left to compare between the two are the phone’s functions itself.
 
A lot of websites have started the comparisons, so here’s a quick round-up for your benefit.
 
Engadget (with video): “The kinetic scrolling on the Android is much faster than on the iPhone. However, the iPhone still has an edge in browsing the Internet using Wi-Fi and the default browsers of both systems. (But) the Droid definitely seems faster than previous Android devices.”
 
Wired: “The Droid goes beyond the iPhone in two key areas: Like the Palm Pre, applications can run in the background, and switching among them is a smooth process. And as a robust GPS device it accepts and gives turn-by-turn verbal instructions, making it the closest approximation yet to a total GPS solution that obviates the need for a dedicated vehicle device.”
 
DanceWithShadows (with point-by-point analysis): This comparison may seem to have been overly biased towards the Droid. Some may go as far as say it was written by an Android/Google fanboy... From the first looks, the Motorola Droid does seem like a serious contender to the title.
 
TechPP (with point-by-point analysis): It is very tough to beat Apple on the music and applications front. But looking at the specifications and initial reviews of Motorola Droid, it does have lots of things going for it that previous devices have not.
 

 
Droid iPhone comparison chart