cdiggins.com

June 21, 2007

Comment Meta-Data in Cat using JSON

Filed under: Everything — cdiggins @ 4:09 pm

I am interested in having sophisticated meta-data embedded in the comments of Cat source file. In fact I want my meta-data in comments to contain actual code (like contract specifications, unit tests, and example usage) it really seems like JSON is the best choice.

Informative comments and useful meta-data are especially important for sharing and reusing Cat source code, because the language is so succint and minimalist.  Apart from the usual comment information, comments are a good place to store unit-tests and contract specifications — as in Design by Contract (DbC) — in a language which doesn’t have direct language support for such things. Some programming languages shack the specification to provide support for DbC and unit-tests (the D language for example).  I think hard coding support for processes and techniques in a language, rather than using a separate specification for comment meta-data, is inflexible. C# attributes are a step in the right direction. They are however not powerful nor “literate” enough for my purposes.

Seperating unit-tests and contract specifications from actual code and placing them as meta-data allows your tools to do very strange and wonderful things. Imagine automated testing as you code: a red squiggle in your IDE to highlight test breaking usage. Imagine your IDE telling you how often a unit test passed, and what kind of coverage a segment of code is getting. Imagine your tool telling you when you are violating a contract as you type code. There are tools which do this, but implementing them suddenly becomes much easier and standardized with a good meta-comment specification, along with things I haven’t even dreamed of yet! Imagine, people sharing meta-comment parsing libraries, and if I use JSON there are several dozen libraries already available. I want to see tool developers cooperate and share their work. No more monolithic “Eclipse” projects needed to code some basic automated code testing and analysis.

If anyone else is really excited about this stuff, please contact me, I could really use some help. This kind of project is very doable, but I am already overburdened working on the Cat interpreter and a Scheme to Cat translator.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress