<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>Improved Means for Achieving Deteriorated Ends</title> <link>http://blog.redlinernotes.com</link> <atom:link href="http://blog.redlinernotes.com/rss.xml" rel="self" type="application/rss+xml" /> <language>en-us</language> <pubDate>Sun, 12 May 2013 01:51:29 GMT</pubDate>  <item> <title>Coleslaw 0.9.2 and other lispiness</title> <link>http://blog.redlinernotes.com/posts/Coleslaw-092-and-other-lispiness.html</link> <pubDate>2013-05-11 20:41:00</pubDate> <author>Brit Butler</author> <guid isPermaLink="true">http://blog.redlinernotes.com/posts/Coleslaw-092-and-other-lispiness.html</guid>  <category><![CDATA[ #<TAG {C7DED01}> ]]></category>  <description><![CDATA[ 

<h2>Coleslaw 0.9.2</h2>

<p>It still amuses me that my most successful project to date is a blog engine. Not that I'm complaining about having contributors. When I <a href="http://blog.redlinernotes.com/posts/Lessons-from-Coleslaw.html" >last mentioned it</a>, version 0.8 had just been released. Since then there have been 2 new contributors and a bunch of new features. I think the code has mostly improved in cleanliness.</p>

<p>The biggest changes are new <a href="https://github.com/redline6561/coleslaw/tree/master/docs" >shiny docs</a>, a new tags implementation, cleanups to theming, and plugins for Google Analytics, Github Pages, and Sitemap Generation. For the full details, see the <a href="https://github.com/redline6561/coleslaw/tree/master/NEWS.md" >changelog</a>.</p>

<p>My plans for 1.0 are primarily to take advantage of the extensible content types added in 0.8 and add some sort of tumblr-like auto-embedding support. But I probably won't get around to working on that for a spell. Why?</p>

<h2>Other Lispiness</h2>

<p>Because my <a href="http://github.com/redline6561/famiclom" >lisp emulation experiment/art project</a> is ongoing. <a href="http://www.lisphacker.com/" >Nyef</a> was kind enough to share some code he'd hacked up for NES emulation years ago and it helped give me the motivation to rewrite famiclom's PPU (Graphics Card). The former code was largely cribbed from Patrick Walton's <a href="https://www.github.com/pcwalton/sprocketnes" >sprocketnes</a> and I didn't understand it very well. I've hit the <a href="http://wiki.nesdev.com/w/index.php/Nesdev_Wiki" >nesdev wiki</a> again and am getting more comfortable with the PPU's actual workings. The code is on github in the <code>new-ppu</code> branch and I'm hoping to spend more time on it this coming week.</p>

<p>I also spent the last week porting cl-6502 to clojurescript for giggles. Heresy, I know. ;) <br/>
<a href="https://github.com/redline6561/cljs-6502" >cljs-6502</a> is in a basic working state but there are bugs aplenty and I haven't implemented the assembler or disassembler. The must frustrating part was dealing with A) differences in macro hygiene and B) poor macro debugging facilities.</p>

<p>The browser is a fun target though. I'll have to try <a href="http://common-lisp.net/project/parenscript/" >parenscript</a> <em>or</em> ... <a href="https://github.com/davanzp/jscl" ><em>jscl</em></a>! JSCL is a full CL-&gt;JS compiler in early development, which I contributed a tiny patch to for <code>fboundp</code>. It's a great project and if you have any interest in helping implement a lisp, I'd encourage you to get involved. The maintainers are very approachable and there's plenty of fun hacking to be had.</p>

<p>All for now. It's time to play around trying static analysis of Nintendo ROMs with Lisp. I'm bound to learn something...hopefully.</p>
 ]]></description> </item>  <item> <title>So Close and Yet So Far</title> <link>http://blog.redlinernotes.com/posts/So-Close-and-Yet-So-Far.html</link> <pubDate>2013-03-16 12:22:00</pubDate> <author>Brit Butler</author> <guid isPermaLink="true">http://blog.redlinernotes.com/posts/So-Close-and-Yet-So-Far.html</guid>  <category><![CDATA[ #<TAG {C7E0B61}> ]]></category>  <description><![CDATA[ 

<p><img src="http://redlinernotes.com/images/famiclom_progress3.png"
     alt="Famiclom Progress" align="right" /></p>

<p><br/></p>

<blockquote>
<p>&quot;Low-level programming is good for the programmer's soul.&quot; - John Carmack, <a href="http://ahefner.livejournal.com/20528.html" >via ahefner</a></p>

<p><a href="http://compgroups.net/comp.lang.lisp/feeling-the-bits-between-your-toes/696643" >&quot;What I like about Lisp is that you can feel the bits between your toes.&quot;</a> - Drew McDermott, <a href="http://www.foldr.org/~michaelw/log/programming/lisp/icfp-contest-2006-vm" >via Michael Weber</a>
<br/></p>
</blockquote>

<p><br/></p>

<h2>Previously...</h2>

<p>I never did enough systems programming. In college, I actually convinced my Operating Systems professor to let me do the course project in lisp. So when I decided I wanted to get closer to the metal a year ago, I thought I'd look into Nintendo emulation with Common Lisp rather than systems hacking with C. Besides, my needs for a web server or other daemons were filled. So I embarked on that weird journey and came out with a shiny, readable, reasonably fast 6502 CPU emulator in under 800 lines of code. It even has an assembler and disassembler!</p>

<h2>Announcing Famiclom version least-positive-fixnum</h2>

<p>But a CPU emulator isn't much fun. No graphics, no sound, no I/O! After a break from September through January I got back to work in earnest a month ago. It started with getting Klaus Dorfmann's <a href="http://forum.6502.org/viewtopic.php?f=2&t=2241&sid=1e71a8a5f865ab8e503d081be7743dd4" >exhaustive correctness tests</a> for the CPU <a href="https://github.com/redline6561/cl-6502/commit/aa90f1ee4c638e3cf2e70ad8535ae0bcba9461c5" >added to my testsuite</a> and a lot of bugfixing. Then I used pcwalton's <a href="https://github.com/pcwalton/sprocketnes" >lovely Rust code</a> as inspiration and started getting the <a href="http://wiki.nesdev.com/w/index.php/Mapper" >memory mappers</a> and PPU (graphics) working with lispbuilder-sdl. So far we only support NROM mapped games though MMC1 should be coming soon(tm). As you can see at the top of the post, there are still some rendering bugs to work out. All testing so far has been done on CCL and SBCL on Linux.</p>

<h2>Current Status</h2>

<p>The good news is that the CPU, PPU, and <a href="http://github.com/redline6561/romreader" >.nes file reading</a> are all done in ~1570 lines of Lisp code! The CPU in particular I think makes for quite nice reading at this point. The <a href="http://github.com/redline6561/famiclom" >main NES code</a> still needs work. The bad news is that while the CPU runs at 2-3x the speed of the NES the graphics are about 15-20x <strong>slower</strong> so I'm going to have to spend some time optimizing. I'm in #lisp on freenode regularly and would love advice or patches from any low-level SBCL or lispbuilder-sdl hackers. :)</p>

<h2>Where to next?</h2>

<ol>
<li>Preliminary input handling is written, hook it into the main event loop.</li>
<li>Finish MMC1 loader. Get Mega Man 2 title screen loading at least.</li>
<li>Fix rendering bugs and try to play a few games.</li>
<li>Optimize and/or add audio support!</li>
</ol>
 ]]></description> </item>  <item> <title>Lessons from Coleslaw</title> <link>http://blog.redlinernotes.com/posts/Lessons-from-Coleslaw.html</link> <pubDate>2013-01-06 14:40:00</pubDate> <author>Brit Butler</author> <guid isPermaLink="true">http://blog.redlinernotes.com/posts/Lessons-from-Coleslaw.html</guid>  <category><![CDATA[ #<TAG {C7DF9F1}> ]]></category>  <description><![CDATA[ 

<p>Is there anything more pointless than a new blog engine? Probably not. 4 months ago, I wouldn't have thought that I would be distracted from my <a href="http://github.com/redline6561/cl-6502" >Lisp 6502 emulator</a> so long or that I'd have this much fun writing blogware. It is amazing, however, just how much you can do with a bit of time and ~600 lines of lisp.</p>

<p>Lately I've come to realize my favorite part of hobby programming is that I essentially treat it as creative writing. One of the reasons I love Lisp and find myself using it so much for hobby code is how easily it enables me to experiment with new coding styles. In <a href="http://github.com/redline6561/coleslaw" >Coleslaw</a>'s case, this has meant a stronger focus on CLOS and API design.</p>

<p>I like to think there's a clear stylistic shift in my projects, from the earlier and messy imperative of <a href="http://github.com/redline6561/paktahn" >Paktahn</a>, through the neat but overly macro-heavy <a href="http://github.com/redline6561/cl-scrobbler" >cl-scrobbler</a>, to the more balanced style of my present day code. It's no surprise that some of my favorite lisp luminaries, Peter Seibel and Luke Gorrie, talk a lot about <a href="http://lists.lugod.org/pipermail/vox/2011-June/008627.html" >code as literature</a> and <a href="http://blog.lukego.com/blog/2012/10/24/readable-programs/" >readable programs</a>. Hopefully, I will continue to progress in that tradition.</p>

<p>Coleslaw 0.8 is hereby released. The biggest features are multi-site publishing and support for new content types. Here is an example bookmark or tweet-like content type that may ship in a future release, <a href="http://paste.lisp.org/display/134453" >Shouts</a>. See the <a href="https://github.com/redline6561/coleslaw/blob/master/NEWS.md" >NEWS</a> for further details. It's time to get back to <a href="http://wiki.nesdev.com/w/index.php/Mapper" >Memory Mappers</a> for a bit and see if I can't get actual NES emulation going in pure Common Lisp. See you next time, Planet Lisp.</p>
 ]]></description> </item>  <item> <title>Now with even more Lisp!</title> <link>http://blog.redlinernotes.com/posts/Now-with-even-more-Lisp.html</link> <pubDate>2012-09-19 20:47:00</pubDate> <author>Brit Butler</author> <guid isPermaLink="true">http://blog.redlinernotes.com/posts/Now-with-even-more-Lisp.html</guid>  <category><![CDATA[ #<TAG {C7DED31}> ]]></category>  <description><![CDATA[ 

<p>I haven't finished my <a href="https://github.com/redline6561/famiclom" >headless NES emulator</a> in time for <a href="http://thestrangeloop.com/" >Strange Loop</a>. On the other hand, I have done some cool things that I didn't anticipate. Here's what's been going on in hackland lately:</p>

<h2><a href="https://github.com/redline6561/coleslaw" >Coleslaw</a>: Heroku &amp; Plugins</h2>

<p>The majority of my efforts have been related to my new blogging engine, Coleslaw. I've substantially cleaned up the rendering pass, added optional RSS feeds for specific tags, revamped the plugin architecture, and added a plugin for <a href="http://www.disqus.com/" >Disqus</a> support. Jose Pereira also wrote a <a href="https://github.com/jsmpereira/coleslaw-heroku" >heroku buildpack</a> for running Coleslaw so if you feel like having a simple managed install, problem solved!</p>

<p>While docs are still needed, here is a rough overview of the plugin architecture. I'll add a simple, hello-world-ish example to the README shortly.</p>

<ul>
<li><p>Plugins are lisp files placed in coleslaw's <code>plugins</code> directory.</p></li>
<li><p>Each plugin should define a package <code>:coleslaw-$filename</code> where $filename is the name, excluding extension, of the plugin.</p></li>
<li><p>The package should export a function named <code>enable</code> that can be called to activate the plugin.</p></li>
<li><code>enable</code> is mostly useful for adding Javascript to the page via <code>add-injection</code> or passing initialization args elsewhere.

<ul>
<li><code>add-injection</code> takes a cons like <code>(js-string predicate)</code> and a location (<code>:head</code> or <code>:tail</code>) to insert it.</li>
<li>The predicate should take a single content object as argument. A content object can be either a POST or an INDEX.</li>
<li>The predicate will be called at render time and a non-nil return value will cause the injection to be included in the page.</li>
</ul></li>
<li><p>Plugins can also extend <code>render-content</code> to support new post formats such as ReStructuredText or modify <code>deploy</code> with <code>:before</code>, <code>:after</code>, or <code>:around</code> methods to support deployment to S3, serving via Hunchentoot, etc.</p></li>
<li>End users take advantage of plugins by enabling them in their .coleslawrc's :plugins list.

<ul>
<li>A plugin given as a symbol will call <code>enable</code> with no args whereas a plugin given as a list will call <code>enable</code> with the args after the plugin's name.</li>
</ul></li>
</ul>

<h2><a href="https://github.com/redline6561/colorize/" >Colorize</a> Reborn</h2>

<p>I am pleased to announce I've taken over as maintainer of colorize. It provides the syntax highlighting in Coleslaw's <a href="https://github.com/3b/3bmd" >3bmd</a> markdown mode. I've backported patches from lisppaste to colorize for Haskell, Erlang, Python, and a number of other languages. I also added very rudimentary support for Clojure highlighting. While I'm interested in seeing further language support (particularly Clojure and <a href="http://rust-lang.org/" >Rust</a>) I lack the time to work on further coloring modes myself. If you have any inclination to hack on colorize to add support for new languages or otherwise improve it please feel free to contact me. I'm more than happy to review and merge pull requests. :)</p>

<h2><a href="http://redlinernotes.com/docs/talks/wtdm.html" >Wanting Types, Demanding Mirrors</a></h2>

<p>I delivered a final Lunch and Learn at CMGdigital on Dynamic Systems. I have a screencast of it like <a href="http://vimeo.com/redline6561/on-programmer-archaeology" >my last talk</a> but I haven't uploaded it yet. I'm a bit more out of my depth this time and am still considering tweaking the content and rerecording. The slides are linked above though and I would welcome comments. I'm also working on a Magic the Gathering tutorial/unsession for Strange Loop and an Emacs Crash Course for my new coworkers at Primedia. Finally, I'm giving a talk on the internals of cl-6502 to the <a href="http://www.meetup.com/Atlanta-Lisp-User-Group/events/76874632/" >Atlanta Lisp User Group</a> on October 1st.</p>

<h2><a href="https://github.com/vsedach/Vacietis" >Vacietis</a> and <a href="https://github.com/rolando2424/trivial-dump-core" >trivial-dump-core</a></h2>

<p>Vladimir Sedach has been working on a C to Common Lisp compiler called Vacietis for a while now. It's become mature enough to generate Lisp executables for small C programs. However, dumping executables isn't a portable CL feature so I contributed a minor pull request to use trivial-dump-core to improve portability from ccl to clisp, sbcl, and ccl. I hope trivial-dump-core sees more use and gains support for more implementations as portable executable creation would be a nice thing to have.</p>
 ]]></description> </item>  <item> <title>Swanky Developments</title> <link>http://blog.redlinernotes.com/posts/Swanky-Developments.html</link> <pubDate>2012-09-04 13:22:05</pubDate> <author>Brit Butler</author> <guid isPermaLink="true">http://blog.redlinernotes.com/posts/Swanky-Developments.html</guid>  <category><![CDATA[ #<TAG {C7E0E31}> ]]></category>  <category><![CDATA[ #<TAG {C7E0E41}> ]]></category>  <description><![CDATA[ 

<p>Now that the i's have been dotted and the t's crossed I'm pleased to announce I've accepted a new job. Starting September 17th, I'll be a Senior Developer working for Primedia. I'll be helping them migrate from ruby to clojure. I've been meaning to spend more time hacking Clojure as it is. I'm particularly delighted that I'll be in something of a teaching role and able to share my knowledge and experience with lisp with interested hackers.</p>

<p>CMGdigital has been a phenomenal place to work for the last year and I'll miss everyone there dearly. I wasn't looking for a new job but Primedia found me and this was in many ways the right opportunity at the right time.</p>

<p>I'm also very excited for the arrival of Leiningen 2.0 and happily running the latest preview. After using quicklisp, I disliked having to setup a mock project to experiment with arbitrary libraries in Clojure. Leiningen 2 uses a library called pomegranate under the covers which allows modifying the REPL classpath. Thus, dependencies can be <a href="http://sunng.info/blog/2012/03/my-favorite-feature-in-leiningen-2/" >easily added to a running REPL</a> and experimented with!</p>

<p>In other lispy news, the dream of endless swank backends and SLIME on everything has died. <a href="http://redlinernotes.com/images/slime-on-everything.png" >Previously</a>, I had coerced SLIME into running Clojure, Scheme, and Common Lisp simultaneously and <a href="https://github.com/redline6561/dotemacs/commit/78581e7027284605d2aa77ccaf0df1265ccd8db8#L0L65" >knowing which filetypes to associate with which repls</a>. It took <em>a lot</em> of fiddling. I actually had a rant against the proliferation of swank backends for other languages like Chicken Scheme and Clojure happening outside the main SLIME tree. Anyway, between Emacs 24 shipping <a href="https://github.com/redline6561/dotemacs/blob/master/init/packages.el#L1" >package.el</a>, <a href="http://marmalade-repo.org/" >marmalade</a>, <a href="https://github.com/kingtim/nrepl.el" >nrepl.el</a> for Clojure, and <a href="http://geiser.nongnu.org/" >Geiser</a> for scheme, the situation has resolved itself even if the infinite SLIME dream is dead. And ultimately, that's better for hackers everywhere...so who am I to complain? :)</p>
 ]]></description> </item>  <item> <title>Coleslaw Lives!</title> <link>http://blog.redlinernotes.com/posts/Coleslaw-Lives.html</link> <pubDate>2012-08-26 12:42:00</pubDate> <author>Brit Butler</author> <guid isPermaLink="true">http://blog.redlinernotes.com/posts/Coleslaw-Lives.html</guid>  <category><![CDATA[ #<TAG {C7DED11}> ]]></category>  <category><![CDATA[ #<TAG {C7DED21}> ]]></category>  <description><![CDATA[ 

<h3>New Beginnings</h3>

<p>So, Coleslaw is alive (you're looking at it) and I've done a clean reinstall on my server for the first time since 2008 or so. Thank GOD.</p>

<p>With any luck, I'll get back to hacking emulators now. :) But first... a test of some features! I should really overhaul the README for <a href="http://github.com/redline6561/coleslaw" >coleslaw</a> too.</p>

<pre><code><span class="code"><span class="comment">;; God do I love being able to write this post in emacs. And commit and push to publish.
</span><span class="paren1">(<span class="code"><i><span class="symbol">defun</span></i> slug-char-p <span class="paren2">(<span class="code">char</span>)</span>
  <span class="string">"Determine if CHAR is a valid slug (i.e. URL) character."</span>
  <span class="paren2">(<span class="code">or <span class="paren3">(<span class="code">char&lt;= <span class="character">#\0</span> char <span class="character">#\9</span></span>)</span>
      <span class="paren3">(<span class="code">char&lt;= <span class="character">#\a</span> char <span class="character">#\z</span></span>)</span>
      <span class="paren3">(<span class="code">char&lt;= <span class="character">#\A</span> char <span class="character">#\Z</span></span>)</span>
      <span class="paren3">(<span class="code">member char '<span class="paren4">(<span class="code"><span class="character">#\_</span> <span class="character">#\-</span> <span class="character">#\.</span></span>)</span></span>)</span></span>)</span></span>)</span>

<span class="paren1">(<span class="code"><i><span class="symbol">defun</span></i> slugify <span class="paren2">(<span class="code">string</span>)</span>
  <span class="string">"Return a version of STRING suitable for use as a URL."</span>
  <span class="paren2">(<span class="code">remove-if-not #'slug-char-p <span class="paren3">(<span class="code">substitute <span class="character">#\-</span> <span class="character">#\Space</span> string</span>)</span></span>)</span></span>)</span></span></code></pre>

<h3>A LaTeX/mathjax test...</h3>

<p>$$
\lambda \scriptstyle{f}. (\lambda x. (\scriptstyle{f} (x x)) \lambda x. (\scriptstyle{f} (x x)))
$$</p>
 ]]></description> </item>  </channel> </rss>
