I should not be writing this article ! ...... however, trying out very simple programs in Ada 2005 made me realise how I have lost touch of the syntax etc !
Ada is a high level language which is a favourite for safety critical and real time systems. Trying out the 'Hello, World' in Ada,
The syntax has a 'pascal like' sing to it, Ada program files have extensions adb or ads. The compiler used for Ada is GNAT (which is a part of gcc).
BASH (Bourne Again SHell), the name seemed to echo between 'Bashing' to 'Bourne Trilogy'. The command line for nearly all *nix Operating Systems is actually a programming language !
Android is a Google platform for mobile devices. IDE Eclipse allows for the Android plug in and the programming is in Java.
Fig 1. Android Logo
The 'Hello World' program was indeed some struggle, not because of the code but rather since one has to wait for about a minute as the emulator executes the program.
I got inspired to try out GAMEMAKER 7.0 after skirting through the wonderful book by Jacob Habgood and Mark Overmars.
Fig 1 . The Game Maker's Apprentice
GAMEMAKER reduced the 'coding' aspects and allows creation of games using GUI. Excellent software ! in some beginnner's pursuit I was able to create game snippets similar to PAC-MAN and SUPER-MARIO.The software is also supported by GAME MAKER LANGUAGE (GML) which is similar to Java/C++.
Fig 2. Game snippet similar to SUPER-MARIO. The 'mushrooms' add life and energy whilst the 'snakes' reduces it.
WINDOWS does not support multithreading concurrent and real-time structures. What an irony !.The most popular OS does not allow systems and structures which can control the most breathtaking technologies of the day. Aerospace , trains, nuclear power plants and other state of the art embedded technologies cannot use WINDOWS !
When I learned about Real-Time and Concurrent Systems ,it was not very acceptable that Microsoft would make such a redundant OS. A bit of dabbling on the internet led me to Article Number 22523 in Microsoft knowledge base.
Fig1. Article 22523
Which clearly stated that ,
"In no sense can Microsoft Windows be considered a "real-time" system. It is a message-driven, event-polling system, with nonpreemptive scheduling".
Being initiated in Windows and using it for about ten years , did make me stubborn and I tried to look for other alternatives which would allow to construct real-time structures in Windows.
Cygwin came to my rescue ! However on running threads in POSIX and tasks in Ada, I realised that it is only a cheap makeover.
Python and Ada however worked in windows , Ada because it is a concurrent language and platform is not an issue. Python did execute the threads , though on a closer inspection it revealed that Python reduces the concurrent codes to their sequential evil twin brother.
A simple code which which prints out 'Hello World' and the thread number ;
Fig 2. The threading code
gives slightly different results with different OS. When run on Ubuntu Linux ,
Fig 3. Execution in Ubuntu
The order of execution of the threads is 3,4,1,5,2 then 1,2,3,4,5 and then 5,4,3,2,1. Thus the order of execution is non-deterministic , typical of real-time systems.
However on Windows ,
Fig 4. Execution in Windows, 'evil twin brother'
the order of execution is deterministic , as seen above. Thus windows prevents the real-time characteristics of non-determinism and reduces it to sequential processes.
Linux confirms the standard characteristics of concurrency as nondeterminism and preemption , hence a joy for all concurrent programmers. Seems Bill Gates got it wrong this time !