<?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"
	>

<channel>
	<title>Ventonegro</title>
	<atom:link href="http://www.ventonegro.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ventonegro.org</link>
	<description>Geek random ramblings</description>
	<pubDate>Wed, 27 Aug 2008 18:13:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Not luck</title>
		<link>http://www.ventonegro.org/2008/08/not-luck/</link>
		<comments>http://www.ventonegro.org/2008/08/not-luck/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 18:13:43 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Career]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=27</guid>
		<description><![CDATA[ There is a recurrent angst I feel every time I think I could be working daily in a decent programming language. Usually the management people believe the choice of programming language is irrelevant, but we developers know better. Languages shape our thoughts. 
 Today I found an interesting post about getting work using non-mainstream [...]]]></description>
			<content:encoded><![CDATA[<p> There is a recurrent angst I feel every time I think I could be working daily in a decent programming language. Usually the <em>management</em> people believe the choice of programming language is irrelevant, but we developers know better. <a href="http://en.wikipedia.org/wiki/Sapir%E2%80%93Whorf_hypothesis" title="Sapir-Whorf hypothesis">Languages shape our thoughts</a>. </p>
<p> Today I found <a href="http://logicaltypes.blogspot.com/2008/08/lucky-you.html" title="Luck you!">an interesting post</a> about getting work using non-mainstream languages. </p>
<blockquote><p> Well, unlike Java jobs or C# jobs or VB jobs, where one can scan the newspaper or go to dice.com, these magical jobs are not the ones I get when recruiters solicit me (three times a day). No, they appear between the cracks of the sky when it rends in two. All but one contract (that did come from dice.com) came from the company CEO pulling me aside or phoning me out of the blue from the materials I had published inside the company where I was employed, or from my web-sites on programming languages. </p>
</blockquote>
<p> This basically means you must be a reference. You must blog a lot or, better yet, write even a book. When your name is said in a company meeting, somebody of the team <strong>must already have heard of you</strong>. Needless to say, this is not easy at all. </p>
<blockquote><p> Usually and because of the exclusivity of the work it takes anywhere from at least 3 months to 2 years to secure these kinds of contracts, so the adage &#8220;Don&#8217;t quit your day job&#8221; is an appropriate one here. When I do get these contracts, however, they usually last longer (3 years) than the Java/C++/XML/web-services-code-grinder ones (that usually last around 6 months), and the peer group is much more intelligent, genteel and just plain more interesting than the code-grinding crowd. Is is harder to find these magical contracts? Yes, they are rarified air. But are they worth preparing for and then finding? Definitely. </p>
</blockquote>
<p>Here we see that even after all this work, it is still <em>very hard</em> to find these dream jobs. You can wait as long as two years to get one, simply because in most companies the management employ Java/C#/VB drones anyway, as they are cheaper and easier to find. Only when they face <em>really hard</em> problems they start thinking of alternatives. </p>
<p>This post only reinforces what was already in the back of my mind for a while: The least hard way to earn money and be happy at the same time is to start an own business. Now if I could only move my lazy ass&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/08/not-luck/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Misuse of technology, XML case</title>
		<link>http://www.ventonegro.org/2008/07/misuse-of-technology-xml-case/</link>
		<comments>http://www.ventonegro.org/2008/07/misuse-of-technology-xml-case/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 19:16:48 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=16</guid>
		<description><![CDATA[I do not have strong feelings about XML, be it for or against it. I don&#8217;t use it much because I use either S-Expressions with Scheme or Lua tables with Lua. I believe XML can be helpful, but people need to know how to use it.
I have come across an application of XML to store [...]]]></description>
			<content:encoded><![CDATA[<p>I do not have strong feelings about XML, be it for or against it. I don&#8217;t use it much because I use either <a href="http://en.wikipedia.org/wiki/S-expressions" title="S-Expressions">S-Expressions</a> with Scheme or <a href="http://www.lua.org/manual/5.1/manual.html#2.5.7" title="Table Constructors">Lua tables</a> with Lua. I believe XML can be helpful, but people need to know <em>how</em> to use it.</p>
<p>I have come across an application of XML to store an animation, frame by frame, like the animated GIFs of old. Each frame is then an image, stored as an XML element. The bizarre part is that every pixel is stored as an individual element inside the frame:</p>
<pre>
&lt;frame id="Frame001" width="180" height="240"&gt;
  &lt;array type="Int8"&gt;
    &lt;Int8 value="230"/&gt;
    &lt;Int8 value="012"/&gt;
    .
    .
    .
  &lt;/array&gt;
&lt;/frame&gt;
</pre>
<p>I believe this is the most &#8220;by the book&#8221; implementation. But this is far from optimal. When inspecting the files with a text editor (yes, I needed to do that) it was very painful. Besides, the files are huge! Why not be sensible and use <a href="http://en.wikipedia.org/wiki/Base64" title="Base64">Base64</a> encoding for the image part:</p>
<pre>
&lt;frame id="Frame001" width="180" height="240"&gt;
  TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz
  IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg
  dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu
  dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo
  .
  .
  .
&lt;/frame&gt;
</pre>
<p>Nobody could inspect the information of previous format anyway, the files gets much smaller, one could edit them by hand (like I did to copy frames between animations). And no, the files are not being compressed because they are part of a build process.</p>
<p>It only remains to be seen why it is done this way. I believe it was a mixture of a non-too-intimate knowledge of the technology and a desire to use it in it &#8220;purest&#8221; form, like those people who <em>must</em> design their programs with all the design patterns known to man. With time they may learn that a sensible dose of pragmatism is very healthy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/07/misuse-of-technology-xml-case/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The 2008 Brazilian Symposium on Programming Languages</title>
		<link>http://www.ventonegro.org/2008/07/the-2008-brazilian-symposium-on-programming-languages/</link>
		<comments>http://www.ventonegro.org/2008/07/the-2008-brazilian-symposium-on-programming-languages/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 14:52:47 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[brazil]]></category>

		<category><![CDATA[programming languages]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=15</guid>
		<description><![CDATA[The XII Brazilian Symposium on Programming Languages is going to be happen in my home city of Fortaleza, on August 27th-29th. The programme looks very promising, with sessions about Software Transaction Memory in Haskell, concurrency with Lua (with the main architect of Lua, Roberto Ierusalimschy from PUC-Rio) and an invited talk of Shriram Krishnamurthi, the [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.lia.ufc.br/sblp2008/" title="XII Brazilian Symposium on Programming Languages">XII Brazilian Symposium on Programming Languages</a> is going to be happen in my home city of Fortaleza, on August 27th-29th. The <a href="http://www.lia.ufc.br/sblp2008/index.php/programme" title="Programme">programme</a> looks very promising, with sessions about <a href="http://en.wikipedia.org/wiki/Software_Transaction_Memory" title="Software Transaction Memory">Software Transaction Memory</a> in Haskell, concurrency with Lua (with the main architect of Lua, Roberto Ierusalimschy from PUC-Rio) and an invited talk of Shriram Krishnamurthi, the author of <a href="http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/" title="Programming Languages: Application and Interpretation">Programming Languages: Application and Interpretation</a>, among other interesting stuff. I hope to be there, I even get to see my family and my friends. <img src='http://www.ventonegro.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/07/the-2008-brazilian-symposium-on-programming-languages/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bibliography of Programming Languages Implementation</title>
		<link>http://www.ventonegro.org/2008/07/bibliography-of-programming-languages-implementation/</link>
		<comments>http://www.ventonegro.org/2008/07/bibliography-of-programming-languages-implementation/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 14:54:56 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=14</guid>
		<description><![CDATA[Doing some research about compilers, interpreters and virtual machines, I have gathered some bibliography from several resources. Here it is, in no particular order:

Essentials of Programming Languages, by Daniel P. Friedman, Mitchell Wand and Christopher T. Haynes
Programming Language Pragmatics, by Michael L. Scott
Smalltalk-80: The Language and Its Implementation, by Adele Goldberg and David Robson
Writing Compilers [...]]]></description>
			<content:encoded><![CDATA[<p>Doing some research about compilers, interpreters and virtual machines, I have gathered some bibliography from several resources. Here it is, in no particular order:</p>
<ul>
<li><a href="http://www.cs.indiana.edu/eopl/" title="Essentials of Programming Languages">Essentials of Programming Languages</a>, by <a href="http://www.cs.indiana.edu/hyplan/dfried.html" title="Daniel P. Friedman">Daniel P. Friedman</a>, <a href="http://www.ccs.neu.edu/home/wand" title="Mitchell Wand">Mitchell Wand</a> and <a href="http://www.cs.indiana.edu/hyplan/chaynes.html" title="Christopher T. Haynes">Christopher T. Haynes</a></li>
<li><a href="http://www.cs.rochester.edu/~scott/pragmatics/" title="Programming Language Pragmatics">Programming Language Pragmatics</a>, by Michael L. Scott</li>
<li><a href="http://users.ipa.net/~dwighth/smalltalk/bluebook/bluebook_imp_toc.html" title="Smalltalk-80: The Language and Its Implementation">Smalltalk-80: The Language and Its Implementation</a>, by Adele Goldberg and David Robson</li>
<li><a href="http://portal.acm.org/citation.cfm?coll=GUIDE&#038;dl=GUIDE&#038;id=525376" title="Writing Compilers and Interpreters: An Applied Approach Using C++">Writing Compilers and Interpreters: An Applied Approach Using C++</a>, by <a href="http://portal.acm.org/author_page.cfm?id=81100175907&#038;coll=GUIDE&#038;dl=GUIDE&#038;trk=0&#038;CFID=35005474&#038;CFTOKEN=42269298" title="Ronald L. Mak">Ronald L. Mak</a></li>
<li><a href="http://www.cs.princeton.edu/~appel/modern/ml/" title="Modern Compiler Implementation in ML">Modern Compiler Implementation in ML</a>, by <a href="http://www.cs.princeton.edu/~appel" title="Andrew W. Appel">Andrew W. Appel</a></li>
<li><a href="http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html" title="Lisp in Small Pieces">Lisp in Small Pieces</a>, by <a href="http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/Queinnec.html" title="Christian Queinnec">Christian Queinnec</a></li>
<li><a href="http://lambda-the-ultimate.org/node/1752" title="An Incremental Approach to Compiler Construction">An Incremental Approach to Compiler Construction</a>, by Abdulaziz Ghuloum</li>
<li><a href="http://compilers.iecc.com/crenshaw/" title="Let's Build a Compiler">Let&#8217;s Build a Compiler</a>, by Jack Crenshaw</li>
<li><a href="http://mitpress.mit.edu/sicp/" title="Structure and Interpretation of Computer Programs">Structure and Interpretation of Computer Programs</a>, by Harold Abelson and Gerald Jay Sussman, with Julie Sussman</li>
<li><a href="http://www.elsevier.com/wps/find/bookdescription.cws_home/677874/description#description" title="Advanced Compiler Design and Implementation">Advanced Compiler Design and Implementation</a>, by Steven Muchnick</li>
<li><a href="http://www.iro.umontreal.ca/~boucherd/mslug/meetings/20041020/minutes-en.html" title="The 90 Minute Scheme to C compiler">The 90 Minute Scheme to C compiler</a>, by Marc Feeley</li>
<li><a href="http://dragonbook.stanford.edu/" title="Compilers: Principles, Techniques, and Tools">Compilers: Principles, Techniques, and Tools</a>, by Aho, Lam, Sethi and Ulman (the &#8220;Dragon Book&#8221;)</li>
<li><a href="http://www.elsevierdirect.com/product.jsp?isbn=155860698x&#038;" title="Engineering a Compiler">Engineering a Compiler</a>, by Keith Cooper and Linda Torczon</li>
<li><a href="http://www.reddit.com/info/63hth/comments/c02pxbp" title="Mike Pall's guide to the Lua source code">Mike Pall&#8217;s guide to the Lua source code</a></li>
<li><a href="http://liinwww.ira.uka.de/csbib/Compiler/Inst.Computersprachen.TUWien?query=Ertl&#038;partial=off&#038;case=on&#038;maxnum=200&#038;sort=year" title="Anton Ertl's papers">Anton Ertl&#8217;s papers</a></li>
<li><a href="https://www.cs.tcd.ie/David.Gregg/pubs.html" title="David Gregg's papers">David Gregg&#8217;s papers</a></li>
<li><a href="http://www.ics.uci.edu/%7Efranz/Site/publications.html" title="Michael Franz's papers">Michael Franz&#8217;s papers</a></li>
<li><a href="http://www.cs.kent.ac.uk/people/staff/rej/gcbook/gcbook.html" title="Garbage Collection: Algorithms for Automatic Dynamic Memory Management">Garbage Collection: Algorithms for Automatic Dynamic Memory Management</a>, by <a href="http://www.cs.kent.ac.uk/people/staff/rej/" title="Richard Jones">Richard Jones</a> and Rafael D Lins</li>
<li><a href="http://www.norvig.com/paip.html" title="Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp">Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp</a>, by <a href="http://www.norvig.com/index.html" title="Peter Norvig">Peter Norvig</a></li>
<li><a href="http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-453.pdf" title="The Art of the Interpreter of, the Modularity Complex (Parts Zero, One, and Two)">The Art of the Interpreter of, the Modularity Complex (Parts Zero, One, and Two)</a>, by Guy Lewis Steele, Jr. and Gerald Jay Sussman</li>
<li><a href="http://library.readscheme.org/page8.html" title="Compiler section on readscheme.org">Compiler section on readscheme.org</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/07/bibliography-of-programming-languages-implementation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Kent Pitman, again</title>
		<link>http://www.ventonegro.org/2008/06/kent-pitman-again/</link>
		<comments>http://www.ventonegro.org/2008/06/kent-pitman-again/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 11:40:44 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Lisp]]></category>

		<category><![CDATA[quote]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=13</guid>
		<description><![CDATA[And anyway, the subject line presupposes that Lisp has not caught on. This is like saying that astrophysics or calculus or brain surgery has not caught on because in relative numbers, there might be more people doing other things.  The success of Lisp is not measured in the number of people using it, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://groups.google.com/group/comp.lang.lisp/msg/5dcbcadf292ce34a?hl=en"><p>And anyway, the subject line presupposes that Lisp has not caught on. This is like saying that astrophysics or calculus or brain surgery has not caught on because in relative numbers, there might be more people doing other things.  The success of Lisp is not measured in the number of people using it, it&#8217;s measured in the utility to those people who do use it.  Turning it into C (or C++ or C#) to make it more popular would not be success.  In the world&#8217;s menu of computer language options, we don&#8217;t need them all to be Taco Bell.</p></blockquote>
<div style="text-align:right;font-size:8pt;">&mdash;&nbsp;<cite><a href="http://groups.google.com/group/comp.lang.lisp/msg/5dcbcadf292ce34a?hl=en">Kent Pitman</a></cite>.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/06/kent-pitman-again/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Poster of programming paradigms</title>
		<link>http://www.ventonegro.org/2008/06/poster-of-programming-paradigms/</link>
		<comments>http://www.ventonegro.org/2008/06/poster-of-programming-paradigms/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 13:10:41 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=12</guid>
		<description><![CDATA[Browsing the web today I found an interesting poster about programming paradigms. Interestingly, it puts Java right there with OCaml in the state + closures section, and Java does not have closures. But since there is no OOP in the poster, I assume the author is equaling closures to objects, which according to some is [...]]]></description>
			<content:encoded><![CDATA[<p>Browsing the web today I found an interesting <a href="http://www.info.ucl.ac.be/~pvr/paradigmsDIAGRAMeng107.pdf" title="The Principal Programming Paradigms">poster about programming paradigms</a>. Interestingly, it puts Java right there with OCaml in the state + closures section, and Java <a href="http://javac.info/" title="Closures for the Java Programming Language">does not have closures</a>. But since there is no OOP in the poster, I assume the author is equaling closures to objects, which according to some <a href="http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html" title="RE: What's so cool about Scheme?">is very wise</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/06/poster-of-programming-paradigms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Toy Scheme interpreter in Lua</title>
		<link>http://www.ventonegro.org/2008/06/toy-scheme-interpreter-in-lua/</link>
		<comments>http://www.ventonegro.org/2008/06/toy-scheme-interpreter-in-lua/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 22:20:37 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Lisp]]></category>

		<category><![CDATA[Lua]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[interpreter]]></category>

		<category><![CDATA[scheme]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=11</guid>
		<description><![CDATA[As part of my Lisp studies, I have implemented a toy Scheme interpreter in roughly 1000 lines of Lua. It is here. It supports tail-call optimisation, lexical scope for closures, and first-class continuations via call/cc.
I have departed from the traditional approach of implementing a Scheme interpreter in Scheme itself because I wanted to avoid possible [...]]]></description>
			<content:encoded><![CDATA[<p>As part of my Lisp studies, I have implemented a toy Scheme interpreter in roughly 1000 lines of <a href="http://www.lua.org/" title="Lua">Lua</a>. It is <a href="http://www.ventonegro.org/files/" title="ventonegro.org files">here</a>. It supports <a href="http://en.wikipedia.org/wiki/Tail_recursion">tail-call optimisation</a>, lexical scope for closures, and first-class <a href="http://en.wikipedia.org/wiki/Continuation">continuations</a> via <tt>call/cc</tt>.</p>
<p>I have departed from the traditional approach of implementing a Scheme interpreter in Scheme itself because I wanted to avoid possible confusions between the defined language and the defining language. This has made a lot of the concepts clearer. The evaluator is written in <a href="http://en.wikipedia.org/wiki/Continuation_passing_style">continuation-passing style</a>, which is easily done in Lua because the latter has tail-call optimisations. This way it is easier to reify continuations to first-class values.</p>
<p>I have also added a few primitives to allow me to run some examples, as the factorial and fibonacci functions. More primitives can be easily added if desired.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/06/toy-scheme-interpreter-in-lua/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Does the World need another Scheme system?</title>
		<link>http://www.ventonegro.org/2008/05/does-the-world-need-another-scheme-system/</link>
		<comments>http://www.ventonegro.org/2008/05/does-the-world-need-another-scheme-system/#comments</comments>
		<pubDate>Wed, 21 May 2008 19:27:32 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Lisp]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[compiler]]></category>

		<category><![CDATA[scheme]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=9</guid>
		<description><![CDATA[I am currently reading the third chapter of Lisp in Small Pieces. It is really a wonderful book. By teaching how to implement Lisp, it teaches a lot about using the language too. Moreover, reading it sometimes I feel the urge that almost every Schemer has at one time or another felt: The urge to [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently reading the third chapter of <a href="http://www.amazon.com/gp/product/0521545668/ref=s9qpick_c2_at3-2871_p?pf_rd_m=ATVPDKIKX0DER&#038;pf_rd_s=center-&#038;pf_rd_r=0E22QSHYB0WW14SABE40&#038;pf_rd_t=101&#038;pf_rd_p=278247301&#038;pf_rd_i=507846" title="Lisp in Small Pieces">Lisp in Small Pieces</a>. It is really a wonderful book. By teaching how to implement Lisp, it teaches a lot about using the language too. Moreover, reading it sometimes I feel the urge that almost every Schemer has at one time or another felt: The urge to write his own Scheme system.</p>
<p>Ok, I know the World is already sick of Schemes, it only takes a look at this <a href="http://community.schemewiki.org/?scheme-faq-standards#implementations" title="What Scheme implementations are there?">list</a> to know why. But I still think I have to do it, if only for my personal learning. There is no need to bore the World to death with another half-done Scheme. Sometimes I think about features that could make my Scheme useful, though. They are probably never going to be implemented, but here they are:<br />
<h3>Full R5RS compliance</h3>
<p>The R5RS is a piece of art (R6RS, on the other hand, is a stain, a mess). Of course it does not describe a terribly useful system, but it beautifully describes the <strong>core</strong> of one. Everything else can then come from there. For more compliance with other systems, the SRFIs can be used as the basis for a standard library.</p>
<h3>Bytecode virtual machine</h3>
<p>Although Scheme is a dynamic language, there is a <em>lot</em> that can be known about the program before executing it. Lexical variables, never assigned variables, closure and continuation creation etc. This can be processed at compile time, allowing for a simple and fast virtual machine. Interpreting the source code directly is easier but very inefficient for any serious system.<br />
<h3>Incremental garbage collection</h3>
<p>Stop-and-go garbage collectors are easier to implement, but in some applications the pause is inacceptable. For applications like interactive games, the smooth user experience only can be achieved by an incremental garbage collector. It would be nice if it was a moving collector too, to avoid too much fragmentation of the heap (some naive C programmers think the use of <tt>malloc</tt> and <tt>free</tt> can beat a garbage collector in any circustances, until they are hit in the face by heap fragmentation. There is a reason the Apache web server uses memory pools). If I remember correctly the CLR garbage collector is very good and compacts the memory without the use of from- and to-spaces, which is cool, because uses less heap memory. Hmm, while I am dreaming about my ideal garbage collector, make it concurrent too (see below).</p>
<h3>Concurrency</h3>
<p>These days the hot topic is concurrency. New personal computers with two and four cores sell more and more every day. The programming languages/environments that makes easy for the programmer to use these new cores are going to be big. <a href="http://www.erlang.org/" title="Erlang">Erlang</a> is the hottest thing right now in this regard, although <a href="http://www.haskell.org/" title="Haskell">Haskell</a> is a strong candidate too. In the mainstream Java has a concurrent VM, but Java uses the old lock/unlock paradigm of other mainstream languages, <a href="http://clojure.sourceforge.net/" title="Clojure">Clojure</a> is the new language on top of the JVM that leverage that power for the programmer. But although this is all so hot, the only thing that seems to be happening to Scheme is <a href="http://toute.ca/" title="Termite">Termite</a>, which as far as I know can only use green threads. My hypotetical Scheme would have a concurrent VM, <a href="http://www.ventonegro.org/2008/05/concurrent-scheme/" title="Concurrent Scheme">some Scheme compilation techniques</a> already give a start in that direction. There would be maybe a <tt>spawn-continuation</tt> form that would take a continuation captured with <tt>call/cc</tt> and resume it in parallel with the current one, in a M:N model (M continuations spread on N OS threads).</p>
<h3>Just-in-time compilation</h3>
<p>Well, once dreaming, why not go all the way? One of the nice things about Scheme is the bottom-up, incremental development. Developing at the REPL gives instant feedback and ease debugging. What if it could give the speed of compiled-to-CPU languages as well? Another advantage is hot-swapping code in a running application. This can&#8217;t be done with Chicken or Gambit, which are fast, but Scheme-to-C compilers. Larceny, Chez and Ikarus can do this. By using a bytecode VM, the system is portable to wherever there is a C compiler, and by adding JIT support for some architectures it can be made fast too.</p>
<h3>Escape continuations</h3>
<p>Full, first-class continuations with indefinite extent are a powerful and mind-bending feature, but unfortunately, are usually hard to implement and causes pauses when invoked. Besides them, my hypotetical Scheme would have escape continuations. Instead of completely overwriting the execution stack, they simply unwind it until some recorded point, which can be made very fast. Exceptions would them be implemented as escape continuations rather than full ones.</p>
<h3>Easy FFI</h3>
<p>I am a long-time <a href="http://www.lua.org/" title="Lua">Lua</a> user, and it is amazing how they could get the C API so good. Not only it is very easy to add new C/C++ libraries to Lua, it is trivial to embed the Lua interpreter itself in a legacy application, or an application that needs to be mostly in C/C++, such as games. As Scheme, unfortunately, is not one of the World&#8217;s favorite languages, the capacity to talk to the outside World is fundamental. And by being embeddable (which is the goal of Guile, but it sucks for Windows), it would be easier to take Scheme to another domains where it is not so popular today.</p>
<p>Well, I guess this is it. Thinking about it, there seems to be no Scheme system today with all these features. Will I have the skills to write something like this after LiSP? I doubt it, only the garbage collector would take me ages. But it would be nice if such thing existed&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/05/does-the-world-need-another-scheme-system/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Concurrent Scheme</title>
		<link>http://www.ventonegro.org/2008/05/concurrent-scheme/</link>
		<comments>http://www.ventonegro.org/2008/05/concurrent-scheme/#comments</comments>
		<pubDate>Thu, 08 May 2008 20:28:17 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Lisp]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[concurrency]]></category>

		<category><![CDATA[scheme]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=8</guid>
		<description><![CDATA[While I wait for my 1-hour mobile phone software compilation to finish I decided to drop a quick post about something that has been on my mind lately. In his nice PhD thesis (that I had to read five times to finally understand it), Dybvig (the implementor of Chez Scheme) shows a compiler that rewards [...]]]></description>
			<content:encoded><![CDATA[<p>While I wait for my 1-hour mobile phone software compilation to finish I decided to drop a quick post about something that has been on my mind lately. In his nice <a href="http://www.cs.indiana.edu/~dyb/papers/3imp.pdf" title="Three Implementation Models for Scheme">PhD thesis</a> (that I had to read five times to finally understand it), Dybvig (the implementor of <a href="http://www.scheme.com/" title="Chez Scheme">Chez Scheme</a>) shows a compiler that rewards the pure functional use of the Scheme language. The compiler scans for free variables in <tt>lambda</tt> forms and, when creating the respective closures, put the <em>values</em> of the variables directly in the closure activation frame. The references to the free variables in the closure are then changed to references to the stack locations. Accessing the variables is then pretty fast. Besides, when a first-class continuation is created, it suffices to blindingly copy the execution stack because all closures will carry their free variables with them. Assignment is then added at a later section of the thesis. To support it the compiler scans the code for <tt>set!</tt> forms, gathering the variables that are ever assigned, and compiling them to indirections to heap memory. When a continuation is created the indirection box is copied, not the actual variable, which lives in the heap. So access to assigned variables is much slower.</p>
<p>Although the focus of Dybvig&#8217;s thesis is not on concurrency, I cannot help but think that his compiler could work very well for this too with just minor modifications. If variables (local or free) are never assigned, they could be replaced by their values and several different threads with different execution stacks could run in parallel. If a variable is assigned, the access to its indirection box could be protected by a mutex or similar synchronisation primitive. Of course this would make access to assigned variables even slower, because even variables ever used by only one single thread would need mutex lock/unlock operations. On the other hand, isn&#8217;t assignment discouraged in Scheme? The overall execution time would compensate for this, if the rest of the program was parallelised.</p>
<p>But surely I am missing something, because no one ever seems to think Scheme can be a contender in the massive-parallelised future. What bugs me is that I don&#8217;t know what it is that I am not taking in consideration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/05/concurrent-scheme/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Emacs client</title>
		<link>http://www.ventonegro.org/2008/04/the-emacs-client/</link>
		<comments>http://www.ventonegro.org/2008/04/the-emacs-client/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 20:14:34 +0000</pubDate>
		<dc:creator>ventonegro</dc:creator>
		
		<category><![CDATA[Emacs]]></category>

		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.ventonegro.org/?p=6</guid>
		<description><![CDATA[I know that for most Emacs users out there this is not worth writing about, but I have been using Emacs for less than two years and I cannot help hiding my awe everytime I discover something like this. This time is the emacsclient program.
Unfortunately at work I am stuck with Windows. I am a [...]]]></description>
			<content:encoded><![CDATA[<p>I know that for most Emacs users out there this is not worth writing about, but I have been using Emacs for less than two years and I cannot help hiding my awe everytime I discover something like this. This time is the emacsclient program.</p>
<p>Unfortunately at work I am stuck with Windows. I am a long-time Vim user so I have it installed, which adds an &#8220;Open with vim&#8230;&#8221;  entry to the Explorer shell. This opens a new Vim instance everytime it&#8217;s used. A similar approach won&#8217;t tempt Emacs users because you do not  open Emacs everytime you open a file. You open Emacs once a week or <em>once a month</em> and keep it running. So enter emacsclient.</p>
<p>It acts as an independent program for an external caller. When started, this program looks for an already running instance of Emacs and connects to it, which then acts as a server and edits the requested file (to accept connections, <tt>server-start</tt> must have been run in Emacs. I have it in my <tt>.emacs</tt> file). When the user is done, he types <tt>C-x #</tt> in the server buffer. Then emacsclient exits and the external caller assumes the editing application has quit.</p>
<p>This is very useful, for instance, for writing commit log messages. My <tt>EDITOR</tt> environment variable points to emacsclient. Everytime I need to commit code in Subversion or  Monotone, the log message appears as a new buffer in my running Emacs. It is also useful for the Firefox extension <a href="https://addons.mozilla.org/firefox/addon/4125" title="It's All Text!">It&#8217;s All Text!</a>, which allows one to use an external text editor to edit web forms. And, of course, I have added an &#8220;Edit with Emacs&#8230;&#8221; entry to my Explorer shell, so I can open any file into a running Emacs very quickly.</p>
<p>Instructions about how to add the shell shortcut can be found in the <a href="http://www.emacswiki.org/cgi-bin/wiki/EmacsClient" title="Emacs Client">Emacs wiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ventonegro.org/2008/04/the-emacs-client/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
