Evolving concurrency, like memory management did

As processors become faster and multiprocessor systems become cheaper, the need to take advantage of multithreading in order to achieve full hardware resource utilization only increases the importance of being able to incorporate concurrency in a wide variety of application categories.

In this article we are evaluting a new approach to the concurrency.
In the last five years computers are becoming even more parallel.
Intel is pushing multi-core achiteture also on commodity personal computers.
Neverless the computing power is ofter not well used: one again, hardware is a step head of our day-by-day software development.
Remember when the 80286 came into light.
The 286 was able to provide a multi-programming architecture but without memory management protection.
We had to wait 386 hardware to see software working on preemptive multi-tasking, because software cannot cope with unprotected memory. In one word, it costs too much to develop a operating system without the new features the 80386 bring to us.
What about concurrent programming? Can we look similarities in the  concurrency field?

Continue reading “Evolving concurrency, like memory management did”

iPhone programming

iPhone is the brand-new Apple product which has changed the way Apple thinks. Because of iPhone, Apple strip the word "Computers" from its brand name. And because of iPods and iPhone products, Lepoard developmenet slip a bit, blurring the focus on pure technology.
To be true, I do not beat on  the iPhone success, but the product success is at least  bright this year. And the iPod touch has also added value to the iPods product catalog. But I am an IT-man, damn you boy! So I want to buy it to play with it, to program with it!

The iPhone Open Application Development, is a fresh book on iPhone Developement, edited by O'Reilly which come into play. The book has less then 280 pages, and is well organized. First of all, the bad news: the book lacks figures and tables (only one, and not so useful) and no Photo on it. Then breaking the iPod firmware is not a thing Apple likes a lot. As far as I know, it is NOT illegal, because Apple is opening the device too.
Anyway, breaking the iPhone firmware can prevent you to get the upgrades so, you must know what you are going forward to do.

And now the good news: the book is well written, and guide the user from the beggining to the end.  There are a lot of way to free the iPhone from the jail.

After that, you can also use Linux to program on the iPhone, where the Apple SDK seems only "PC Mac"-enabled.

The book is composed of 7 chapters. After unlocking the iPhone (first chapter), the author explain us how to write code for it, and what is Objective-C. Objective-C is a very nice idea developed by Brad Cox, in the 1980. It is a C++ language "ante litteram". I like the ideas of Objective-Ch because you get the power of C for fast tasks (like  you know, coding your quicksort or your perfect B-trees :) and you get a true dynamic O.O. language, like SmallTalk is. Objective-C was not so lucky, and there are only two major implementation: the GNU one and the Apple one, used to build the entire MacOSX.
I have no time to study it a lot, but I suggest you to code the iPhone in Objective-C.
Then the books start to explore iPhone features like:

  • Basic user interface building blocks
  • Graphic Services and animation effects. You get also a Coreflow-like animation in the Appendix
  • Sound Control
  • Deep integration. A nice thing is the way to make calls: you simply ask the emmeded Safari to open a "tel://" url

The code presented is always very compact, and the style is nice.
The Appendix give us a lot of code samples.

Programming a so riche device is not easy, but the good news is you have a full O.S. to work with.
Java midlets and J2ME are much more difficult to use, if you will find your way with Objective-C.
A very good book, for very nice techno-guys, and not (only) for nerds!

 

 

 

Javascript and Smalltalk

There is a future for SmallTalk? I was a very strong fan of the SmallTalk language, but in the last five years I have seen more and more contraction of its usage in the IT field.

The OLPC project, which uses also Squeak Smalltalk and its done by the core team fo Squeak, is not going very well.

Anyway, Dan Ingalls, one of the father of Smalltalk, is working on a new project called Lively. It is a rewrite of Morphic in Javascript, especially target  for building a Squeak-like interface.

 The interesting part of this work is a paper outlining the limitation of javascript as programming language. I have tried in the past years to look for ajax and or web 2.0 javascript libraries, but I feel very difficult to develop with them.

From the Paper we underline these parts:

Loading multiple JavaScript applications into the same virtual machine is problematic.[…] For instance, if two programs
happen to use the same names for global variables or functions, the overlapping variables or functions of
the first program will be replaced with the corresponding features of the second program, resulting in
unexpected behavior in the subsequent execution of the first program. Since JavaScript will not typically
give any warning messages or errors in such situations, the resulting behavior can sometimes be a total
surprise; in many cases the errors resulting from such situations may not be discovered until much later.

 

Evolutionary development approach is a necessity. Due to the highly permissive, error-tolerant nature of
JavaScript, JavaScript programming requires an incremental, evolutionary software development
approach. Since errors are reported much later than usual, by the time an error is reported it is often
surprisingly difficult to pinpoint the original location of the error. Error detection is made harder by the
dynamic nature of JavaScript, for instance, by the possibility to change some of the system features on
the fly.

 

A lot of room is left in optimizing JavaScript performance. Current JavaScript virtual machines are
unnecessarily slow. Even though JavaScript is a significantly more dynamic language than, for instance,
the Java programming language, there is no fundamental reason for JavaScript VMs to run two orders of
magnitude slower than Java virtual machines.

 

Memory management capabilities of the current JavaScript VMs are poorly suited to large, long-running
applications. Current JavaScript virtual machines have simple, 1970's style garbage collectors

 The reason of these issue are simple:JavaScript was intially a language for web developers, small and easy to use, and very compact.
Absence of errors or warning is a nightmare, if you care of your digitating time.
And Javascript is slow because no one will write  long script with it.

A very compact and clean discussion can be found in http://javascript.crockford.com/javascript.html 

Fixing these problems is hard. Until the current  implementation will not provide a better way of error detection, writing javascript code will be a very long and time-consuming task.

And using a so old garbage collector, give a chance to a c/64 BasicV2 to beat your code:  you are awared, guys :)

Anyway, there is a good set of javascript libraries out of there (prototype and jquery, for instance but not only), so you should be quite happy 

 

 

 

B Wolf Version 1.0

I am happy to announce Version 1.0 of BWolf my book manager writte in python django. I have just installed it for my first customer. You can grab the 1.0 version from the Subversion repository.

 

This first release basic features are:

  • Book categories and topic organization. Books are shown in nice page of 10 elements each.
  • Ability to "checkout" books (not yet perfect but it works)
  • Ability to create "Events" and to attach books to them (interface will be improved soon).

Happy download!