<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7996140147468268406</id><updated>2011-07-08T05:45:26.559-07:00</updated><category term='howitworks'/><title type='text'>Carrot</title><subtitle type='html'>Crunchy-sweet document authoring!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>49</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-8784434820291695926</id><published>2009-10-01T22:35:00.000-07:00</published><updated>2009-10-05T17:52:28.413-07:00</updated><title type='text'>Parser design</title><content type='html'>The Lexer used a sort of trie-lite to do its work. The parser will be driven by a full-blown trie. Here's a graphviz diagram of it:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://firepear.net/carrot/images/parser_trie.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="163" src="http://firepear.net/carrot/images/parser_trie.png" width="420" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;As you can see, the tag markup structure, which looks like&lt;br /&gt;&lt;blockquote&gt;[thing]&lt;br /&gt;&lt;/blockquote&gt;is the most overloaded, but that's Huffman coding for you :)&lt;br /&gt;&lt;br /&gt;Anyhow, the key to understanding this diagram is knowing that everywhere you see "printable", "whitespace", or "hex", that means "any number of these characters, consecutively". The only exception is "printable-1", which is read "one printable character".&lt;br /&gt;&lt;br /&gt;That and the unicode entity stuff look like they create some really hairy exceptions, but the truth is that due to the way the reference implementation (spefically, the Lexer) operates, it'll all come in as one wad. A simple regex, combined with the lookahead token, will tell if it's a entity or not. It's shown exploded here, but those subtrees may be optimized completely out of the live trie.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-8784434820291695926?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/8784434820291695926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=8784434820291695926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8784434820291695926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8784434820291695926'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2009/10/parser-design.html' title='Parser design'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-8157887147326091026</id><published>2009-09-13T17:16:00.000-07:00</published><updated>2009-09-13T17:24:26.142-07:00</updated><title type='text'>Message passing</title><content type='html'>I'm working on a primitive message-passing mechanism to allow objects to request that other objects execute methods on demand. Sort of a remote procedure call, you might say. The basics are as follows:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Every object which inherits from &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Carrot::Universal&lt;/span&gt; has a '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;children&lt;/span&gt;' slot and a '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;rpc_ok&lt;/span&gt;' slot. The first stores a reference to every object that the present object "owns", or has created. The second is a list of methods in the present object which are allowed to be called by this mechanism.&lt;/li&gt;&lt;li&gt;There's a '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;pass&lt;/span&gt;' method, which creates a standard &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Carrot::Msg&lt;/span&gt; object and uses it as an argument to the '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;catch&lt;/span&gt;' method of each object in the present object's '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;children&lt;/span&gt;' slot.&lt;/li&gt;&lt;li&gt;The message created by '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;pass&lt;/span&gt;' has a hashref instead of a string as its content. This hashref contains&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The caller object's classname&lt;/li&gt;&lt;li&gt;The intended recipient class's name (will be matched as an ending regex, not a strict string equivalence, so '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Lexer&lt;/span&gt;' will work as well as &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Carrot::Lexer&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;The method to be called&lt;/li&gt;&lt;li&gt;Arguments to the method&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;If the recipient classname matches the name of the called object, and if the given method is on the recipient's '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;rpc_ok&lt;/span&gt;' list, then thy will be done.&lt;/li&gt;&lt;li&gt;Matching or not, the recipient object will pass the message on to all of its children.&lt;/li&gt;&lt;/ol&gt;Why? This is the mechanism that lets (definitely some, possible all of) the pragmas work. In the new design, the level at which pragmas are recognized (the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Parser&lt;/span&gt;) is, for instance, 2 levels removed from where markup characters are tokenized as such (the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Tokenizer&lt;/span&gt;). The possible solutions were&lt;br /&gt;&lt;ol&gt;&lt;li&gt;to implement a custom pass-along method for EVERY method that ends up being at greater than one remove from where it ends up being needed&lt;/li&gt;&lt;li&gt;to pass handles to objects to all other objects (AKA "the last design, to an extent")&lt;/li&gt;&lt;li&gt;to implement a generic message passing mechanism&lt;/li&gt;&lt;/ol&gt;The last one seems cleanest, most maintainable, and most useful in the long-term to me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-8157887147326091026?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/8157887147326091026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=8157887147326091026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8157887147326091026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8157887147326091026'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2009/09/message-passing.html' title='Message passing'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-2186760580612538043</id><published>2009-09-09T22:12:00.000-07:00</published><updated>2009-09-09T22:12:23.155-07:00</updated><title type='text'>The Way Forward</title><content type='html'>I don't mean how to complete Carrot. Though that is distressingly far from a &lt;i&gt;fait accompli&lt;/i&gt;, I have somehow managed to convince myself that I'm capable of cracking all the remaining problems -- if by no other mechanism, then my letting it be ugly where it must in order to be &lt;i&gt;done&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;What I've been thinking of lately is the larger problem; the one that comes after Carrot; the one which Carrot is a gateway to solving. The archival and publishing problem. I've been thinking on it for years, and today I got a flash of insight which threatens to make the whole thing far, far simpler.&lt;br /&gt;&lt;br /&gt;Every chunk gets a UUID.&lt;br /&gt;&lt;br /&gt;This provides a system/implementation independent way to point at any piece of content in any document. It does explicitly make the chunk the smallest addressible portion, but it was already that way implicitly.&lt;br /&gt;&lt;br /&gt;Another possibility: each chunk gets a SHA1 hash as well, enabling version-to-version delta compression at the chunk level. This way, you don't have to care where chunks might get moved to in a doc restructuring; so long as the hash is the same, the content is the same, and it can be mapped to transparently.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-2186760580612538043?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/2186760580612538043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=2186760580612538043' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2186760580612538043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2186760580612538043'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2009/09/way-forward.html' title='The Way Forward'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-1575595878308980575</id><published>2008-12-22T04:09:00.000-08:00</published><updated>2008-12-22T04:41:15.391-08:00</updated><title type='text'>Parallel Development</title><content type='html'>Now that I'm using git, I have powerful new options available for working on projects, like spawning as many single-feature development branches as I feel like. Today I spun one off and started overhauling the Carrot status system.&lt;br /&gt;&lt;br /&gt;The first problem was that there were a &lt;i&gt;lot&lt;/i&gt; of statuses, and while referring to them by numeric id sounds cool (it works for Apache), it's a little less than ideal when you're reusing ids between modules. I wrote the damn thing, and I was constantly having to refer to a wiki page to tell me what statuses meant. This has been (partly) fixed by moving the lists of statuses into the modules themselves, in a __DATA__ segment which populates a hashref at constructor time.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The other part of the fix is that statuses are no longer set by passing the '&lt;span style="font-family:'Courier New', Courier, monospace;"&gt;status&lt;/span&gt;' method a number and having that be that. This had all the problems from the above paragraph, plus a complete lack of validity checking. Now statuses are set by passing the short "name" value which acts as a key on the statuses hashref. This makes status changes much more clear (&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;status('EBADPERMS')&lt;/span&gt; vs. &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;status(103)&lt;/span&gt;), and now passing an undefined name to &lt;span style="font-family:'Courier New', Courier, monospace;"&gt;status&lt;/span&gt; causes an abend.&lt;br /&gt;&lt;br /&gt;A side-effect of this is that the code is now self-documenting with respect to its statuses, and the list of statuses can't get out-of-sync without the code exploding.&lt;br /&gt;&lt;br /&gt;Lastly, the notion of a status being set has been divorced from the notion of something having gone wrong. Several of the Carrot modules now have non-error statuses beyond '0' for "still running" and '1' for "all done" (and, as a side note, '1' is no longer consistent for that -- this needs cleanup and '99' should be the new standard for "ops complete"). Since error statuses start at code 100, the &lt;span style="font-family:'Courier New', Courier, monospace;"&gt;status&lt;/span&gt; method now sets an error flag when a code above 99 is set. Soon, all modules will be updated to halt and return undef on &lt;span style="font-family:'Courier New', Courier, monospace;"&gt;error&lt;/span&gt; instead of on &lt;span style="font-family:'Courier New', Courier, monospace;"&gt;status&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;EDIT: ONE YEAR ANNIVERSARY OF CARROT BLOG AND THE RESTART OF SERIOUS DEVELOPMENT&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(...so far yet to go...)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-1575595878308980575?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/1575595878308980575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=1575595878308980575' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/1575595878308980575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/1575595878308980575'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/12/parallel-development.html' title='Parallel Development'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-7383577994626957672</id><published>2008-12-14T23:38:00.000-08:00</published><updated>2008-12-14T23:41:21.425-08:00</updated><title type='text'>DOM Update 1</title><content type='html'>'nukenode' is no more. This is good. If a call to 'add' fails, that's really a fatal error -- there is no reason to cruft up the module with code which sloppily backs out the partial changes. I'm still hoping to factor away the partial changes bit and get back to having adds be atomic with respect to the datastore.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-7383577994626957672?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/7383577994626957672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=7383577994626957672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/7383577994626957672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/7383577994626957672'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/12/dom-update-1.html' title='DOM Update 1'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-4820980797316230580</id><published>2008-12-13T02:17:00.000-08:00</published><updated>2008-12-13T02:21:56.349-08:00</updated><title type='text'>Movement</title><content type='html'>First off, I'm now using git for local revision control.&lt;br /&gt;&lt;br /&gt;Secondly, I've spent some time recently thinking about what the DOM should do -- oppose thinking about what's wrong with it right now -- and how to most efficiently make those things happen. I believe the result will be much slimmer code which is much more capable.&lt;br /&gt;&lt;br /&gt;The DOM as it exists now has 2 fundamental problems. First, as noted previously, it was written over two years in advance of the Grammarian, so it's filled with bad guesses about how things would eventually work out. Second, I wrote it while having a fit of needing to prove to myself that I could write something like this, so it's full of questionable and/or mildly baroque design choices.&lt;br /&gt;&lt;br /&gt;It'll be better soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-4820980797316230580?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/4820980797316230580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=4820980797316230580' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4820980797316230580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4820980797316230580'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/12/movement.html' title='Movement'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-8018627366781062999</id><published>2008-11-02T07:26:00.000-08:00</published><updated>2008-11-02T07:29:09.623-08:00</updated><title type='text'>Speaking of refactoring</title><content type='html'>The stuff in the last post is all AFTER fixing the hash/hashref argument problem.&lt;br /&gt;&lt;br /&gt;Also, Handler/Commenter.pm is no more. Its code and a genericized status() have been folded into Util.pm.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-8018627366781062999?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/8018627366781062999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=8018627366781062999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8018627366781062999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8018627366781062999'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/11/speaking-of-refactoring.html' title='Speaking of refactoring'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-5156614098979833875</id><published>2008-11-02T07:09:00.000-08:00</published><updated>2008-11-02T07:26:25.782-08:00</updated><title type='text'>DOM problems in bringing Grammarian online</title><content type='html'>As I'm 99% sure I've mentioned before, the DOM was the 2nd component of the Grammarian stack to be written. It got a syntax-wise overhaul approximately a year ago(!), but its capabilities were laid down in spring/summer of 2005.&lt;br /&gt;&lt;br /&gt;Turns out I wrote in all kinds of crap that Carrot will never use. Perhaps I was thinking "this will be an awesome, general-purpose structured document framework which everyone will want to use", but that was a stupid thing to think. More likely I think I was simply doing everything I could figure out how to do, to make myself feel better about the enormity of the task. And I've ended up with all sorts of crufty special cases and exceptions which are now interfering with the proper operation of the system as it has ended up being in reality.&lt;br /&gt;&lt;br /&gt;Interestingly, the test suite has been an accomplice of the problem in this issue, because a lot of the tests were written just to exercise those edge cases rather than to simulate actual system usage. I can forgive myself for this (this time) because I didn't know exactly what the system would end up doing, but there's still a really good lesson in here.&lt;br /&gt;&lt;br /&gt;Also, the DOM TODO has exploded to fill a 4x6" index card. Looks like a severe refactoring is in order.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-5156614098979833875?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/5156614098979833875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=5156614098979833875' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5156614098979833875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5156614098979833875'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/11/dom-problems-in-bringing-grammarian.html' title='DOM problems in bringing Grammarian online'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-8061041462806378677</id><published>2008-10-19T11:56:00.000-07:00</published><updated>2008-10-19T13:16:51.807-07:00</updated><title type='text'>I knew this was going to happen</title><content type='html'>Really, I did. I've been waiting on it since February, when I started work on the Handlers. At that point it had been about 2 years since the &lt;i&gt;design&lt;/i&gt; of the DOM was laid down, though I had only just completed a code-wise and testing overhaul of it.&lt;br /&gt;&lt;br /&gt;Long story short, the DOM was built at a time when I had no idea if my ideas for Carrot would ever work out, much less exactly how they would work out, and the Handlers were created with a far better understanding of how things should hook together. As a result, the DOM wants to have things added to it like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$dom-&gt;add( type    =&gt; $node_type,&lt;br /&gt;           finfo   =&gt; \@fileinfo,&lt;br /&gt;           element =&gt; $element_name,&lt;br /&gt;           id      =&gt; $user_identifier,&lt;br /&gt;           parent  =&gt; $pid,&lt;br /&gt;           attrs   =&gt; \@attributes,&lt;br /&gt;           content =&gt; $content );&lt;br /&gt;&lt;/pre&gt;while the Grammarian (being fed by the Handlers) wants to add things to the DOM like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$dom-&amp;gt;add($node);&lt;/pre&gt;&lt;br /&gt;I'm not entirely braindead; '$node' contains everything that '$dom-&amp;gt;add' wants, but it's packaged as a single hashref instead of a unravelled hash. This is far from calamitous, but it is irritating because simply passing '$node' is the right thing to do. This means that the DOM's test suite needs some rewriting.&lt;br /&gt;&lt;br /&gt;And I'm still thinking of splitting the DOM in two.&lt;br /&gt;&lt;br /&gt;And the DOM's POD needs a lot of rewriting.&lt;br /&gt;&lt;br /&gt;And I should probably produce a dedicated POD which describes all the datastructures in the system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-8061041462806378677?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/8061041462806378677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=8061041462806378677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8061041462806378677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8061041462806378677'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/10/i-knew-this-was-going-to-happen.html' title='I knew this was going to happen'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-619409071491232555</id><published>2008-09-26T23:13:00.000-07:00</published><updated>2008-09-26T23:38:17.360-07:00</updated><title type='text'>Grammarian First Light</title><content type='html'>At 02:14, 27 September 2008, Grammarian.pm successfully parsed the document pragma trigger of this document:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;;;; hello, world&lt;br /&gt;;;;&lt;br /&gt;;;; simplest correct document&lt;br /&gt;&lt;br /&gt;[[document title;'hello.carrot']]&lt;br /&gt;&lt;br /&gt;hello, world! ;;; document plaintext&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;With this, 3 years of effort comes to fruition, and Carrot takes a giant step towards being real. Here's what happened:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A Grammarian object is instantiated&lt;/li&gt;&lt;li&gt;A Lexer object is instantiated within the Grammarian&lt;/li&gt;&lt;li&gt;The Grammarian, controlling the Lexer, reads through the document until something that isn't a comment or whitespace comes along&lt;/li&gt;&lt;li&gt;A Document pragma handler is instantiated&lt;/li&gt;&lt;li&gt;The Document handler is asked if it handles the token the Grammarian is looking at&lt;/li&gt;&lt;li&gt;If not, the document is nonconformant, a status is set, and processing terminates here&lt;/li&gt;&lt;li&gt;Else, the Document handler is passed control of the Lexer&lt;/li&gt;&lt;li&gt;If all goes well, the Document handler parses the contents of the document trigger into a datastructure, which is returned to the Grammarian&lt;/li&gt;&lt;li&gt;The Grammarian then instantiates a DOM object, giving it the results of the Document handlers's work as the root node of the new document&lt;/li&gt;&lt;li&gt;I do a little dance because it works It Works IT WORKS!!&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Tomorrow I'll be writing (lots) more tests, and I hope to have a demo online by Wednesday, 1 October.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-619409071491232555?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/619409071491232555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=619409071491232555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/619409071491232555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/619409071491232555'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/09/grammarian-first-light.html' title='Grammarian First Light'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-1532656651861328218</id><published>2008-09-16T16:09:00.000-07:00</published><updated>2008-09-16T16:18:21.147-07:00</updated><title type='text'>Grammarian Begin!</title><content type='html'>There's real code in there now. Not much (just enough to generate comically bad coverage numbers), but it's a start. With the Handler tests' minigrammarian routine already proving the basic idea, lashing that together in a production sort of way should be pretty easy.&lt;br /&gt;&lt;br /&gt;The worry for me is hooking it up to the DOM, which I haven't touched in quite a while now. My irrational mind fears there has been some drift in document node format between last-working-on-DOM and writing-flock-of-Handlers. My logical mind thinks "not so much", but even if it's wrong, that's a fairly minor issue.&lt;br /&gt;&lt;br /&gt;A much larger change would be the thought I had the other night; that the DOM should be split into a storage access layer and the actual DOM accessor/traversal methods. This feels right, but it could well be premature optimization.&lt;br /&gt;&lt;br /&gt;It'd be a good way to get the tests for it rewritten, tho :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-1532656651861328218?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/1532656651861328218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=1532656651861328218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/1532656651861328218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/1532656651861328218'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/09/grammarian-begin.html' title='Grammarian Begin!'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-2732108809589397998</id><published>2008-09-14T22:40:00.000-07:00</published><updated>2008-09-14T23:02:41.217-07:00</updated><title type='text'>300</title><content type='html'>Changeset 300 was just committed to the Carrot repo. It was a minor change to Handler.pm with decently large consequences. Following on from the last post, I was worried about another untested case: immediately nested tags, like this...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[foo [bar a;b blah blah]]&lt;/pre&gt;&lt;br /&gt;i was worried this might turn up an edge case in &lt;code&gt;valid_ending_pos&lt;/code&gt; -- and it did, but not in the manner I had anticipated. I thought the immediate nesting, with no intervening attributes or content, might break something. That part worked just fine, but the cuddled terminators weren't behaving properly at all.&lt;br /&gt;&lt;br /&gt;What should happen is&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The Text handler sees ']]', quits processing, and returns&lt;/li&gt;&lt;li&gt;The Tag handler is called, sees ']]', which begins with its markup terminator, and claims responsibility&lt;/li&gt;&lt;li&gt;Tag consumes its terminating markup (']'), and pushes the remainder (also ']') back on to the Lexer's next-token stack&lt;/li&gt;&lt;li&gt;Tag is called again and the final ] is consumed&lt;/li&gt;&lt;/ol&gt;Instead, the first call to Tag was seeing ']]' and seemingly consuming both brackets. But only seemingly; what actually happened requires a little more granularity&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Text sees ']]', pushes it onto the Lexer's next-token stack, quits processing, and returns&lt;/li&gt;&lt;li&gt;Lexer, knowing that it is at physical EOF, sets its status to 1 (EOF, but I have synthetic tokens in stack)&lt;/li&gt;&lt;li&gt;Tag is called, consuming a token from the stack, which happens to be the only token in the stack.&lt;/li&gt;&lt;li&gt;Lexer gives Tag the token and sets its status to 99 (EOF, no synthetic tokens)&lt;/li&gt;&lt;li&gt;Tag calls &lt;code&gt;valid_ending_pos&lt;/code&gt; which has the statement &lt;code&gt;'return 1 if $l-&amp;gt;status == 99'&lt;/code&gt; right up top. This is meant to let Triggers and Verbatim contexts always have a valid ending at EOF.&lt;/li&gt;&lt;li&gt;Lexer's status is 99&lt;/li&gt;&lt;li&gt;Tag does not execute the code at the bottom of &lt;code&gt;valid_ending_pos&lt;/code&gt;, which performs the separation of terminating markup from the current token and the subsequent injection of the remainder onto Lexer's next-token stack (which would have reset its status to 1), allowing for cuddled terminators (and sloppiness like &lt;code&gt;'foo]bar'&lt;/code&gt;).&lt;/li&gt;&lt;li&gt;The current token, containing the terminators for both open tags, is thrown away&lt;/li&gt;&lt;li&gt;The test suite calls Tag again to process the second terminator.&lt;/li&gt;&lt;li&gt;Lexer returns undef; tests fail&lt;/li&gt;&lt;/ol&gt;Any sufficiently complex system will always be able to bite you in the ass. Testing is your only defense. So write more tests, today! Buy war bonds! Victory!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-2732108809589397998?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/2732108809589397998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=2732108809589397998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2732108809589397998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2732108809589397998'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/09/300.html' title='300'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-8591761335742802110</id><published>2008-09-14T21:10:00.000-07:00</published><updated>2008-09-14T21:34:40.749-07:00</updated><title type='text'>Stopper?</title><content type='html'>Some months in the past, back in April-June when I was dealing with the foo]] problem, I made a note to myself:&lt;br /&gt;&lt;blockquote&gt;Handler valid_ending_pos woefully inadequate for Tags&lt;/blockquote&gt;But by the time I got around to reading my note, I couldn't fathom what the problem was. Clearly past-me had seen something, but present-me didn't see anything.&lt;br /&gt;&lt;br /&gt;Today-me found it. On the Grammarian status code list, there is only one code specific to Tags.&amp;nbsp; In section 3000:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;400 Trigger or verbatim found in tag content&lt;/pre&gt;&lt;br /&gt;There is no testing for status 400 anywhere in the current suite. There is also no code which sets a status 400. Consider the following.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Lorem ipsum [foo bar;baz [[quux dolor sit amet, consectetuer&lt;br /&gt;adipiscing]] elit.] Sed massa mi, dapibus.&lt;/pre&gt;&lt;br /&gt;This is doubly-illegal. It's forbidden by the grammar rule embodied in status 3400 as well as the rule which says that the opening markup of triggers must be the first thing on a line. Well, the trigger-specific infringement will be caught (status 3200, as it happens), but the 3400 violation isn't caught by any code at all. And what about...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Lorem ipsum [foo bar;baz&lt;br /&gt;[[quux dolor sit amet, consectetuer&lt;br /&gt;adipiscing]]&lt;br /&gt;elit.] Sed massa mi, dapibus.&lt;/pre&gt;&lt;br /&gt;There. Now the 3200 violation goes away (this code is well-formed) AND the 3400 violation isn't caught. Problem! Isn't it?&lt;br /&gt;&lt;br /&gt;That depends on whose job it is to know what's inside of what. This specific example could be caught by Tag handling code, but moving the word &lt;i&gt;dolor&lt;/i&gt; outside the trigger...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Lorem ipsum [foo bar;baz dolor&lt;br /&gt;[[quux sit amet, consectetuer&lt;br /&gt;adipiscing]]&lt;br /&gt;elit.] Sed massa mi, dapibus.&lt;/pre&gt;&lt;br /&gt;changes all that, because now the trigger is seen by the Text handler, not the Tag handler.&lt;br /&gt;&lt;br /&gt;Now we see that, at its root, this problem is the same as the problem which led to the creation of the VerbatimText handler: a handler must be able to introspect the layers "above" it to make the correct decision in one specific case. And now, like then, I feel the proper thing to do is to stick with the design as it stands.&lt;br /&gt;&lt;br /&gt;This means that the proper place for code to detect this grammar violation and throw the associated status code is the Grammarian itself. The Grammarian must be responsible for all such issues where knowledge of the node context stack is needed to make the right decision (just as it is in the case of VerbatimText, which the Grammarian will explicitly call instead of the regular Text handler when a Verbatim context is atop the stack).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-8591761335742802110?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/8591761335742802110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=8591761335742802110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8591761335742802110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8591761335742802110'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/09/stopper.html' title='Stopper?'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-4643708024910106190</id><published>2008-09-13T12:42:00.000-07:00</published><updated>2008-09-16T16:55:28.623-07:00</updated><title type='text'>Grammarian stub-out</title><content type='html'>I just typed this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;use Firepear::Carrot::DOM;&lt;br /&gt;use Firepear::Carrot::Lexer;&lt;br /&gt;use Firepear::Carrot::Pragma::Document;&lt;br /&gt;use Firepear::Carrot::Pragma::Include;&lt;br /&gt;use Firepear::Carrot::Handler::Comment;&lt;br /&gt;use Firepear::Carrot::Handler::Tag;&lt;br /&gt;use Firepear::Carrot::Handler::Text;&lt;br /&gt;use Firepear::Carrot::Handler::Trigger;&lt;br /&gt;use Firepear::Carrot::Handler::Verbatim;&lt;br /&gt;use Firepear::Carrot::Handler::VerbatimText;&lt;/pre&gt;&lt;br /&gt;It made me a little tingly. It's finally coming together.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-4643708024910106190?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/4643708024910106190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=4643708024910106190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4643708024910106190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4643708024910106190'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/09/grammarian-stub-out.html' title='Grammarian stub-out'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-5864831886927619764</id><published>2008-09-11T23:24:00.000-07:00</published><updated>2008-09-11T23:57:15.266-07:00</updated><title type='text'>857 tests, 911 LOC</title><content type='html'>On the eve of beginning work on the Grammarian, this is where I stand.&lt;br /&gt;&lt;br /&gt;Tonight tests were dropped in for the 600, 701, and 702 handlers in Document; VerbatimText got its own test suite (largely a copy of Text's, which it works almost-but-not-quite-exactly like, making for very good regression testing, I think); coverage went up on Handler and VerbatimText -- it's almost all greens now, and no only one orange block in the "real" modules.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-5864831886927619764?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/5864831886927619764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=5864831886927619764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5864831886927619764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5864831886927619764'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/09/857-tests-911-loc.html' title='857 tests, 911 LOC'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-1968074862966545584</id><published>2008-09-09T23:00:00.000-07:00</published><updated>2008-09-09T23:02:40.540-07:00</updated><title type='text'>Document pragma validation</title><content type='html'>Finally getting back to work. As always, it's simpler than I thought it would be. Testing tomorrow. Then, the Grammarian&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-1968074862966545584?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/1968074862966545584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=1968074862966545584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/1968074862966545584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/1968074862966545584'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/09/document-pragma-validation.html' title='Document pragma validation'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-7886720513657091020</id><published>2008-08-21T16:24:00.000-07:00</published><updated>2008-08-21T21:43:16.999-07:00</updated><title type='text'>Tricksy</title><content type='html'>After my last post I sat around thinking about the implementation of various things, and I started to come up with some pretty clever ways of doing things. Of course, we all know how I feel about &lt;i&gt;clever&lt;/i&gt;, so I'm really thinking hard about these. Also, how would it look if the Voice of Dissent hauled off and started doing things just because he &lt;i&gt;could&lt;/i&gt;?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Magic Document Triggers&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The first thing I thought about was the document trigger. Since the day I thought of the mechanism which it embodies, it's been declared Mandatory; you can't have a Carrot document without a document trigger. But also on the plan from early times is a tiered configuration system, and I realized that this combined with the fact that the processor can treat arbitrary strings as files to be decomposed into tokens (thanks to PerlIO) meant that a synthetic file could be assembled which contained a document pragma, built on-the-fly from a user's personal configuration.&lt;br /&gt;&lt;br /&gt;This synthetic file would then be injected into the input list before processing began, putting it right where it should have been all along. Document export would take care of generating proper, sharable source files, and authors wouldn't have to type the same block into the beginning of every document they wrote. The problem comes when people don't export before sharing, and the person on the other end gets a document which contains entities their system doesn't recognize, or is written against a version of Carrot they don't have installed or...&lt;br /&gt;&lt;br /&gt;Decision: if implemented, this should not be default behavior. It should be a power user feature which must be enabled in one's configuration.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Positionally Independent Data Pragma&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The data pragma is an interesting thing, I think. It's basically the mechanism through which BLOB-equivalents are streamed into Carrot documents. As such, I've considered many uses for it but the two which will see use first are really different sides of the same coin: embedding media files and embedding Carrot extensions (both tied to Document Export).&lt;br /&gt;&lt;br /&gt;The idea is that when you want to share a document, you tell Carrot to "export" you a copy -- to generate a version for the use of other people, who may not have access to all the resources you have locally. Since the system knows what's "stock", it examines the document for everything that &lt;i&gt;isn't&lt;/i&gt;, and these bits are turned into data pragma which are written into the new copy of the document, and references to the original resources are rewritten to point at the data segments (where applicable).&lt;br /&gt;&lt;br /&gt;The data segments themselves, whether they contain an image or an audio file or a Radish module, are compressed (again, where applicable) and BASE64 encoded. The BASE64 representation is then stowed as the content of a data pragma -- and so all resources become local to the document, at the cost of storage (but who cares about that these days?)&lt;br /&gt;&lt;br /&gt;Here's the new bit: I realized a good while back that since the Grammarian has to read the document pragma before the rest of its processing chain can be instantiated (because the document pragma contains directives which may affect those tools). I realized this morning that I could use that delay to actually do 2 full passes over the document, scanning only for document and data pragma on the first pass. This would remove the requirement that data pragma appear before (that is: physically above in the source) any references to their content.&lt;br /&gt;&lt;br /&gt;This sounds pretty sweet, but it increases processing time, and it brings up the new wrinkle of how not to hit the data pragma on the second pass. Do you special-case them and ignore? Do you physically remove them from the file during the first pass by doing a copy-on-read and excepting the pragma you're catching the first time 'round?&lt;br /&gt;&lt;br /&gt;Decision: too big a problem for too small a win. Not gonna do it, for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-7886720513657091020?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/7886720513657091020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=7886720513657091020' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/7886720513657091020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/7886720513657091020'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/08/tricksy.html' title='Tricksy'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-6873074940332221198</id><published>2008-08-20T21:14:00.000-07:00</published><updated>2008-08-20T22:15:56.631-07:00</updated><title type='text'>Frighteningly close</title><content type='html'>Phase I of Carrot development is, I have realized, very close to completion. The only things left undone are the &lt;i&gt;document&lt;/i&gt; pragma and the Grammarian -- and both of these have been at least partially implemented or prototyped already.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On the one hand, this is a very pleasant thought. On the other, it means that the rough, unyeilding&amp;nbsp; wall of language design -- which had, to this point, merely been staring me in the face -- is now pressing hard against my shoulders.&lt;br /&gt;&lt;br /&gt;The pragma, due to the way they operate (at the Grammarian level), must have their validation routines hardcoded. And, as the &lt;i&gt;document&lt;/i&gt; pragma's job is to set data about the document itself and to modify the initial behavior of the Carrot processing chain, its contents and their validation have a lot of bearing on everything that follows.&lt;br /&gt;&lt;br /&gt;This will all make more sense when (1) there's a demo and (2) Radish comes along in Phase II, I swear :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-6873074940332221198?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/6873074940332221198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=6873074940332221198' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/6873074940332221198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/6873074940332221198'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/08/frighteningly-close.html' title='Frighteningly close'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-5095599258236346917</id><published>2008-08-15T22:46:00.001-07:00</published><updated>2008-08-15T22:49:49.968-07:00</updated><title type='text'>Problem solved; next up</title><content type='html'>I chose to create a new class, VerbatimText, which is solely responsible for handling text inside Verbatim chunks. This adds a small amount of simple special-casing to the Grammarian, but the alternative was to add probably-complex special-casing to the Text handler and coming up with a mechanism for it to know what's going on at the Grammarian's level.&lt;br /&gt;&lt;br /&gt;This felt like the far poorer choice, because as things stand, no modules are aware of what's happening "above" them in the stack -- things can only see down into the modules they're using. I think this is Good.&lt;br /&gt;&lt;br /&gt;Anyway, that's done, and it's tested and working. Onward to the Pragma!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-5095599258236346917?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/5095599258236346917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=5095599258236346917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5095599258236346917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5095599258236346917'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/08/problem-solved-next-up.html' title='Problem solved; next up'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-7763130923239939652</id><published>2008-08-12T17:54:00.000-07:00</published><updated>2008-08-12T18:00:11.032-07:00</updated><title type='text'>Oops (smaller)</title><content type='html'>Integration testing has revealed that I forgot to tell the text handler how to parse things inside Verbatim chunks.&lt;br /&gt;&lt;br /&gt;I can think of a number of ways to handle this, mostly kludgey, but it strikes me just this moment that a pretty clean way would be the creation of a second Text handler, with modified opening (undef) and closing (Verbatim close) markups, to be called from the Grammarian whenever Verbatim is atop the context stack.&lt;br /&gt;&lt;br /&gt;Hmmmmmmmmmm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-7763130923239939652?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/7763130923239939652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=7763130923239939652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/7763130923239939652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/7763130923239939652'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/08/oops-smaller.html' title='Oops (smaller)'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-4246328842702693972</id><published>2008-08-09T23:46:00.000-07:00</published><updated>2008-08-10T10:23:02.675-07:00</updated><title type='text'>Huge step forward</title><content type='html'>Carrot now has a small set of handler integration tests, and they all pass. This neccessitated the creation of a "minigrammarian", which, while having no document intelligence as the real Grammarian will, validates the concept of the Grammarian -- and the tests validate the "flock of handlers" concept.&lt;br /&gt;&lt;br /&gt;The test was to parse the string&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;"preceeding text [tag content content content]]]\nNew para"&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;which was properly rendered into&lt;br /&gt;&lt;ol&gt;&lt;li&gt;A TEXT chunk, 'preceding text'&lt;/li&gt;&lt;li&gt;A TAG&lt;/li&gt;&lt;li&gt;A second TEXT chunk, 'content content content'&lt;/li&gt;&lt;li&gt;A terminal TAG markup (']')&lt;/li&gt;&lt;li&gt;A terminal TRIGGER markup (']]')&lt;/li&gt;&lt;li&gt;And a third TEXT chunk, 'New para'&lt;/li&gt;&lt;/ol&gt;This is awesome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-4246328842702693972?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/4246328842702693972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=4246328842702693972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4246328842702693972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4246328842702693972'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/08/huge-step-forward.html' title='Huge step forward'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-6190425877684258107</id><published>2008-07-26T00:21:00.000-07:00</published><updated>2008-07-26T00:26:37.432-07:00</updated><title type='text'>Small progress is better than no progress</title><content type='html'>One more ticket closed: #17, which pointed out that there was, until 2 days ago, insufficient checking on the markups being passed to Handlers, and no tests on what checking there was (much less everything there &lt;span style="font-style: italic;"&gt;should&lt;/span&gt; have been).&lt;br /&gt;&lt;br /&gt;This has now been rectified, and one more barrier in the way of the Grammarian demo has been pushed aside.&lt;br /&gt;&lt;br /&gt;On the topic of the demo itself, I've gone crazy enough to talk myself into creating a vizualizer in SVG. Making simple SVG is really, really easy, so I'm hopeful that given a month of noodling about I can create a basic-but-fun datastructure browser. Because let's face it, a demo whose only product is some debug text and a datastructure is not exactly what captivates the kids these days. We're not working on TRS-80s anymore :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-6190425877684258107?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/6190425877684258107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=6190425877684258107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/6190425877684258107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/6190425877684258107'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/07/small-progress-is-better-than-no.html' title='Small progress is better than no progress'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-151792723207723441</id><published>2008-07-17T18:47:00.001-07:00</published><updated>2008-07-17T18:48:42.843-07:00</updated><title type='text'>All tests passing (again)!</title><content type='html'>Finicky, finicky stuff, but everything is a go again, and the codebase as a whole is better for it.&lt;br /&gt;&lt;br /&gt;Yay, correctness!&lt;br /&gt;&lt;br /&gt;This weekend I plan to push coverage back to 100% on all "finished" modules before restarting work on the Include pragma.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-151792723207723441?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/151792723207723441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=151792723207723441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/151792723207723441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/151792723207723441'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/07/all-tests-passing-again.html' title='All tests passing (again)!'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-474616675608502622</id><published>2008-07-04T21:22:00.000-07:00</published><updated>2008-07-04T21:25:27.951-07:00</updated><title type='text'>Oops</title><content type='html'>No, all tests are not passing.&lt;br /&gt;&lt;br /&gt;The Text handler had a spurious 'exit;' in it, which was choking off all the REAL tests, nearly all of which were failing.&lt;br /&gt;&lt;br /&gt;Looks like its problems are also being caused by 'endnode' -- but that's a well understood problem at this point, and the interactions here are far, far simpler than in Handler.pm. I'm hoping to have it fixed by tomorrow night.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-474616675608502622?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/474616675608502622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=474616675608502622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/474616675608502622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/474616675608502622'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/07/oops.html' title='Oops'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-4714178379839079083</id><published>2008-07-01T11:57:00.000-07:00</published><updated>2008-07-01T12:01:24.694-07:00</updated><title type='text'>All Tests Passing</title><content type='html'>Finally, all the original tests for Carrot (as of April!) are passing again. New coverage reports have been generated, and will continue to be as work progresses.&lt;br /&gt;&lt;br /&gt;There are a lot of new tests that need writing before work on the Pragma is begun again, and not just because some existing modules are below 100% coverage due to rewrites -- during this long process I noticed several ways in which the existing suite was flawed. Having test coverage is excellent, but it's still no guarantee that you're testing for everything that can go wrong (of course!).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-4714178379839079083?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/4714178379839079083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=4714178379839079083' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4714178379839079083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4714178379839079083'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/07/all-tests-passing.html' title='All Tests Passing'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-8594160874000069819</id><published>2008-06-22T20:37:00.000-07:00</published><updated>2008-06-22T20:40:23.773-07:00</updated><title type='text'>A great success!</title><content type='html'>&lt;pre&gt;Failed Test               Stat Wstat Total Fail  Failed  List of Failed&lt;br /&gt;-------------------------------------------------------------------------------&lt;br /&gt;t/03.Handler-3-Verbatim.t    5  1280    56    5   8.93%  19 29-30 55-56&lt;br /&gt;t/03.Handler-4-Tag.t         4  1024    42    4   9.52%  17 20 29-30&lt;br /&gt;t/03.Handler-5-Text.t        1   256    15    1   6.67%  1&lt;br /&gt;t/04.Pragma-2-Include.t      6  1536    34    6  17.65%  3 13-14 24 33-34&lt;br /&gt;Failed 4/13 test scripts, 69.23% okay. 16/608 subtests failed, 97.37% okay.&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is down from about 30% (per-test) failure, peaking at over 60% for some modules, 2 days ago. I believe I have largely fixed the problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-8594160874000069819?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/8594160874000069819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=8594160874000069819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8594160874000069819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8594160874000069819'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/06/great-success.html' title='A great success!'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-8268252956480558230</id><published>2008-06-01T22:56:00.001-07:00</published><updated>2008-06-01T22:59:18.100-07:00</updated><title type='text'>Almost there</title><content type='html'>See the previous post for details and linkage. Tomorrow evening I hope to wrap up work on Handler-&gt;lex, and after that there's just cleanup and the writing of many more tests in an attempt to abuse more bugs into surfacing.&lt;br /&gt;&lt;br /&gt;After this, it's time to write the &lt;span style="font-style: italic;"&gt;document&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;include&lt;/span&gt; pragma, which should be comparitively simple, and then it'll finally be the Grammarian's turn. Once that's done, there's just building the demo and the 0.2 release.&lt;br /&gt;&lt;br /&gt;Then the hard problems start again :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-8268252956480558230?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/8268252956480558230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=8268252956480558230' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8268252956480558230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8268252956480558230'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/06/almost-there.html' title='Almost there'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-5437320949461971631</id><published>2008-05-26T08:24:00.000-07:00</published><updated>2008-05-26T08:26:38.739-07:00</updated><title type='text'>Beginnings of a solution</title><content type='html'>After spending most of yesterday studying the three methods in Handler.pm which, together, create the error condition described in the previous few posts, I began to see a way out.&lt;br /&gt;&lt;br /&gt;Day-to-day specifics on this can be seen at the project issue tracker, &lt;a href="http://code.google.com/p/carrot/issues/detail?id=21"&gt;Issue 21&lt;/a&gt; specifically.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-5437320949461971631?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/5437320949461971631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=5437320949461971631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5437320949461971631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5437320949461971631'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/05/beginnings-of-solution.html' title='Beginnings of a solution'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-6644046450009499608</id><published>2008-05-07T06:00:00.001-07:00</published><updated>2008-05-07T06:11:36.719-07:00</updated><title type='text'>I Can Has Logo!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_2cvq_3Xj1OY/SCGoFkdWNcI/AAAAAAAAAF0/LCUqbbmyEkE/s1600-h/carrot.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_2cvq_3Xj1OY/SCGoFkdWNcI/AAAAAAAAAF0/LCUqbbmyEkE/s400/carrot.png" alt="" id="BLOGGER_PHOTO_ID_5197620258601842114" border="0" /&gt;&lt;/a&gt;Thanks to Dan, as usual, for his excellent work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-6644046450009499608?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/6644046450009499608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=6644046450009499608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/6644046450009499608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/6644046450009499608'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/05/i-can-has-logo.html' title='I Can Has Logo!'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_2cvq_3Xj1OY/SCGoFkdWNcI/AAAAAAAAAF0/LCUqbbmyEkE/s72-c/carrot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-4520864053196501984</id><published>2008-04-18T23:41:00.001-07:00</published><updated>2008-04-18T23:44:00.104-07:00</updated><title type='text'>Problem (Cont'd)</title><content type='html'>This has turned out to be rather thorny, if only because I'd like to try and solve it logically rather than just shuffle code around until oit works.&lt;br /&gt;&lt;br /&gt;The actual problem is in an interaction of the lex(), buildattr(), and endnode() methods of the original Handler. This code was written rather hastily, and without much forethought, and it shows now that I have an edge case problem to fix.&lt;br /&gt;&lt;br /&gt;My plan is to sit down tomorrow, carefully plot my way through the code (on paper) adn then come up with a solution before typing anything. I've been doing a lot more of this paper prototyping lately, and it's been serving me really well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-4520864053196501984?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/4520864053196501984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=4520864053196501984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4520864053196501984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4520864053196501984'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/04/problem-contd.html' title='Problem (Cont&apos;d)'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-8928824849452093961</id><published>2008-04-14T21:01:00.000-07:00</published><updated>2008-04-14T21:21:27.265-07:00</updated><title type='text'>Edge case problem</title><content type='html'>Tonight I found a flaw in chunk termination parsing. This doesn't do the right thing:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;[[foo bar;baz quux]]&lt;/blockquote&gt;The problem is that the method which detects the ends of chunks which are currently being processed declares this chunk to be completely parsed when the terminator is seen. It isn't, though, as "quux" is trigger content, and is not handled by the trigger handler -- it is taken care of by the text handler.&lt;br /&gt;&lt;br /&gt;The proper thing to do is to declare the chunk incomplete, return the node as it stands, and for the Grammarian's processing loop to take back over (and then hand off to the text handler).&lt;br /&gt;&lt;br /&gt;This issue survived so long because... well, I'm not sure how I managed to not have a test case like this in my suite of almost 650 tests, but I didn't, so that was problem number one. Problem number two is that integration testing of the handlers has not yet begun, though it is perilously close.&lt;br /&gt;&lt;br /&gt;The correct implementation of the solution to this problem is not yet known.&lt;br /&gt;&lt;br /&gt;Mood: :-/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-8928824849452093961?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/8928824849452093961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=8928824849452093961' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8928824849452093961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8928824849452093961'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/04/edge-case-problem.html' title='Edge case problem'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-8543062010383518376</id><published>2008-03-15T21:42:00.000-07:00</published><updated>2008-03-24T22:30:42.793-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='howitworks'/><title type='text'>How Carrot Works -- I: Overview</title><content type='html'>Welcome to the first article in an ongoing series, in which I attempt to actually explain the stuff that I usually blather on about without backreference or elucidation of any sort.&lt;br /&gt;&lt;br /&gt;This is a high-level overview of the extant design for the Carrot processing flow. For a basic overview of the language itself, see the &lt;a href="http://firepear.net/carrot/10km.html"&gt;10km document&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The Grammarian&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Compilation of a Carrot document is a 2 phase process. In the first phase, a subsystem called the Grammarian examines the document for &lt;span style="font-style: italic;"&gt;well-formedness&lt;/span&gt;. That is, it examines the document to make sure that it is written in a grammar of Carrot. The Grammarian proper is a message-passer/traffic cop between a small flock of components which handle the majority of the actual work of this phase of processing.&lt;br /&gt;&lt;br /&gt;The Lexer does all input filehandling and decomposes the resultant stream of text into &lt;span style="font-style: italic;"&gt;tokens&lt;/span&gt;. There are only three kinds of tokens: whitespace strings, nonwhitespace strings, and newlines.&lt;br /&gt;&lt;br /&gt;Tokens from the lexer are examined by a group of Handler components. There is one handler for each type of Carrot markup, and one each for special cases like the document and include triggers (the pragma). These handlers construct &lt;span style="font-style: italic;"&gt;nodes&lt;/span&gt; from the tokens, with each node being a lexical chunk of the document and all available metadata for it.&lt;br /&gt;&lt;br /&gt;These nodes are then passed to the DOM (Document Object Model) component, which does the bulk of well-formedness checking and then stows properly constructed nodes into the document tree (which the DOM also provides read access to).&lt;br /&gt;&lt;br /&gt;Assuming all goes well, the entire source document will be transformed into a datastructure which encodes the content and structure of the original, along with explicit and inferred metadata for later processing and (possible) error reporting.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;The Ontologist&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Phase 2 begins with another subsystem, called the Ontologist, beginning a directed walk of the DOM's tree. It is the Ontologist's job to make sure that the document is written in a &lt;span style="font-style: italic;"&gt;valid&lt;/span&gt; dialect of Carrot. This is neccessary because, in its purest form, Carrot is, like XML, a language construction kit.&lt;br /&gt;&lt;br /&gt;In any event, the Ontologist examines each node in isolation (This node says it's a trigger and its element type is "foobar". Is there a foobar trigger in my current dialect? This node contains an attribute "baz". Is that attribute valid for this element, and is its value of the defined type and within any defined bounds?) and in relation to other nodes (Is this element allowed within the current scope(s)?).&lt;br /&gt;&lt;br /&gt;The Ontologist's validity rules are expressed in a Carrot grammar called &lt;span style="font-style: italic;"&gt;Radish&lt;/span&gt;, which will be the topic of an entire post later on. (Yes, Carrot bootstraps itself, using itself.)&lt;br /&gt;&lt;br /&gt;If the Ontologist successfully walks the entire tree, then the document is both well-formed and valid, and compilation is complete. From this point on, it's about what the user wants to do with the document. And that'll be the topic of the next How Carrot Works post.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-8543062010383518376?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/8543062010383518376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=8543062010383518376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8543062010383518376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/8543062010383518376'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/03/how-carrot-works-i-overview.html' title='How Carrot Works -- I: Overview'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-3381715349106643656</id><published>2008-03-14T22:03:00.000-07:00</published><updated>2008-03-14T22:48:42.328-07:00</updated><title type='text'>Generic Handlers complete. Next up: Pragma</title><content type='html'>The regular Handlers are complete and tested (though not (quite) yet tested to 100% code coverage). Text.pm is 36 lines, according to sloccount. Maybe I'm finally getting good at estimating things relating to code.&lt;br /&gt;&lt;br /&gt;In my next update, to be written when I'm more awake, I shall talk at some length about exactly what the hell is going on here.&lt;br /&gt;&lt;br /&gt;I'm seeing weirdness with Devel::Cover and subclasses. It refuses to believe that I'm testing methods which subclasses redefine. This is very unhappy-making :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-3381715349106643656?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/3381715349106643656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=3381715349106643656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/3381715349106643656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/3381715349106643656'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/03/generic-handlers-complete-next-up.html' title='Generic Handlers complete. Next up: Pragma'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-5513663528441841953</id><published>2008-03-11T22:38:00.000-07:00</published><updated>2008-03-11T22:46:18.431-07:00</updated><title type='text'>Shock and Awe</title><content type='html'>When I started work on the handlers, I figured I could get maybe three-quarters of the code for Triggers and Verbatims shared through the generic Handler, and maybe half of what Tags would need, and perhaps one-quarter of Text chunks.&lt;br /&gt;&lt;br /&gt;As it turns out, with not much effort, and very little in the way of redundancy or special-casing, 100% of the code for Triggers, Verbatims, and Tags is shared. Their modules are bare subclasses of the Handler superclass. The empty modules are still neccessary, though, because of the handful of places where the shared code does behave differently based on what class it's executing as (and it leaves a clean, clear maintenance path for when I start finding the things I've missed and the second, customized parsing stage becomes neccessary).&lt;br /&gt;&lt;br /&gt;So all my careful work in designing that two-stage parsing pass was either wasted or wildly successful, depending on your point of view :)&lt;br /&gt;&lt;br /&gt;The Text handler does actually get rewritten methods -- two of them -- and one unique to itself, but it's far simpler than the other handlers, so the loccount for these additions will still be under 50, I think.&lt;br /&gt;&lt;br /&gt;All the handlers except Text are testing clean right now as well. Handler.pm's coverage is up to 91% overall. In a scarily short time, it will be time to lash the handlers to the Grammarian (which is really to say: to the DOM).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-5513663528441841953?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/5513663528441841953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=5513663528441841953' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5513663528441841953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5513663528441841953'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/03/shock-and-awe.html' title='Shock and Awe'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-4354663319725381929</id><published>2008-03-07T23:22:00.000-08:00</published><updated>2008-03-07T23:33:14.433-08:00</updated><title type='text'>Subclasses ahoy</title><content type='html'>Since my last post, the generic Handler has been tested about as far as it can be in a standalone more, and coding has begun on the specific subclass handlers (Trigger, Tag, Verbatim, Text, Document).&lt;br /&gt;&lt;br /&gt;I'm not entirely sure yet, but I think the Use and Import pragmas will be implemented as subclassed handlers, acting in the same way as the Document trigger.&lt;br /&gt;&lt;br /&gt;At the moment, things are moving quickly. I'm not sure how long this will last.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-4354663319725381929?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/4354663319725381929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=4354663319725381929' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4354663319725381929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4354663319725381929'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/03/subclasses-ahoy.html' title='Subclasses ahoy'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-4102116361676269296</id><published>2008-02-10T16:35:00.000-08:00</published><updated>2008-02-10T16:47:14.046-08:00</updated><title type='text'>Following up on that last note</title><content type='html'>The generic (superclass) Handler is finally shaping up, with no significant changes to its design. As of right now, it successfully parses this trigger:&lt;br /&gt;&lt;blockquote&gt;[[document;quux ;;; multiline with comments&lt;br /&gt;title;Foobar date;now;;;multiple comments, actually&lt;br /&gt;author;'Shawn Boyette's Dog, Esq.' ]]&lt;/blockquote&gt;Though I shouldn't be surprised, I'm very happy that things like "date;now;;;multiple" are being handled correctly. This batch of hard problems is nearly solved, which is both a relief and worrisome, because there are so many more to tackle :)&lt;br /&gt;&lt;br /&gt;It's also up to 68% test coverage, but that's being inflated by sub coverage, and there's a lot of exception catches yet to be written.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-4102116361676269296?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/4102116361676269296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=4102116361676269296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4102116361676269296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4102116361676269296'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/02/following-up-on-that-last-note.html' title='Following up on that last note'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-297825753416552157</id><published>2008-02-09T23:48:00.000-08:00</published><updated>2008-02-09T23:49:16.596-08:00</updated><title type='text'>First Node</title><content type='html'>Much work to be done yet, but:&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/carrot/source/detail?r=67&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-297825753416552157?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/297825753416552157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=297825753416552157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/297825753416552157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/297825753416552157'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/02/first-node.html' title='First Node'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-9131674802885345340</id><published>2008-02-07T09:21:00.000-08:00</published><updated>2008-02-07T22:25:11.530-08:00</updated><title type='text'>Another "breakthrough"</title><content type='html'>&lt;span style="font-style: italic;"&gt;In which I continue to realize things long after they should have become apparent&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Of late, though I have been working (which is to say: coding) on the Handlers, I have been working (which is to say: thinking) on Radish. Tied directly to radish is the problem of how to parse the structured text occuring inside some triggers.&lt;br /&gt;&lt;br /&gt;I've done so much deferral of solving this problem that my thinking was still stuck in the pre-2004 era, when everything was line-oriented and based around decomposition of lines with regexes. Not until this morning's shower did I realize that I have a perfectly good LALR lexer -- which can be fed arbitrary strings as well as files -- already coded and waiting to be used.&lt;br /&gt;&lt;br /&gt;What this means is that structured text doesn't have to be ridgidly line-oriented the way many wiki dialects are; whitespace can be insignificant, as it is with most programming languages. A table, for instance, could (hypothetically) look like&lt;br /&gt;&lt;blockquote&gt;r1c1 ;; r1c2 --- r2c1 ;; r2c2&lt;br /&gt;&lt;/blockquote&gt;or&lt;br /&gt;&lt;blockquote&gt;r1c1 ;; r1c2&lt;br /&gt;---&lt;br /&gt;r2c1 ;; r2c2&lt;br /&gt;&lt;/blockquote&gt;and so on. Duh.&lt;br /&gt;&lt;br /&gt;Also, it strikes me &lt;span style="font-style: italic;"&gt;just now&lt;/span&gt; that Handler-&gt;lex should perhaps use substr() where possible instead of regexes. This would cut down on the need for escaping and possible complications arising from it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-9131674802885345340?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/9131674802885345340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=9131674802885345340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/9131674802885345340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/9131674802885345340'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/02/another-breakthrough.html' title='Another &quot;breakthrough&quot;'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-2151490509837279535</id><published>2008-01-25T08:33:00.000-08:00</published><updated>2008-01-25T08:54:07.988-08:00</updated><title type='text'>Software Engineering</title><content type='html'>The core routines of the Handler superclass have been in place for a week (with under a week left to deadline), but I produced no useful work this week. Eventually I realized it was because I was fretting about the quality of the code in the Handler. It works, sure, but it works in a way that I've come to view as lacking, and which is unacceptible in this project.&lt;br /&gt;&lt;br /&gt;It has no engineering in it. It's just sketched out and working, but it ONLY minimally works, and there is NO error handling, and... It's simply not on par, quality and reliability-wise with the Lexer and DOM code (not that I'm pretending they're perfect).&lt;br /&gt;&lt;br /&gt;To fix this, I sat down and added a huge new section to the &lt;a href="http://carrot.googlecode.com/svn/trunk/doc/statuscodes.txt"&gt;status codes list&lt;/a&gt;. Now that the Handler works, this list (section 3000 of it) is the spec for making it properly engineered code. It's also the roadmap for a test suite. I believe I might do my first bit of actual test-driven development, contra my more usual "Okay, this new little chunk works; time to write a test for it" method. (What's a good, marketable term for that, anyway? Would know-nothing trendwhore coders buy into "Test-backed Microdevelopment"? Would management pay $3500 to send their dev leads to a 2-day seminar on TBM?)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-2151490509837279535?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/2151490509837279535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=2151490509837279535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2151490509837279535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2151490509837279535'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/01/software-engineering.html' title='Software Engineering'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-549251304162409879</id><published>2008-01-16T20:53:00.000-08:00</published><updated>2008-01-16T20:58:00.488-08:00</updated><title type='text'>Lexer again?</title><content type='html'>Working on the Handler made me realize that the Lexer needed some &lt;span style="font-style: italic;"&gt;teensy-tiny&lt;/span&gt; functionality adds. They are in now, and tested already. In addition to making the calls to the handlers cleaner, they should actually make error reporting nicer in at least some cases.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-549251304162409879?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/549251304162409879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=549251304162409879' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/549251304162409879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/549251304162409879'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/01/lexer-again.html' title='Lexer again?'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-4307497432320780619</id><published>2008-01-14T05:55:00.000-08:00</published><updated>2008-01-14T06:36:19.330-08:00</updated><title type='text'>Away we go</title><content type='html'>I admit it: I was worrying that my holiday burst of inspiration and work ethic was an abberration which wouldn't soon be repeated. Having overhauled the Lexer and DOM and gotten them both up to 100% test coverage, I couldn't seem to get going on actual &lt;span style="font-style: italic;"&gt;new code&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Sure, I'd spend a couple of hours every day or two of the last week-ish writing down bulleted lists or flowcharts of logic flow in my trusty quadrille notebooks, but I was frozen up as far as coding went. It just didn't all gel in my head yet.&lt;br /&gt;&lt;br /&gt;Saturday night I felt like I'd gotten it all (where "it all" is the interactions between the Grammarian and its flock of subclassed Handler modules) worked out, and part of me was very much wanting to get going on the code, but another part of me was decidedly disinterested and just wanted to play video games. So that's what I did Saturday and most of Sunday, but I wasn't enjoying it all that much, because the part of me that wanted to be coding was busily yelling at the rest of me that I was a gigantic slacker who was going to completely fail on a self-imposed deadline and new year's resolution and &lt;span style="font-style: italic;"&gt;god&lt;/span&gt; I just suck &lt;span style="font-style: italic;"&gt;so bad&lt;/span&gt; why do I even bother talking to me?&lt;br /&gt;&lt;br /&gt;I was exceptionally grumpy on the drive back to Atlanta.&lt;br /&gt;&lt;br /&gt;But just before bedtime I finally managed to scrap together just enough code in the Handler superclass to write the first few tests for it. And then I subclassed it into the beginnings of the Comment handler, and wrote a handful more tests for &lt;span style="font-style: italic;"&gt;that&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The game, once more, is afoot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-4307497432320780619?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/4307497432320780619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=4307497432320780619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4307497432320780619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/4307497432320780619'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/01/away-we-go.html' title='Away we go'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-5274984233364746479</id><published>2008-01-09T22:29:00.000-08:00</published><updated>2008-01-09T22:32:19.478-08:00</updated><title type='text'>Today's Progress</title><content type='html'>The DOM is up to 98.9% coverage, with the remaining misses waiting on specific fixes to come along later.&lt;br /&gt;&lt;br /&gt;I've started on a series of small, lightweight introductions to Carrot. That's way harder than the design and coding.&lt;br /&gt;&lt;br /&gt;And finally, not something I did but something I realized today: It's time to start designing the &lt;span style="font-style: italic;"&gt;language&lt;/span&gt;, and not just the &lt;span style="font-style: italic;"&gt;compiler&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-5274984233364746479?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/5274984233364746479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=5274984233364746479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5274984233364746479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/5274984233364746479'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/01/todays-progress.html' title='Today&apos;s Progress'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-6134058111179218887</id><published>2008-01-09T06:57:00.000-08:00</published><updated>2008-01-09T07:08:27.329-08:00</updated><title type='text'>Planning, Testing</title><content type='html'>I've been working (slowly) on pulling coverage up. Just this morning, Lexer finally hit 100% across the board. The DOM still has some way to go, mostly in the coverage of repetitive checks on statuses and the like.&lt;br /&gt;&lt;br /&gt;I haven't written much Handler code yet. Despite having some good ideas about things, once I started to code those ideas I realized that they might be good but they were also complex. At this layer, modules can't stand alone anymore (unlike the Lexer and DOM, which are dumb functional units that sit below everything, operating free of external context). Now things are starting to pass data back and forth in ways that affect each other's operation. Given that, I've been doing a lot of work in a quadrille notebook and rather little in Emacs, but it's all good and it's very valid progress.&lt;br /&gt;&lt;br /&gt;The thing I'm happiest about is the (apparent) power of the framework I'm building. Though there are many, many, many things left to be done, it is becoming easier and easier to see how to implement things I once thought would be very difficult. I'm almost ready to believe this was all a good idea :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-6134058111179218887?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/6134058111179218887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=6134058111179218887' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/6134058111179218887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/6134058111179218887'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/01/planning-testing.html' title='Planning, Testing'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-820978805396615740</id><published>2008-01-03T23:39:00.000-08:00</published><updated>2008-01-03T23:43:00.430-08:00</updated><title type='text'>Rewrites complete</title><content type='html'>The DOM and Lexer mdifications are complete, barring a tiny bit of Devel::Cover-fueled test writing on the DOM. I've also written a wrapper around D::C and upload its report to the Carrot site.&lt;br /&gt;&lt;br /&gt;This weekend work on Handlers begins.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-820978805396615740?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/820978805396615740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=820978805396615740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/820978805396615740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/820978805396615740'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/01/rewrites-complete.html' title='Rewrites complete'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-3943819979449048325</id><published>2008-01-01T14:21:00.001-08:00</published><updated>2008-01-01T16:31:37.719-08:00</updated><title type='text'>Resolution</title><content type='html'>In the past 4 days I've driven all over the state and still managed to get tons of work done on Carrot. What started as minor fixup on the DOM module ended up being a wholesale, &lt;span style="font-style: italic;"&gt;in situ&lt;/span&gt; rewrite. The resulting code is much more regular and has a lot less special cases, and should be generally more maintainable in the future. My tendancy to view writing test suites which are as complete as possible as a sort of software engineering minigame paid off bigtime in this effort Even though it needed many (repetitive) modifications itself, the existing test suite was invaluable for turning up regression errors as well as plain old dumb mistakes made while coding in the pre-dawn hours.&lt;br /&gt;&lt;br /&gt;Though there is a small amount of cleanup left before this effort can really be called "done", it's very close, and I know what comes next: The Grammarian and its attendant Handlers, which are pretty well planned out.&lt;br /&gt;&lt;br /&gt;I'm only going to make one resolution for 2008 -- we'll see if there's a need for others to follow. I hereby resolve to have a public Carrot grammar validator in operation by midnight, 1February, 2008.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-3943819979449048325?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/3943819979449048325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=3943819979449048325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/3943819979449048325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/3943819979449048325'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2008/01/resolution.html' title='Resolution'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-987628255883840262</id><published>2007-12-28T07:20:00.000-08:00</published><updated>2007-12-28T07:39:52.377-08:00</updated><title type='text'>DOM, take two</title><content type='html'>Last night at Too Damn Late[TM], I got some really good ideas which amount to a refactoring of the DOM.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The accessors should be smart get/set types&lt;/li&gt;&lt;li&gt;VERBATIM chunks should be containers in the manner of TRIGGERS rather than special cases of TEXT chunks&lt;/li&gt;&lt;li&gt;I was misusing the 0E0 value; it should be replaced with 'undef'&lt;/li&gt;&lt;li&gt;Now that both the DOM tree and the text stowage structure are arrays instead of hashes, their additive methods can be rewritten with simple push()es instead of index accesses&lt;/li&gt;&lt;li&gt;...and the associated node tracking scalars can be gotten rid of&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;And then a lot of little things auxilliary to these points. And rewrites of the POD to match it all. And a likely painful overhaul of the test suite.&lt;br /&gt;&lt;br /&gt;Oh well. That's progress. The Grammarian and its Handlers follow this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-987628255883840262?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/987628255883840262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=987628255883840262' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/987628255883840262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/987628255883840262'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2007/12/last-night-at-too-damn-latetm-i-got.html' title='DOM, take two'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-2478739269967051933</id><published>2007-12-25T13:32:00.000-08:00</published><updated>2007-12-25T13:58:36.946-08:00</updated><title type='text'>Grammarian flowcharts</title><content type='html'>Last night, as I finished up porting issues from the old Trac install to googlecode, I began pondering one of them, and ended up with some really good ideas. It was all about the Grammarian, and the new strategy of it doing its work through independent modules rather than a giant wodge of code in the Grammarian module itself.&lt;br /&gt;&lt;br /&gt;Basically the Grammarian acts as a traffic cop and crossing guard for the Lexer and DOM while a series of Handler modules hands off the heavy lifting between themselves. I sat there, into the wee hours of Xmas morning, drawing revision after revision of a logic flowchart for the design. It seems like pretty good stuff at this point -- now I just have to get the DOM back on its feet so I can move on to this work.&lt;br /&gt;&lt;br /&gt;And after that, it'll finally be possible to show off a Carrot validator!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-2478739269967051933?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/2478739269967051933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=2478739269967051933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2478739269967051933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2478739269967051933'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2007/12/grammarian-flowcharts.html' title='Grammarian flowcharts'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-3339484564154662031</id><published>2007-12-23T18:14:00.000-08:00</published><updated>2007-12-24T01:09:38.429-08:00</updated><title type='text'>DBM::Deep</title><content type='html'>It turns out that NDBM key/value pairs can have a maximum length of 1023 characters, combined. This is, to say the least, unsuitable for my purposes, as I had been using NDBM for storage of document text chunks.&lt;br /&gt;&lt;br /&gt;I asked for alternatives a while ago on #perl, and one person mentioned DBD::Deep. At the time I was leaning towards SQLite or a custom tie() job, but decided to give D::D a look before making a decision. I'm glad I did. Today I'm refactoring the DOM to use it instead of NDBM (which only ever worked because the Lexer and DOM test files are so minimal).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-3339484564154662031?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/3339484564154662031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=3339484564154662031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/3339484564154662031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/3339484564154662031'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2007/12/dbmdeep.html' title='DBM::Deep'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996140147468268406.post-2108627710626013526</id><published>2007-12-21T07:02:00.001-08:00</published><updated>2007-12-21T07:03:13.206-08:00</updated><title type='text'>Yay!</title><content type='html'>I've been awarded the project name "carrot" over at googlecode, and now things are ready to roll.&lt;br /&gt;&lt;br /&gt;Here we go!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996140147468268406-2108627710626013526?l=carrotlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://carrotlang.blogspot.com/feeds/2108627710626013526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996140147468268406&amp;postID=2108627710626013526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2108627710626013526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996140147468268406/posts/default/2108627710626013526'/><link rel='alternate' type='text/html' href='http://carrotlang.blogspot.com/2007/12/yay.html' title='Yay!'/><author><name>Shawn</name><uri>http://www.blogger.com/profile/11686509603464708342</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
