Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Leo => #@-others

 [1/4] from: jason::cunliffe::verizon::net at: 20-Sep-2002 9:21


These past couple days I am exploring an incredible meta-programming called 'Leo'. Meta-programming because it lets you program how programs are built. It lets you have different views onto the same content and its easy to combine source code with any other kind of information, such as notes, docs, correspondence, ideas.. Its written in Python and is free, openSource like most Python packages. It's based on Donald Knuth's 'Literate Programming' ideas. Leo is aimed at improving the organization and control of complex software programming projects. It does this via a deceptively simple idea-outliner tree structure interface. Leo uses special embedded symbols to connect and assign the import and export of its contents. Meta-publishing via meta-tags. It also exposes the entire engine underneath to a Python API. You can pop open shell and hack away. Leo files are structure trees saved as XML. I have just been poking around Leo's XML files with Gavin's xml-object. [thanks!] and also writing rebol inside of Leo. Leo is fascinating and makes one think of all kinds of other uses too. I think many of you here would enjoy to experiment with it, if/when you find time. There's also intriguing potential for a rather different rebolutionary version, as well as using Leo with Rebol. Leo embeds special tags which ordinarily might get in the way, but rebol is forgiving as you know. Thus Leo's header tags a ignored because of Rebol's outermost wrapper block. yay! and then curiously the magical in-line inserts Leo uses to place content from elsewhere in its tree also proves harmless.. What am I talking about you ask//? Within the main Leo tree outline is a node for my rebol script: -overview @file leotest.r notes story ideas etc The contents of my rebol node looks like this: @file leotest2.r [ REBOL[] print ["hello from leotest.r"] @others ] The 'notes' node contains: notes: {What are the rule for where these have to be?} and the 'story' node contains: story: {This is a story about love and truth and beauty} @file means when I 'save' the whole structure, Leo writes to the file named leotest.r @others means include the contents of any nodes below here. Saving produces the final "leotest.r" script -------------------------------------------- #@+leo #@+node:0::@file leotest2.r #@+body #@@file leotest2.r [ REBOL[] print ["hello from leotest2.r"] #@+others #@+node:1:C=1:notes #@+body notes: {What are the rule for where these have to be?} #@-body #@-node:1:C=1:notes #@+node:2::story #@+body story: {This is a story about love and truth and beauty} #@-body #@-node:2::story #@-others ] #@-body #@-node:0::@file leotest2.r #@-leo This an extremely trivial example. But it demonstrates how one can organize content in a completely different way and then merge them very easily. Lo, when I open REBOL to run my script I get this:
>> do %leotest2.r
hello from leotest2.r == #@-others
>> notes
== "What are the rule for where these have to be?"
>> story
== "This is a story about love and truth and beauty" REBOL just ignores all Leo's meta-junk. Firstly because it's outside the main block, then because of this:
>> type? #@-others
== email! That's good news. Leo lets you import and export in clever ways. In many respects REBOL does not need such as tool because REBOL code is so much shorted and easier to understand.. or is it. I only know about very small utilities. I've not built anything big yet. Though I'd like too. I hope some of you do get a chance to pay with this. There is a very remarkable set of ideas here, some of which may find their own rebolistic uses. Especially if one combines implicit rebol messaging, and retunes the application towards collaborative business scenarios, workflow needs etc. HOME PAGE http://personalpages.tds.net/~edream/front.html RAVES http://personalpages.tds.net/~edream/testimonials.html#anchor104391 TUTORIAL http://www.evisa.com/e/sbooks/leo/sbframetoc_ie.htm USERS GUIDE http://personalpages.tds.net/~edream/leo_TOC.html#anchor964914 API http://personalpages.tds.net/~edream/scripting.html#anchor612831 ./Jason

 [2/4] from: g:santilli:tiscalinet:it at: 20-Sep-2002 19:18


Hi Jason, On Friday, September 20, 2002, 3:21:13 PM, you wrote: JC> It's based on Donald Knuth's 'Literate Programming' ideas. I think that if you place TeX text inside REBOL strings and use them for documentation, creating something like WEB in REBOL would result as being rather trivial. I'm still wondering if Literate Programming would be a useful technique to program in REBOL, or if REBOL is already going beyond that... Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [3/4] from: greggirwin:mindspring at: 20-Sep-2002 11:40


Hi Jason, Thanks for posting that. I looked at leo quite a while ago but it didn't grab me at the time. Maybe I should take another look. Literate Programming is one of those things I've looked at for a long time, and tinkered with a bit, but never found the magic combination of things to make it work for me. I can see the potential, especially in a REBOL context, I just haven't found it practical. Like TeX, I think Literate Programming has enormous value if it can be made accessible. Here are some other links for those who are interested: http://www.literateprogramming.com/ http://www.desy.de/user/projects/LitProg.html http://sourceforge.net/projects/lyterate/ http://www.ibiblio.org/pub/packages/TeX/web/schemeweb/ http://tex.loria.fr/litte/sweb.pdf http://xmlp.sourceforge.net/ http://www.conglomerate.org/docs/death_of_wysiwyg.html --Gregg

 [4/4] from: jason:cunliffe:verizon at: 20-Sep-2002 15:59


> I think that if you place TeX text inside REBOL strings and use > them for documentation, creating something like WEB in REBOL would > result as being rather trivial.
Yes I agree and my example was very poor. When your open large projects with Leo such as itself, it becomes clear where the value lies. Sorry, hard to explain. It's great to see all that Python code so accessible. At the other extreme I heard from a happy 35mm photographer using it to organise his notes about his non-digital phot collection.
> I'm still wondering if Literate Programming would be a useful > technique to program in REBOL, or if REBOL is already going beyond > that...
Me too. I am suspicious of methodologies. I love REBOL because it encourages one to think very freely. Wondering where rebol can take the good ideas of Leo. Although Leo was intended for managing complex software projects, I am intrigued by its more general approach to use a programmable tree interface combining data and meta-data, and then publishing it new ways. This is something I think REBOL could do very well, perhaps better. The way Rebol handles blocks and docstrings, I suspect it could produce much cleaner syntax than Leo does. I should clarify that Leo also lets one output files without any trace of its tags, performing full substitution. ./Jason