Augmented Source Code
Author: Samuel Williams When: Friday, 06 August 2010April 2009
May 2009
August 2009
September 2009
October 2009
- Building a Concrete Bath
- LED Lighting Comparison
- Thinking about Programming Languages
- How To Be A Consultant
- Lucid Programming Dojo
- Exim4 + ClamAV + SpamAssassin
- Secure login using AJAX
- Ramaze And Rack
- ActiveMerchant
- Concurrency And Immutability
- Floating Point Numbers
- Programming And Debugging
- Useful jQuery Plugins
- Loading Anonymous Ruby Classes
- 尺八 (Shakuhachi)
- Card Trick
- Object Oriented C
- Gemcutter
- Writing Clearly
- Richard Stallman In Christchurch
- Magnatune
- Client Side Graphing
- Zena CMS
November 2009
February 2010
March 2010
April 2010
May 2010
June 2010
July 2010
August 2010
September 2010
December 2010
January 2011
March 2011
May 2011
August 2011
September 2011
Source code can be augmented in many ways to provide useful feedback for a programmer. It would be great to see existing source code editors augmented to provide these features.
- Code Reviewing
- Highlight lines not covered by unit tests.
- Highlight code which has been changed since the last review.
- Hyperlink function names to source code bodies.
- Inline documentation (including images/eps and other kinds of markup).
- Bug Fixing
- Highlight code based on its age.
- Highlight and link code based on program flow/coverage.
- Augment variable names with values (i.e. in a bubble).
- Optimisation
- Highlight code based on execution time.
- Augment function definitions with execution details (such as execution time, memory contention issues, threading issues).
Some of these features could be integrated by using the history of the source code exposed by a source code management system, other features would require a well defined compiler framework.
One option would be to expose a common format for marking up source code. This could be a separate file which annotates sequences of characters with meta-data which could then be used by the editor for highlighting source code. Various tools could produce this standard output and this could be used by the editor to augment the source code text.
Syntax Augmentation Format
This file format is very simple and is designed so that it can be generated and parsed very easily. It is designed to annotate specific parts of a text file with information such as
<?xml version="1.0" encoding="UTF-8" ?>
<annotations file="{source-code-file}">
<marker id="{unique-id}" start="{character-offset}" end="{character-offset}">
<tag name="function" />
<metric name="time" value="32" />
</marker>
<marker start="{character-offset}" end="{character-offset}">
<!-- Link a function call with its body -->
<link href="{unique-id}" />
</marker>
</annotations>
I hope to add this functionality to jQuery.Syntax as a concept demonstration.
Comments
Please note, you can leave a comment that uses (limited) XHTML and Textile syntax.