<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog - Alex-Elliott.co.uk &#187; general</title>
	<atom:link href="http://alex-elliott.co.uk/blog/category/general/feed" rel="self" type="application/rss+xml" />
	<link>http://alex-elliott.co.uk/blog</link>
	<description>The internet home of a prospective software engineer</description>
	<lastBuildDate>Thu, 09 Feb 2012 14:25:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<image>
			<title>Blog - Alex-Elliott.co.uk</title>
			<url>http://alex-elliott.co.uk/favicon.png</url>
			<link>http://alex-elliott.co.uk/blog</link>
			<width>16</width>
			<height>16</height>
			<description>The internet home of a prospective software engineer</description>
		</image>		<item>
		<title>Musings on Syntax Highlighting for Websites</title>
		<link>http://alex-elliott.co.uk/blog/2009/02/general/musings-on-syntax-highlighting-for-websites</link>
		<comments>http://alex-elliott.co.uk/blog/2009/02/general/musings-on-syntax-highlighting-for-websites#comments</comments>
		<pubDate>Fri, 06 Feb 2009 22:36:45 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[musing]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://alex-elliott.co.uk/blog/?p=57</guid>
		<description><![CDATA[Syntax highlighting can be very important to some websites, particularly those featuring articles on programming practice/theory or pastebin/nopaste websites for collaborative debugging.  However, most highlighting packages tend to use pattern matching to attempt to correctly highlight a given document rather than a more accurate but more complex lexical parser and do not have the capacity [...]]]></description>
			<content:encoded><![CDATA[<p>Syntax highlighting can be very important to some websites, particularly those featuring articles on programming practice/theory or pastebin/nopaste websites for collaborative debugging.  However, most highlighting packages tend to use pattern matching to attempt to correctly highlight a given document rather than a more accurate but more complex lexical parser and do not have the capacity to use multiple highlighting schemes for a given document internally.  If you choose to highlight something as PHP, then only the PHP segments will be syntax highlighted, when it&#8217;s plausible that there will also be HTML, XML, Javascript, CSS, etc in the same document.</p>
<p>These are two features lacking from most existing syntax highlighting packages today, and ones that I think would be extremely useful to have in publicly available free software tools.  The question is simply whether it is feasible to include them, or whether what we&#8217;ve got currently is as good as it&#8217;s likely to get.</p>
<h2>Pattern Matching versus Lexical Parsing</h2>
<p>These are the two main ways of taking a source document and producing a highlighting for it.  Pattern matching uses regular expressions to attempt to catch recognisable patterns in the given language which is simpler to produce, but does not guarantee good results.  Lexical parsing on the other hand is a much more complex but when done more flexible method for producing a highlighting of some input.</p>
<p>Lexical parsing involves going through the input from start to finish breaking the input up into &#8220;tokens&#8221;, which are small segments of the input with some associated meta-data.  In essence it breaks the code provided down into it&#8217;s components: strings, keywords, variables, etc.  The power of this model is that while the parser is working it can use its state information on things like scope and context to provide more accurate and more informative details.  In fact, a full lexical parser would be able to identify syntax errors and highlight them automatically.</p>
<p>As to providing more information, with tokenised input it would be fairly trivial to note which braces/brackets match one another, and unlike a pattern matching system you can include information from other parts of the program &#8211; take the simple example of a C++ typedef, something simple like &#8220;typedef vector&lt;string&gt;::iterator vec_iter&#8221;, which provides a new shorthand type &#8220;vec_iter&#8221; as a vector&lt;string&gt; iterator.  While a pattern matching model could probably work out that vec_iter was a type, it would not know what it represented, or if it was valid.  A lexical parser would be able to add a note saying &#8220;this is a vector&lt;string&gt; iterator&#8221; provided the typedef was in the provided sample.</p>
<p>Of course, while it is probably a superior method from a functional standpoint, it is significantly more complicated to implement.  Which raises the question of whether the benefits are worth the extra outlay of effort required to produce the highlighter.  My personal view is that pattern matching for the moment is the better option for things like articles, where we are confident that the input is a valid piece of code &#8211; and thus should be fine in a normal highlighter.  For uses like pastebin/nopaste sites though, it would be beneficial to have this kind of extra information since they are often used for collaborative debugging, and so highlighting of syntax errors, and other possible errors like a definition of a used type not being available (this might not be a <em>true</em> error as the definition may be in a file not provided to the highlighter, but it could still be worth noting &#8211; and it would definitely be useful for self-contained testcases).</p>
<h2>Language Nesting in Code Samples</h2>
<p>The other limitation in many existing syntax highlighters is that they are not able to apply several different language highlighting schemes to one piece of provided input.  This can be annoying when you&#8217;re highlighting things like web pages, which can easily contain HTML, with nested CSS (in &lt;style&gt;&lt;/style&gt;), nested JS (in &lt;script&gt;&lt;/script&gt;) and perhaps server-side languages like some PHP (in &lt;?php ?&gt;).</p>
<p>For the most part, just selecting one to highlight works, since it&#8217;s unlikely that more than one requires significant attention at once, however there are situations where it would be useful to have each block highlighted separately.  However, this would either require the user to select ranges of code to highlight in different language engines, or it would require the highlighter to attempt to automatically determine what language segments of code are.  The first is tedious for the end-user, and would likely lead to the product not being used, and the latter adds significant complication to the highlighter.</p>
<p>These things are something I would like to see included in the functionality of pastebin/nopaste websites, but due to the complexity I can&#8217;t expect them to just turn up one day.  So, given that I figure I might give it a go, simply writing a fairly cut-down proof-of-concept to maybe appear with pastesite one day (in C++, not PHP since I expect the performance of PHP to not be capable of this satisfactorily).  As to whether I&#8217;ll ever finish it, that remains to be seen, but I do think such a product would be beneficial to the programming community as a whole, and I hope if I don&#8217;t do it maybe someone else will.</p>
]]></content:encoded>
			<wfw:commentRss>http://alex-elliott.co.uk/blog/2009/02/general/musings-on-syntax-highlighting-for-websites/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting an Agenda</title>
		<link>http://alex-elliott.co.uk/blog/2008/11/general/setting-an-agenda</link>
		<comments>http://alex-elliott.co.uk/blog/2008/11/general/setting-an-agenda#comments</comments>
		<pubDate>Sun, 30 Nov 2008 20:00:53 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[zbot]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://alex-elliott.co.uk/blog/?p=39</guid>
		<description><![CDATA[If you&#8217;ve checked up on the site since my last blog entry, you&#8217;ve probably noticed I have indeed started on the pages for the rest of the site.  The about and contact pages are finished, and the footer now automatically displays the four most recent blog entries.  Now comes the main bit of the work, [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve checked up on the site since my last blog entry, you&#8217;ve probably noticed I have indeed started on the pages for the rest of the site.  The about and contact pages are finished, and the footer now automatically displays the four most recent blog entries.  Now comes the main bit of the work, writing a <acronym title="Content Management System">CMS</acronym> to manage my current and completed projects.</p>
<h2>The Main Site</h2>
<p>So, what exactly is going to be one the main site?  If you&#8217;ve seen the front page you can probably mostly guess.  There will be project pages for each project I&#8217;m currently working on or have completed &#8211; and there will be one of each set as &#8220;featured&#8221; works displayed on the front page and in the blog footer (the other spot will be filled by the most recent project).</p>
<p>The project pages themselves will be written descriptions of the project: what it&#8217;s about, what it&#8217;s aiming to produce, what I want to learn from it, what&#8217;s being used to implement it.  It will also have a section for relevant blog articles, which will be automatically fetched from here by selecting all the articles with a given tag (so for the zbot2 project, I will look for a &#8220;zbot&#8221; tag on blog articles).</p>
<p>This should provide a good source page to refer people to to answer any questions about the project, and can serve as a home for any projects I decide I would like to release publicly.</p>
<h2>What About zbot?</h2>
<p>I mentioned I was hoping to start zbot v2.0 soon, I will hopefully be starting that almost directly after finishing the main site on here.  In the meantime it&#8217;s time to start some design for the structure of the program and its source files.  When the project does get started I&#8217;ll make note here, and hopefully there&#8217;ll be a working core available before too long.</p>
<h2>Other Work</h2>
<p>This site and zbot aren&#8217;t the only things I&#8217;m doing however, there&#8217;s another project I would like to write which I have not really begun looking at yet, but which requires a fair bit of research before I can start.  I&#8217;ll probably look into a few of the topics I&#8217;ll need to write it while I&#8217;m working on the other projects (this site and zbot), and will hopefully write a few articles on them to help cement my understanding and to share what I&#8217;ve found out.</p>
<p>So, hopefully we&#8217;ll see the rest of the main site taking shape over the next week or two.  But if I don&#8217;t have time to blog for a little while, don&#8217;t think I&#8217;ve stopped working, hopefully it means quite the opposite, but we&#8217;ll have to see. <img src='http://alex-elliott.co.uk/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://alex-elliott.co.uk/blog/2008/11/general/setting-an-agenda/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Personal Site Work</title>
		<link>http://alex-elliott.co.uk/blog/2008/11/general/personal-site-work</link>
		<comments>http://alex-elliott.co.uk/blog/2008/11/general/personal-site-work#comments</comments>
		<pubDate>Wed, 26 Nov 2008 20:02:29 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://alex-elliott.co.uk/blog/?p=24</guid>
		<description><![CDATA[So, as predicted there&#8217;s already been a pretty big gap, but that&#8217;s not to say I&#8217;ve been neglecting the blog.  I&#8217;ve had a new bespoke design drafted up by a friend I know through a web development community, which I hope to get properly skinned for WP and set up as a personal site on [...]]]></description>
			<content:encoded><![CDATA[<p>So, as predicted there&#8217;s already been a pretty big gap, but that&#8217;s not to say I&#8217;ve been neglecting the blog.  I&#8217;ve had a new bespoke design drafted up by a friend I know through a web development community, which I hope to get properly skinned for WP and set up as a personal site on alex-elliott.co.uk soon.  The designer is Adam McPeake, who is linked in the blogroll under wized (<a href="http://wized.net/">wized.net</a> is his portfolio).</p>
<h2>Previews</h2>
<p>So, while I get to work converting the design into a WP theme and writing a CMS for my personal site, here&#8217;s a preview of what it should eventually look like (the main site, and the blog):</p>
<p><a rel="lightbox" href="http://labs.wized.net/looks/alex/preview2.png"><img src="/images/thumbs/main_site.png" alt="Main Site Preview"></a> <a rel="lightbox" href="http://labs.wized.net/looks/alex/previewblog.png"><img src="/images/thumbs/blog.png" alt="Blog Preview"></a></p>
<p>Hope to have some more updates about this soon, or maybe you&#8217;ll be reading this in the lovely new theme. <img src='http://alex-elliott.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>UPDATE:</strong> as you may have noticed the new design has been skinned into WP (and I rediscovered precisely why I hate that theme system).  Hopefully things still work, but if they don&#8217;t please do comment and let me know.</p>
<p><strong>NOTE:</strong> yes, the rest of the site isn&#8217;t done yet, what&#8217;s up is an example of what it should look like when done (at least the index page), I&#8217;ll start on getting the main top links at least drafted into markup now &#8211; and I should be able to finish the about and contact pages completely within a few days.</p>
<p>Exciting stuff. <img src='http://alex-elliott.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://alex-elliott.co.uk/blog/2008/11/general/personal-site-work/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Me and Blogs</title>
		<link>http://alex-elliott.co.uk/blog/2008/11/general/me-and-blogs</link>
		<comments>http://alex-elliott.co.uk/blog/2008/11/general/me-and-blogs#comments</comments>
		<pubDate>Wed, 12 Nov 2008 21:25:54 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://alex-elliott.me/?p=7</guid>
		<description><![CDATA[So, a blog.  I&#8217;ve been thinking about having one for quite a long time, but have never gotten around to doing it.  Usually because I don&#8217;t think I&#8217;ll keep up writing on it.  Hopefully that won&#8217;t be the case, but it might well be.  Expect longish gaps. Anyway, the idea of this is as an [...]]]></description>
			<content:encoded><![CDATA[<p>So, a blog.  I&#8217;ve been thinking about having one for quite a long time, but have never gotten around to doing it.  Usually because I don&#8217;t think I&#8217;ll keep up writing on it.  Hopefully that won&#8217;t be the case, but it might well be.  Expect longish gaps. <img src='http://alex-elliott.co.uk/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Anyway, the idea of this is as an accompaniment to my portfolio/project website (currently still in the works) to elaborate on what I&#8217;m working on at the moment, and any other random happenings as they occur.  I&#8217;ve got a few projects I&#8217;d like to start bouncing around my head, and I hope to start/blog about one soon.  What is it?  Well, you&#8217;ll see won&#8217;t you&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://alex-elliott.co.uk/blog/2008/11/general/me-and-blogs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

