I happen to attend a marriage function today @ Trichur,Kerala. The function was held in a Catholic Church over there. I landed there almost one hour before the scheduled time. I happen to see a board in Malayalam which mandates ( or requests ? ) people to place the footwear before entering the prayer hall. I entered the prayer hall by placing my footwear outside. After thirty minutes people began to flock into the hall as there were three marriage ceremonies to be solemnized.
To avoid the crowd , i came out of the hall and astonished to see only a few footwear outside.
This prompted me to make a remark to a friend that "Believers (read Xians) were inside wearing shoes and chapels where as others are without them."
Sunday, January 31, 2010
Wednesday, January 27, 2010
SLANG4.net is now a .net Compiler
Hi all ,
I have updated SLANG4.net site ( http://slangfordotnet.codeplex.com ) with a new release. Now the software is a compiler which generates .net IL code...here are some samples
Let us how our compiler has generated code for some script....
/////////////////////////////
// Mul.sl
//
//
//
PRINTLINE 2*(3+4);
Using the ILDASM utility , here is what we get from our compiler...
.method public static void Main() cil managed
{
.entrypoint
// Code size 35 (0x23)
.maxstack 3
IL_0000: ldc.r8 2.
IL_0009: ldc.r8 3.
IL_0012: ldc.r8 4.
IL_001b: add
IL_001c: mul
IL_001d: call void [mscorlib]System.Console::WriteLine(float64)
IL_0022: ret
} // end of method MainClass::Main
///////////////////////////////////
//
// A simple SLANG script
//
// Sample #1
//
NUMERIC a; // Declare a Numeric variable
a = 2*3+5* 30 + -(4*5+3); // Assign
PRINTLINE a; // Dump a
//----- String concatenation
PRINT "Hello " + "World";
//-------------- Write a new line
PRINTLINE "";
//-------------- string data type
STRING c;
c = "Hello "; // assignment to string
//---------------- assignment and concatenation
C = C + "World";
PRINTLINE c;
//-------------- boolean variable
BOOLEAN d;
d= TRUE;
PRINTLINE d;
d= FALSE;
PRINTLINE d;
The output is
.method public static void Main() cil managed
{
.entrypoint
// Code size 156 (0x9c)
.maxstack 4
.locals init (float64 V_0,
string V_1,
bool V_2)
IL_0000: ldc.r8 2.
IL_0009: ldc.r8 3.
IL_0012: mul
IL_0013: ldc.r8 5.
IL_001c: ldc.r8 30.
IL_0025: mul
IL_0026: ldc.r8 4.
IL_002f: ldc.r8 5.
IL_0038: mul
IL_0039: ldc.r8 3.
IL_0042: add
IL_0043: neg
IL_0044: add
IL_0045: add
IL_0046: stloc.0
IL_0047: ldloc.0
IL_0048: call void [mscorlib]System.Console::WriteLine(float64)
IL_004d: ldstr "Hello "
IL_0052: ldstr "World"
IL_0057: call string [mscorlib]System.String::Concat(string,
string)
IL_005c: call void [mscorlib]System.Console::Write(string)
IL_0061: ldstr ""
IL_0066: call void [mscorlib]System.Console::WriteLine(string)
IL_006b: ldstr "Hello "
IL_0070: stloc.1
IL_0071: ldloc.1
IL_0072: ldstr "World"
IL_0077: call string [mscorlib]System.String::Concat(string,
string)
IL_007c: stloc.1
IL_007d: ldloc.1
IL_007e: call void [mscorlib]System.Console::WriteLine(string)
IL_0083: ldc.i4 0x1
IL_0088: stloc.2
IL_0089: ldloc.2
IL_008a: call void [mscorlib]System.Console::WriteLine(bool)
IL_008f: ldc.i4 0x0
IL_0094: stloc.2
IL_0095: ldloc.2
IL_0096: call void [mscorlib]System.Console::WriteLine(bool)
IL_009b: ret
} // end of method MainClass::Main
I have updated SLANG4.net site ( http://slangfordotnet.codeplex.com ) with a new release. Now the software is a compiler which generates .net IL code...here are some samples
Let us how our compiler has generated code for some script....
/////////////////////////////
// Mul.sl
//
//
//
PRINTLINE 2*(3+4);
Using the ILDASM utility , here is what we get from our compiler...
.method public static void Main() cil managed
{
.entrypoint
// Code size 35 (0x23)
.maxstack 3
IL_0000: ldc.r8 2.
IL_0009: ldc.r8 3.
IL_0012: ldc.r8 4.
IL_001b: add
IL_001c: mul
IL_001d: call void [mscorlib]System.Console::WriteLine(float64)
IL_0022: ret
} // end of method MainClass::Main
///////////////////////////////////
//
// A simple SLANG script
//
// Sample #1
//
NUMERIC a; // Declare a Numeric variable
a = 2*3+5* 30 + -(4*5+3); // Assign
PRINTLINE a; // Dump a
//----- String concatenation
PRINT "Hello " + "World";
//-------------- Write a new line
PRINTLINE "";
//-------------- string data type
STRING c;
c = "Hello "; // assignment to string
//---------------- assignment and concatenation
C = C + "World";
PRINTLINE c;
//-------------- boolean variable
BOOLEAN d;
d= TRUE;
PRINTLINE d;
d= FALSE;
PRINTLINE d;
The output is
.method public static void Main() cil managed
{
.entrypoint
// Code size 156 (0x9c)
.maxstack 4
.locals init (float64 V_0,
string V_1,
bool V_2)
IL_0000: ldc.r8 2.
IL_0009: ldc.r8 3.
IL_0012: mul
IL_0013: ldc.r8 5.
IL_001c: ldc.r8 30.
IL_0025: mul
IL_0026: ldc.r8 4.
IL_002f: ldc.r8 5.
IL_0038: mul
IL_0039: ldc.r8 3.
IL_0042: add
IL_0043: neg
IL_0044: add
IL_0045: add
IL_0046: stloc.0
IL_0047: ldloc.0
IL_0048: call void [mscorlib]System.Console::WriteLine(float64)
IL_004d: ldstr "Hello "
IL_0052: ldstr "World"
IL_0057: call string [mscorlib]System.String::Concat(string,
string)
IL_005c: call void [mscorlib]System.Console::Write(string)
IL_0061: ldstr ""
IL_0066: call void [mscorlib]System.Console::WriteLine(string)
IL_006b: ldstr "Hello "
IL_0070: stloc.1
IL_0071: ldloc.1
IL_0072: ldstr "World"
IL_0077: call string [mscorlib]System.String::Concat(string,
string)
IL_007c: stloc.1
IL_007d: ldloc.1
IL_007e: call void [mscorlib]System.Console::WriteLine(string)
IL_0083: ldc.i4 0x1
IL_0088: stloc.2
IL_0089: ldloc.2
IL_008a: call void [mscorlib]System.Console::WriteLine(bool)
IL_008f: ldc.i4 0x0
IL_0094: stloc.2
IL_0095: ldloc.2
IL_0096: call void [mscorlib]System.Console::WriteLine(bool)
IL_009b: ret
} // end of method MainClass::Main
Labels:
Software(.NET)
| Reactions: |
Tuesday, January 19, 2010
SLANG4.net updated with additional documentation
Hi all ,
I have updated SLANG4.net site ( http://slangfordotnet.codeplex.com ) with three releases. In the first two releases , you can find detailed documentation about the internals of the compiler.
STAGE 1
----------
A class hierarchy (AST - Abstract Syntax Tree ) to model the composition of Expressions
STAGE 2
---------
Adds a Lexer , Parser to generate the AST straight from the infix expression.
STAGE 3
---------
Support for Print and PrintLine Statement ( documentation will be uploaded soon. )
I have updated SLANG4.net site ( http://slangfordotnet.codeplex.com ) with three releases. In the first two releases , you can find detailed documentation about the internals of the compiler.
STAGE 1
----------
A class hierarchy (AST - Abstract Syntax Tree ) to model the composition of Expressions
STAGE 2
---------
Adds a Lexer , Parser to generate the AST straight from the infix expression.
STAGE 3
---------
Support for Print and PrintLine Statement ( documentation will be uploaded soon. )
Labels:
Software(.NET)
| Reactions: |
Monday, January 18, 2010
SLANGFORDOTNET ( SLANGFOR.net ) on CodePlex
I am planning to teach how to write a compiler using C# and .net @ the Community Tech Day event to be held on 30th January 2010. This session was delivered @ BarCamp Kerala 5 event held at technopark. To make the source available for College students of Kerala , i have hosted
a project by the title SLANGFORDOTNET ( http://slangfordotnet.codeplex.com ). So far , i
have put the step 1 and the step2 of the project.
Pls. feel free to go and take a look at the project. By january 30,the whole project will be up on the codeplex.
a project by the title SLANGFORDOTNET ( http://slangfordotnet.codeplex.com ). So far , i
have put the step 1 and the step2 of the project.
Pls. feel free to go and take a look at the project. By january 30,the whole project will be up on the codeplex.
Labels:
Software(.NET)
| Reactions: |
Thursday, January 14, 2010
Taming the infinite
The book "Taming the infinite" by Ian stewart is a good one to get a conceptual understanding of the mathematics of analysis. In some 370 odd pages , the author chronicles the history of mathematics with ease by giving enough food for thought
The book goes beyond basic algebra and touches upon topics like Number Systems, Complex numbers , Calculus , Group theory , Non Euclidean Geometry to name a few.
The book goes beyond basic algebra and touches upon topics like Number Systems, Complex numbers , Calculus , Group theory , Non Euclidean Geometry to name a few.
Labels:
Books,
Mathematics
| Reactions: |
Tuesday, January 12, 2010
NizhalKuthu
Ytd, i saw a Katha-Kali performance at Sree Dharma Sastha Temple ,Aluva. i did not know about the story line when i started watching the performance. Based on the lyrics , i could understand the gist of the story. when i came back , i searched the wikipedia for Nizhalkuthu and stumbled upon the following Wikipedia page.
Noted Malayalam director , Adoor Gopalakrishnan has converted the gist of the story to a film starring Oduvil Unnikrishnan as Arachar (Executioner). Pls. read the following page as well to understand the historical significance of this story to the Katha-Kali performing art.
Noted Malayalam director , Adoor Gopalakrishnan has converted the gist of the story to a film starring Oduvil Unnikrishnan as Arachar (Executioner). Pls. read the following page as well to understand the historical significance of this story to the Katha-Kali performing art.
Labels:
Ways of Life
| Reactions: |
Community Tech Days @ Kochi
The next Microsoft Community Tech days will be held at the City of Kochi. The venue will be announced soon. I am taking a session by the title "Write Your Own .NET compiler" there. Pls.
ping http://k-mug.org/content/ctdJan10.aspx
Currently, the compiler which i wrote is using Reflection.Emit to generate the IL. Today , out of curiosity i enquired about DLR ( Dynamic Language Runtime ) to one of my co-presenter for the event. DLR and it's source code is a CodePlex hosted Open Source Project. After going through the DLR API , i decided to stick with Reflection.Emit for the presentation. I will be porting the compiler to use DLR as an experiment.
ping http://k-mug.org/content/ctdJan10.aspx
Currently, the compiler which i wrote is using Reflection.Emit to generate the IL. Today , out of curiosity i enquired about DLR ( Dynamic Language Runtime ) to one of my co-presenter for the event. DLR and it's source code is a CodePlex hosted Open Source Project. After going through the DLR API , i decided to stick with Reflection.Emit for the presentation. I will be porting the compiler to use DLR as an experiment.
Labels:
Software(.NET)
| Reactions: |
Sunday, January 10, 2010
Nostalgia of a 'Movie'
When i was around twelve years old , a Tamil movie was released starring Vijayakanth , Radha Ravi and Revathy. I think , it was Revathy's first movie. The name of the movie is 'Vaidehi Kaathirunthall'. My home town (Aluva ) had it's first A/C theatre in the year 1985. The twin theater ( Matha/Madhurya ) screened this as their first movie (in madhurya, i think ). After 25 years , i saw the movie once again and my thoughts longed for those days ( of course, in hindsight ).
Labels:
Movie
| Reactions: |
Monday, January 04, 2010
A good book to understand the Psyhic of a QUANT
Last Friday, i had gone to Trivandrum to visit some of my erstwhile colleagues. I paid a shot visit to the Modern Book Centre and purchased two books. The first one was "MY LIFE AS A QUANT" By Emanuel Derman.
So far , i have finished two chapters. I like the prologue of the book and amount of information crammed into first fifteen pages are mind boggling. The prose is very lucid as well. In the Prologue , he discusses the similarities and lack of it between the world of Physics and Financial Engineering. I liked the Analogy of a Fruit Salad and Black Scholes Option Evaluation Formula.
Derman says the Black Scholes is better suited for Fixed income securities (aka bond ) than equities. The contempt for each other between the Quants and Bond traders on the desk is described very well in a humorous manner
For a Programmer , it will give good insight into the demands of writing Financial Engineering Kernels like QuantLib. Derman's description of C Programming Language as poetically elegant will give joy to any C/C++ programmer.
For around Rs. 800 , you are getting a wonderful book to understand the parallels between Physics and Financial Engineering. Since , i have spent two years of my life with a financial services company , i am familiar with most of the lingo.
Highly Recommended..!
So far , i have finished two chapters. I like the prologue of the book and amount of information crammed into first fifteen pages are mind boggling. The prose is very lucid as well. In the Prologue , he discusses the similarities and lack of it between the world of Physics and Financial Engineering. I liked the Analogy of a Fruit Salad and Black Scholes Option Evaluation Formula.
Derman says the Black Scholes is better suited for Fixed income securities (aka bond ) than equities. The contempt for each other between the Quants and Bond traders on the desk is described very well in a humorous manner
For a Programmer , it will give good insight into the demands of writing Financial Engineering Kernels like QuantLib. Derman's description of C Programming Language as poetically elegant will give joy to any C/C++ programmer.
For around Rs. 800 , you are getting a wonderful book to understand the parallels between Physics and Financial Engineering. Since , i have spent two years of my life with a financial services company , i am familiar with most of the lingo.
Highly Recommended..!
Labels:
Books
| Reactions: |
Why $ Bill does not come to God's Own country ?
Prem is all praise for Free and Open Source movement (FOSS). Tilak , being a failed Unix programmer thinks Windows a better platform.
Prem => "FOSS's penetration into the kerala market is getting better day by day "
Tilak =>"Prem,Kerala is one of the biggest market for Microsoft Products"
Prem =>"Why Bill Gates has not ever visited Kerala , when he has even come to Kovai ?"
Tilak => "I have not yet understood why it is so , let us ask guruji "
Together they went to Guruji and told about their conversation....
Guruji Pondered for a while and told them that "IMHO,Since there are no decent five star hotels
around , he is not visiting kerala ..!!!"
Prem => "FOSS's penetration into the kerala market is getting better day by day "
Tilak =>"Prem,Kerala is one of the biggest market for Microsoft Products"
Prem =>"Why Bill Gates has not ever visited Kerala , when he has even come to Kovai ?"
Tilak => "I have not yet understood why it is so , let us ask guruji "
Together they went to Guruji and told about their conversation....
Guruji Pondered for a while and told them that "IMHO,Since there are no decent five star hotels
around , he is not visiting kerala ..!!!"
Labels:
Prem and Tilak
| Reactions: |
Subscribe to:
Posts (Atom)