I'm a C# Elitest

Posted by Jake Good
on Oct 21, 04

After my quick combacks to the Java Kid in a .Net World... he posted another littlearticle which I think is actually the most valuable thing he's posted so far...

Does havingmultiple .Net languages propose a problem?

While I don't think that it necessarily a problem, per se... it is defintely alimitation in the current implementation. It's an awesome step forward to have sharedlibraries and a common platform to which many languages can utilize... but he makes anawesome suggestion that could possibly spell out the future of language development.

What about an  intermediate intermediate language?... C# or VB or < insert.net language here> -> parses to IIL -> parses to IL -> sent to the JITcompiler

One thing I learned from my Programming Languages and Paradigms class back in mycollege days, was that language contructs are mainly syntactic sugar and that, there is afinite, static set of rules to define a turing-complete (GOREAD IT! LEARN!) language.

Excuse me for the horrible example I am about to give... but during that class wewrote a simple language parser in Scheme. One of the things we wanted to do was allow thedeveloper to write a FOR LOOP looping construct. Our task was to take this generalizedconstruct and break it down into a simple loop statement and an exit condition.

FOR X = 0, X < 10, 1 (from 0 to 9, incrementing by 1)
    PRINT X;
END FOR

converted to a standard looping construct becomes:

X = 0;
LOOP
    PRINT X;
    X = X + 1;
    EXIT WHEN X > 10;
END LOOP;

Typically.. in a FOR LOOP statement, you reverse the conditional and then determinethe exit condition. In our case, in reality, a for loops exit condition is
checked first, then the statements are executed. In our standard looping construct, weset the variable to allow it to be run once, then execute the code, increment, and thencheck the exit condition. Since we reversed the conditional, and the conditional is notof equality as well (<=), then we must let the code run through once and THEN checkthe exit condition.

Try it on your own , if you're ever interested in the core functionality of areal language... take some of the syntax and break it down into more simplistic syntax.It works... Thus, it would feasible to have such an intermediate intermediatelanguage...

The purpose of this exercise? Language doesn't matter...

Val the C# Gal - yet another coworkers blog...
http://valcsgal.blogspot.com/2004/10/vbnet-vs-c.html

And of course.. Java Kid in a .Net World also has something to say about this...
http://javakid.blogspot.com/2004/10/languages-dont-matter-it-is-how-you.html


Comments

Leave a response

Comment