Friday, June 26, 2009

D : New entrant in Systems Software Arena

In the history of computing C language appeared in 1972 with the humble start for writing portable Operating System kernel (UNIX) C. On the wings of Unix success, C reached far and wide to be used from embedded systems to supercomputers. It went onto succeed in both system software and application software. Soon it was being used for projects huge in size (Lines of code) and complexity started to loom over such projects. Only highly disciplined programmers and process kept large projects going while others started to failed. The symptoms of failure were - missing project timelines, huge delay in bug fixes etc.

With appearance of C++ on computing scene (1983) Object Oriented Programming features became available and raised this project size limits to higher levels. C++ added more design and structure to programs and enabled programmers to succeed in big projects with lesser effort.

Further increases in complexity of projects have brought virtual machine based platforms like (Java and .NET). These languages brought automatic memory management and avoidance of pointers and are successful in application programming. These language realizing the problems and ugliness of C++ syntax have done a lot of clean up in language design and keep improving to suit developer needs.

Till now these language features, advancements and cleanups had been missing from systems programming, because virtual machines are not suitable for system programming. The scene is changing now with appearance of a new systems programming language named 'D' [1]. D has consolidated the good features of C, C++, Java and C# etc to provide a clean syntax.

Some of the most useful features of 'D' which C/C++ programmer would like [3]:
- Single inheritance with support for interfaces. Interfaces add clarity to class design.
- Both automatic and manual memory management available side by side. This permits faster application development.
- Array bounds checking is in-built. This would reduce number of 'long mysterious debugging sessions'.
- Removal of header files and preprocessor directives (macros)
- Removal of 'virtual' keyword, forward declarations etc. These are things which don't add value to software but are there to keep compilers happy.
- Function argument marking - in, out etc. This simplifies API interfaces.
- Unicode support in strings, for ASCII data char arrays are available.

There are two compilers available for D - GCC front end (gdc) and Digital Mars (dmd).

If you are wondering whether it can challenge C and C++ on their home ground i.e. speed, surprise!!! It runs shoulder to shoulder with C and C++ [2].


The language has a growing community which is developing standard libraries and tools. The parallels of – C standard library, STL and Boost libraries are already available as Phobos and Tango library.

This newcomer language has another special significance because that it has not started in software labs of any big company but rather in Open Source community.

References:
[1] Wikipedia entryhttp
[2] Performance results
Key to understanding these figures is that under the hood - gcc, g++ and gdc compilers use same GCC back-end for code generation.
[3] D feature set and comparison

Wednesday, June 24, 2009

हिंदी पठन और लेखन : भाग 2

विंडोज XP को हिंदी भाषा में प्रयोग करने के लिए हिन्दी इंटरफेस पैक (Windows® XP हिंदी Interface Pack)बहुत ही बढ़िया चीज है।

मुख्य बटन पर Start के बजाय प्रारंभ देखने का आनंद ही कुछ और है।

इसे पाने के बारे ज्यादा जानकारी यहाँ से प्राप्त की जा सकती है।
http://www.microsoft.com/downloads/details.aspx?displaylang=hi&FamilyID=0db2e8f9-79c4-4625-a07a-0cc1b341be7c

अगर आपका विंडोज सत्यापित हो सके (सबके पास तो इंटरनेट नहीं होता) तो यह आजमाएँ:
http://epandit.wordpress.com/2006/11/21/windows-xp-%E0%A4%B9%E0%A4%BF%E0%A4%82%E0%A4%A6%E0%A5%80-interface-pack-lip/

महोदय नें हर तरह से डाउनलोड की जानकारी दे रखी है :)

Friday, June 5, 2009

Reading Source Code : Best tools available

I explored this GUI wrapper for cscope. I am using it to read Linux kernel sources.

The tools looks very promising. It has useful features like :
1. all cscope operations
2. Concept of project open/close etc, file/folder selection
3. Call graph and navigation
4. Multi-color syntax highlight

It can open a chosen file in any editor - vim, kate etc.

See a snapshot below.

[Click on the picture to enlarge]

Pros:
Memory consumption is low and speed is good.
Folding- code, comment, function.
Bookmarks
Its free and open source.

Cons: The two features I found missing (compared to SourceInsight(windows only)) are:
- rich coloring of syntax (global / local symbols),
- zero effort navigation (automatic preview of symbol definition, easy jump to symbol in another window).
- catching duplicate symbols definition/declarations etc.

Its the best tool on Linux. For windows I find SourceInsight good option(available for 30-day trial).

Reading source is fun :)

PS: Currently only one developer is maintaining KScope code. If you have time to spare and want to do something cool, pitch in. This tool is made in wonder world of Qt/C++.

Wednesday, June 3, 2009

The reasons that we are here : Essence of religion

Last year on birthday of Guru Nanak ji, I had a vacation and I decided to spend some time to reading what this saint said.

I found this
http://en.wikipedia.org/wiki/Guru_Nanak_Dev#Teachings

- Naam Japna: Chanting the Holy Name and thus remembering God at all times (ceaseless devotion to God)
- Kirat Karō: Earning/making a living honestly, without exploitation or fraud
- Vaṇḍ Chakkō: Sharing with others, helping those with less who are in need

This is a very short list - easy to remember, simple, profound and very practical.

I tried to reduce it further but couldn't -
1. Naam Japna (नाम जपना) is very important because that will fulfill 'the reason that we are here' on Earth. i.e. to see/enter 'Kingdom of heaven' and preparation to enter it.
Without this, even a good execution of 2nd and 3rd point may leave a person with void/emptiness inside.

2. Kirat Karo (कीरत करो) is very vital for person and society both.
Read about a demonstration by Guruji here.

Lack of it has made corruption so prevalent in my country.

3. Vand Chakko (वंद छको) has some obvious and some subtle implications. I am reminded of Amrapali asking Buddha of reason of 'joy and peace' she experienced when Buddha came with his disciples to her place to eat. Said the enlightened one 'you are learning the joy of giving'.

Helping others keeps the ego low. Inflated ego is obstacle to spiritual realization and daily human interaction.

Somewhere in the race to tame the nature, we have missed on these fundamentals.

I think we should always strive, to be able to say 'yes I do' to all the three.