Saturday, December 19, 2009

Say Hi to Arduino


After viewing all interesting stuff built using Arduino, I finally bought one myself from eBay this month.

Arduino is an open platform based on Atmel AVR microcontrollers. You can build various things out of it, from a simple temperature sensor to a working robot, it is just up to your imagination.

The hardware provides both digital/analog I/O. So that you can control various things.

A free IDE is provided for all major OSes. The language used is a based on C/C++ with a powerful library for a lot of stuff like controlling stepper motors / servos, getting values from keypads, displaying texts in LCD etc. You can also extend it with other modules called shields.

My plan is to build a portable jukebox for hymns using a piezo buzzer/speaker and a CNC drilling machine for building PCBs. I have already bought small of the parts and started to learn how to put things together. I will post the photos of the end products when they are done.

Sunday, November 29, 2009

The Go Programming Language


Google has invented a new programming language called Go. Behind this new language are Pobert Griesemer, Rob Pike, Ken Thompson - the creator of UNIX operating system.

Go is classified as a system programming language like C and C++. Google uses a lot of C++ and Python and Go can provisionally replace them because:

  1. Go is fast - the compiled Go programs run nearly as quickly as C/C++. System programming languages are used to write low level stuff like the OS kernels, device drivers, servers etc where performance is crucial.
  2. Go compiler is fast - one of the advantage of script languages like Python is a very fast development cycle. Though Go is a compiled language, its compiler returns almost instantly which makes it a good substitution of scripting languages.
  3. Go is safe - Being a static type language without pointer arithmetic, you would not make silly bugs like out of bound error. Go also has automatic garbage-collection. So it is both type-safe and memory-safe.
  4. Built-In support of concurrency - With a feature called 'goroutines', Go allows developers to take advantages of the multi-core systems nowadays.
  5. Go is object-oriented - Most people believe that OOP is a must in programming-in-large.
So what make Go really special ?

According to the Google TechTalk presentation, here are few points worth the attention.

Benefits of static-typed-compiled and dynamic languages - You get the development productivity of dynamic scripting languages like Python and Ruby yet you can get static typed compiled programs which are safe and efficient.

The language is designed to key things simple - orthogonal concepts instead overlapped ones, context free grammar, reduced typing, no type hierarchy, explicit module dependencies and explicit type conversion - all these features simply the language.

Commonly used concepts are natively supported - Strings, maps, communication channels, concurrency are built-in constructs - why involve libraries when the concepts are used all the time. Being native constructs, they can be optimized in code generation.

Separation of Types, Methods and Interfaces - Methods in Go are merely a special form of functions (taking an additional argument of the type it applied to). An interface is merely a list of methods to be implemented by a type in order to support the interface. In fact, you don't need to specify that a type supports a particular interface. If a type 'implements' all the methods required in the interface, it automatically supports the interface.

If two interfaces have a shared set of methods to be implemented, a type that supports both interfaces need only one implementation of the overlapped method (rather than duplication under the implementation of two interfaces).

So why a new language, rather than improving existing ones ?

The existing languages were not designed with the following in-mind:
  1. Bloated libraries
  2. Networking
  3. Client/server
  4. massive clusters
  5. multi-core CPUs
As mentioned by Rob Pike, clumsy type systems drive people to dynamically typed languages. The problem is both endemic and linguistic. You cannot just add things to existing languages to resolve the problem. So they start to design a new language.

The status of Go

The language core itself is quite stable but it takes time to build more comprehensive libraries and ecosystem around the language. The compilers need improvement as well. Programming construct like generics is also not yet supported (but maybe in the future).

The language has limited usage in Google. One of the known use is the Go official website.

Some people thought that creating a new programming language like Go is not justified because it doesn't bring anything new. I would say that they simply missed the point (I wonder whether they have viewed the whole TechTalk presentation at all) mentioned by Rob Pike - "it wasn't enough to just add features to existing programming languages, because sometimes you can get more in the long run by taking things away. "

The value of a programming language is not measured by no. of features (or new features) it has but the choices of features to be included and how they are put together. Efficiencies in development, execution and maintenance are the key factors to measure the usefulness of a programming language - It is all about efficiency !!

After all, a programming language is for programmers, not for those blog editors.

The key point of the Go programming language is to get things done fast and fun. What else do we need ?

References


Wednesday, October 14, 2009

A Curise To The Web - Patent 906


Eolas, the company that won a patent case against Microsoft in 2003, has filed another patent infringement lawsuit, apparently targeting as many high-tech companies it could find. Citing infringement on the very same patent as the one that resulted in a $585 judgment against Microsoft, Eolas is now suing 23 companies, including Apple, Google, Adobe, Amazon, eBay, Playboy, Yahoo, and YouTube for implementing browser plug-ins in one form or another, plus another patent that addresses the use of asynchronous JavaScript and XML (AJAX).

If it wins the case, Ajax will no longer be a free technology to use in modern web.

I will be rich if I had patented the structured exception handling when I was young : ) - I don't think there will be a program nowadays not handle the error using structured exception handling (except tiny ones)

Monday, September 28, 2009

Google Chrome Frame changes the game

Google announced a new free product called Google Chrome Frame (GCF or simply CF) which is basically a plug-in for IE to bring HTML5 support (via Webkit engine) and better JavaScript performance ( via V8 engine) to IE. These technologies are cornerstones of Google's Chrome browser.

With this plug-in installed, web developers need only one line to switch from IE's Trident engine to CF:

<meta http-equiv="X-UA-Compatible" content="chrome=1">

Or

the user can add the cf: prefix in the URL to use CF to render the page.

Watch this video for a brief introduction.





So why brother to bring these stuff to IE? With CF, web developers can stick to HTML5 and Javascript (and Ajax) to build rich internet applications (RIA) without using proprietary technologies like Silverlight, Adobe AIR (which based on Flash) and Sun JavaFX.

The results? The bar for developing RIA is lowered. The Web is less depending on individual vendors. More devices can enjoy better web experience without whether proprietary plug-ins are available in specific platforms.

Both Webkit and V8 are open source. If the future of Web (Web 3.0) is built around HTML5 and JavaScript, we can imagine that the OS game is over (at least changed). Who will care what OS is running when all the functionalities can be obtained from the web ? Most people will definitely look for faster and cheaper (or even free) alternatives unless you are gamers or professionals that rely on sophisticated software to learn your living.

There is a long way to go there but this is the vision behind Google Chrome OS. Intel is also working on Moblin, a Linux based lightweight OS which can be booted within seconds.

The driving forces behind HTML5 are Google, Apple and Mozilla (the browser makers other than Microsoft). Microsoft has low motivation in supporting HTML5 as Silverlight is their answer to the future of the Web. However, Microsoft doesn't release Silverlight for other platforms except Mac OSX. It only provides support for open source effort - Moonlight, which brings Silverlight to Linux.

Recently, Microsoft and Intel team up to bring Silverlight to Linux targeting Atom platform. Suddenly, the Moonlight project seems becoming irrelevant.

The only selling point for Silverlight is the multi-programming languages support provided by the lightweight .NET runtime being a part of Silverlight.


Chrome Frame official site: http://code.google.com/chrome/chromeframe/



Saturday, September 19, 2009

LEGO Mindstorms Sudoku Solver

Amazing work. Scan the sheet, recognizing the numbers, solving the sudoku, writing the numbers back to the sheet, all by this little LEGO Mindstorm.

轎夫擊鼓戰東瀛

Good job!




Monday, September 7, 2009

Mac OS X 10.6 Reviewed by Ars Technica

The only Mac OS X 10.6 review that we need to read. Everything else is secondary.


Highligts:
  1. Developer oriented release (though there are new end-user features)
  2. Intel-Only
  3. Around 50% in disk footprint
  4. On demand driver download
  5. Chinese input using touchpad
  6. No Rosetta by default (by installed on demand from the net)
  7. No Quick Time Player 7.0 by default (but can still be installed)
  8. 64-bit kernel (but not the default)
  9. 64-bit system applications
  10. OpenCL
  11. Grand Central Dispatch (GCD) facilitates developing multi-threading applications using lightweight queues served by centrally controlled threads
  12. LLVM / Clang tool chain in addition to GCC
  13. Block construct (i.e. closure in many dynamic) for C language
  14. Quick Time X
  15. Only US$29 for existing Leopard users
  16. Exchange support via Mail, iCal and Address Book
  17. Screen recording
  18. Faster boot / shutdown time
Play attention to the compatibility. There are massive overhaul under the hood (it is said that 95% modules touched for refinement)


It blocked me from upgrade as my wife is using Adobe CS3 (which has known issues with 10.6)

Thursday, September 3, 2009

Jealous !? Apple store robbed

Probably these guys cannot get iPhone and MacBook Pro during their debuts, so they smashed the glass and grabbed a lot of Macs and iPhones from an Apple store in Marlton, New Jersey.

Apple is well known for security in their OS X (virus never an issue) but not for their store ! No metal gateway, just glass.




Source: http://www.appleinsider.com/

Tuesday, September 1, 2009

Automata starts here!

I wanted to start a blog long time ago and I had registered several blogs on different topics but I ceased to maintain them individually shortly after them were created.

Finally I came up with a new blog and a new site using Google's services with my own domain automata.hk on late August 2009. That is the beginning of www.automata.hk and blog.automata.hk.

I want to build a web to consolidate all my interests with a complementary blog (for posting the changes about the site contents and what is coming up).

The subjects of the web and the blog are mainly about IT and some other topics that I feel interested. Hope you enjoy the contents of both of them. And feel free to leave a comment.