AjGenesis Code Generation in .NET, Javascript and Ruby, All the Gates are Open

Usually, I get up early in the morning. Today, I got up a bit earlier, with some ideas about how to implement a simple template engine for my personal project, AjGenesis in Ruby. Then, I put my hands at work, and 3 hours later I had a solution, built using TDD (I made frequent commits, so you can see the progress of development in the GitHub Log).

The result at my GitHub account:


Initially, I planned to use one of the template engines already available in Ruby, like Haml. But I decided to write my own implementation. Past week, I wrote AjGenesis in Javascript/NodeJs, see:


In that project, I separated the template engine in another package:


In this way, I designed the template format to be similar to the original templates in classic AjGenesis.

I reuse the Javascript template engine in another new project (code kata of the past weekend):


a simple MVC implementation over NodeJs/Express.

So, now you have three projects:

Classical AjGenesis code generation, implemented in .NET (see examples folder)
AjGenesis in Javascript/Node, with SimpleTpl template engine, with interpolated Javascript expressions, and embedded Javascript commands (see samples folder)
AjGenesis in Ruby, with a similar internal template engine, with interpolated Ruby expressions, and embedded Ruby commands (see samples folder)

AjGenesis in Javascript was published to npm (node package manager) as beta.

AjGenesis in Ruby is still not a gem: work in progress.

REMEMBER: all these projects GENERATES the text artifacts YOU WANT to generate. There are not limited to a technology, platform or programming languages.

It’s really interesting to see how simple ideas can be reimplemented in dynamic languages. Next steps: more samples, ruby gem, node package, and web site implementing code generation as a service (ASP.NET implementation commented in my old post). (see AjGenesis: Basis of Its Implementation).

Pending implementation languages: Python, maybe Java.

(Original photo from: http://commons.wikimedia.org/wiki/File:Table_Rock_Dam_during_April_2008_White_River_Flood.jpg)

Keep tuned!

Angel “Java” Lopez

One thought on “AjGenesis Code Generation in .NET, Javascript and Ruby, All the Gates are Open

  1. Pingback: AjGenesis Code Generation: News and Ideas | Angel "Java" Lopez on Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s