lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On this day of 3-25-2006 11:07 PM, Asko Kauppi saw fit to scribe:
An old dream of mine, is to have programming (C/C++) sources being able to have fonts, italics, colour, and even embedded diagrams or pictures.
This started in -92 using Borland C/C++ (when syntax highlight was 
coming into editors), and I am still wondering, why no-one's "ever" 
done it. Now, with Lua it wouldn't really be asking for much, to 
modify the chunk loader to accept, say, RTF format.
It seems that in general, it wouldn't be too hard to extract the text 
from the rich-text. You'd have to separate annotations (e.g. diagrams, 
picture legends, etc.) from content (i.e. source code) but that doesn't 
sound too hard. In fact, I'm sure that there already exist programs that 
take e.g. RTF and print out the plain text, and then you wouldn't have 
to modify Lua at all.
Now, has anyone ever tried this, and would the coloring and embedding possibilities actually pay back in "real life"? In a more "perfect world" I could see function header comments actually be "fill me in" spreadsheet tables that can be added at places (embedded objects).
It would be fun, but would it be useful, too?
I don't know if coloring would pay back in real life, because syntax 
highlighting does a fairly good job of that. But several times I have 
wanted to say "this code here and that code there have this problem", 
where it would be nice to e.g. circle the code and put a line between 
them. But we've just gone far beyond simple RTF.
Still, it would be rather nice to have a structured way of entering 
function header comments. Java sort-of does it with Javadoc, but the 
formatting is all in text. If you had a more semantically aware input 
method, e.g. a table that was aware of all the code, it would be much 
easier to put hyper-links to the rest of the code. Still, you could 
conceive of such a feature without using RTF at all; you'd need an 
editor that understood the structure of the program, and Eclipse is 
already pretty darn good at that.
Now, what might be nice would be to change the size of the text. Maybe 
some function is not terribly important, and you might want to make it 
size 9 (or whatever your <small> would be) instead of the size 11 normal 
font. You don't want it to completely disappear, which is what folding 
it would do. But if you could make certain parts of code smaller, that 
might be useful for helping to filter trivial from complex code.
All this being said, I'm having trouble coming up with pressing 
examples. I find it much more important to have a semantics-aware 
editor, one that is aware of the types (both library and user), does 
intelligent auto-completion, makes it easy to navigate to a class 
method, etc.
Best,
- David

--
~David-Haley
http://david.the-haleys.org