Sunday, December 19, 2010

Making Software Literate: Teaching Code to Read Itself

My previous post introduces the concept of Grammar, Template, and the Metamodel.

Creating metamodel is easy for humans, there is Ecore editor and Ecore Tools for that.

Generating artifacts from a model is also relatively easier... When compared to "reading" artifacts and generating a model.

In the machine world, almost everything is harder to read than to write.

For example, it is easy for a generator to output this:

lastName = "Irawan"
name = "Hendy " + lastName

However, it's not easy to "read" the above artifact. By that I mean that the parser software should "understand" that 'name' contains "Hendy Irawan".

And it brings us to... Interpreter.

Interpreter is an enhanced parser that knows what to do with a model. Advanced interpreters may have behaviors, but the most commonly used functionality is Evaluating Expressions.

An Evaluator transforms expressions in the metamodel to actual values (which are still expressions, called value expression, but do not need further processing). After the example artifact above are parsed AND interpreted/evaluated, the 'name' object will rightly contain 'Hendy Irawan'.

2 comments:

  1. Really i acknowledge the accomplishment you fabricated to allotment the knowledge.The affair actuality i begin was absolutely able to the affair which i was researching for a continued time

    ReplyDelete
  2. For signal to read itself, Buy Cheap RS Goldit needs to be in a position to generate a model from themselves. Therefore, you need the metamodel of the programming lanaguage the software will be coded in, and the grammar of this terminology. By making use of the two elements and the appropriateCheap MapleStory Mesos tools, you can generate a model through the software.

    ReplyDelete