<?xml version="1.0"?>
<!-- name="generator" content="gyre/0.0.2" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>eighty-twenty news</title>
    <link>http://www.eighty-twenty.org/index.cgi</link>
    <description></description>
    <language>en</language>

        <item>
      <title>I've been cited! (In a way ...)</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/scheme/docscm-referenced-20100307.html</link>
      <description>&lt;p&gt;Hee hee! &lt;a href="http://repository.readscheme.org/ftp/papers/sw2004/normark.pdf"&gt;This
paper&lt;/a&gt;,
on Scheme Program Documentation Tools, references
&lt;a href="http://homepages.kcbbs.gen.nz/tonyg/projects/chickenlibs.html#docscm"&gt;docscm&lt;/a&gt;
:-)&lt;/p&gt;
</description>
    </item>
    <item>
      <title>The scheme-reports-wg1 Google Group is hard to read</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/scheme/scheme-reports-wg1-20100307.html</link>
      <description>&lt;p&gt;It's almost impossible to follow the &lt;a href="http://groups.google.com/group/scheme-reports-wg1"&gt;scheme-reports-wg1 Google
Group&lt;/a&gt;, because&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you can't join the google-group unless you're part of the working
group itself (no joining as a spectator)&lt;/li&gt;
&lt;li&gt;the interfaces available to non-google-group members are
insufficient:
&lt;ul&gt;
&lt;li&gt;the RSS/Atom feeds truncate posts, meaning you have to click
through to the google-group webpage for reading threads&lt;/li&gt;
&lt;li&gt;the thread-reading pages themselves are not easy to catch up on
(compare Thunderbird, an NNTP client, or even Google Reader
here)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;the volume of the list is very high at the moment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd be happy if there were&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a full-content RSS/Atom feed somewhere (for some reason I don't
trust that the existing feed (or perhaps Google Reader) is doing
well in keeping posts in chronological order, either); or,&lt;/li&gt;
&lt;li&gt;an NNTP feed of the group (!); or,&lt;/li&gt;
&lt;li&gt;a regular &lt;code&gt;mailman&lt;/code&gt;-style mailing list for the group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The current setup really doesn't work well for me at all, which is
disappointing, as lots of the discussions I've overcome the
awkwardness of the interface to read are really very interesting.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Notes on "Xoc, an Extension-Oriented Compiler for Systems Programming"</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/xoc-20100307.html</link>
      <description>&lt;p&gt;I've just finished reading &lt;i&gt;"Xoc, an Extension-Oriented Compiler for
Systems Programming"&lt;/i&gt;, by Russ Cox, Tom Bergany, Austin
T. Clements, Frans Kaashoek, and Eddie Kohlery. It's a description of
an interesting approach to extensible compilation, for C in this case,
that refines a lot of ideas that have been explored previously,
bringing them together in a more compositional style than previous
extensible compilers have managed to achieve.&lt;/p&gt;

&lt;p&gt;One of the key themes in the paper is how to control extension
visibility. They describe a couple of approaches they take: one, a
type system used to ensure that extensions to abstract syntax are only
visible to other extensions when those extensions explicitly declare
knowledge of them; and two, an approach from Warth et al.'s
"Statically scoped object adaptation with expanders" paper for
controlling visibility of extensions to core data structures. I wonder
if the latter is used to underpin the former at all.&lt;/p&gt;

&lt;p&gt;Regarding the type system approach they take, it's interesting how it
lets the extension writer provide analyses directly in terms of
extension abstract syntax, rather than forcing translation to a core
language before performing any analysis. We did the latter in
Highwire, and the error messages referred to core-language constructs
which didn't map well to source-language syntax: the user was forced
to unexpand the macro in their heads to make sense of the output of
the compiler. The paper refers to this problem in section 5.2, where
the authors write "Since macros cannot access compiler internals, they
typically do not even type check their arguments, producing cryptic
errors when invoked incorrectly."&lt;/p&gt;

&lt;p&gt;Their compiler, xoc, is a source-to-source translator at the moment,
which means it's not integrated with code generation and backend
optimisations and rewrites. It'd be fascinating to build a complete
compiler in this style. It'd also be neat to relate this approach to
extensible &lt;em&gt;semantics&lt;/em&gt;. At the moment the extensions look quite
ad-hoc. How could this framework be used, for example, to extend
Scheme or ML, where there's a real semantics underneath it?&lt;/p&gt;

&lt;p&gt;One nice feature of xoc is that it tries to preserve hygiene during
rewriting. I'm curious as to whether it preserves hygiene to the
degree that, say, &lt;code&gt;syntax-case&lt;/code&gt; does; their description of the feature
was a bit terse for me to be able to tell. In particular I'm
interested in how it treats keywords, and where "fresh names" come in
to the picture; the paper speaks simply of the code emitter renaming
variables "when two distinct variables share a name".&lt;/p&gt;

&lt;p&gt;They use a GLR parser for converting concrete syntax to abstract
syntax. One of the benefits of this is its ability to deal with
ambiguity, which they exploit in a couple of ways, most ingeniously in
their approach to type inference (if you like) for syntax pattern
variables. I'd like to learn more about how xoc computes the type of a
syntax pattern variable; I wonder if a similar system could be ginned
up for use with OMeta?&lt;/p&gt;

&lt;p&gt;The laziness of most of xoc's attribute computations is rather
nifty. Code generated relatively late in a compilation, when earlier
passes are complete for the rest of the code, can have necessary
information filled in lazily on demand, running just those parts of
the previous analyses that are required.&lt;/p&gt;

&lt;p&gt;I'd like to see some of the pattern-matching and reconstruction
features of xoc employed in the context of general purpose
computing. It seems to me that using a GLR parser the way they do
could effectively provide concrete domain-specific syntax for
algebraic data types, not just abstract syntax trees. (The question
arises: when is an AST an ADT? Always?) Being able to cons up syntax
for new types as easily as Haskell and ML cons up the types themselves
seems like a win it's worth experimenting with. OMeta goes a step in
this direction; I hope to explore it myself sometime soon.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>"Git from the bottom up", by John Wiegley</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/git-from-the-bottom-up-20100222.html</link>
      <description>&lt;p&gt;&lt;a href="http://ftp.newartisans.com/pub/git.from.bottom.up.pdf"&gt;This article&lt;/a&gt;
is an excellent, excellent introduction to Git. It covers the
low-level basics, which are much simpler and more elegant than you
might be expecting&lt;sup class="footnote-ref" id="fnref-ha"&gt;&lt;a href="#fn-ha"&gt;1&lt;/a&gt;&lt;/sup&gt;, and then reaches up to the less elegant but
very powerful world of the Git user interface. Highly recommended.&lt;/p&gt;

&lt;div class="footnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn-ha"&gt;
&lt;p&gt;though of course, you might expect me to say that, &lt;a href="http://homepages.kcbbs.gen.nz/tonyg/projects/synchrotron.html"&gt;given my own background&lt;/a&gt;!&amp;nbsp;&lt;a href="#fnref-ha" class="footnoteBackLink" title="Jump back to footnote 1 in the text."&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description>
    </item>
    <item>
      <title>Messaging without time: modeless user-interfaces for programs</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/modron-20100221.html</link>
      <description>&lt;p&gt;Most thinking about messaging seems to be framed in terms of process
languages, like the
&lt;a href="http://en.wikipedia.org/wiki/Pi_calculus"&gt;π-calculus&lt;/a&gt;. In the
π-calculus, processes evolve according to an internal clock, the ticks
of which correspond to communication events between subprocesses. Many
real programming languages based around messaging, like
&lt;a href="http://en.wikipedia.org/wiki/Erlang_%28programming_language%29"&gt;Erlang&lt;/a&gt;,
are based around similar models, meaning that programmers write
programs whose notion of time is &lt;em&gt;implicit&lt;/em&gt;, rather than
explicit. This can make it difficult to write programs which can
reason about differing orders of events or cope with contradictory
assertions about the state of the outside world.&lt;/p&gt;

&lt;p&gt;An alternative way of dealing with messaging is to take an &lt;em&gt;epistemic
reasoning&lt;/em&gt; approach closely connected with &lt;a href="http://en.wikipedia.org/wiki/Functional_reactive_programming"&gt;Functional Reactive
Programming&lt;/a&gt;
(FRP): instead of writing programs that wait for the arrival of
specific messages, one at a time, write programs that deal with a
queryable monotonically increasing collection of all messages that
have arrived or departed so far. Metadata about each message&amp;mdash;the
sender, the recipient, the time of receipt&amp;mdash;are reified as queryable
fields attached to each datum in the collection. The state of the
program's world is directly derivable from the program itself and the
collection of messages that have been exchanged thus far.&lt;/p&gt;

&lt;p&gt;By letting programs step back from the low-level detail of the
exchange of messages and take a broader overview of the whole
conversation thus far, we let programs behave much more flexibly in
the face of such common distributed-systems challenges as lost
messages, duplicated messages, out-of-order messages, inconsistent
data, and timeouts.&lt;/p&gt;

&lt;p&gt;I've been off-and-on thinking about these timeless 'epistemic
messaging' systems for a couple of years now, since a customer project
let us investigate their potential suitability for a particular style
of long-lived database; while I could write more, and hope to in
future, I want to record an observation that occurred to me a couple
of days ago about a connection between modeless user interfaces and
timeless messaging systems.&lt;/p&gt;

&lt;p&gt;In the same way that modal user interfaces constrain the interaction
between the user and program into a sequential, question-and-answer
style, π-calculus-style programs constrain the interaction between
programs in a distributed system into a similar one-thing-at-a-time
sequential style, which can lead to programs having a sensitive
dependence on message arrival order. Modeless user interfaces, by
contrast, make possible a more open-ended, non-linear style of
interaction with the user, and epistemic messaging does the same thing
for program-to-program interaction: because the state of each program
(and thereby its next action) is derived from the collection of
messages that have been exchanged, the program can more easily be
written to cope with messages arriving in an unusual
order. Epistemic-messaging programs can even be written to be able to
re-plan (and maybe even re-execute) their actions if received messages
were to be permitted to be replaced mid-run.&lt;/p&gt;

&lt;p&gt;(Aside: I wonder if there's a connection here to the &lt;a href="http://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspondence"&gt;Curry-Howard
isomorphism&lt;/a&gt;?
A program operating epistemically over a collection of messages feels
like a kind of type/formula, where a similar program in a
π-calculus-like system feels like a program/proof.)&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Source Code Repositories</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/repos.html</link>
      <description>&lt;!-- Note: This file should be updated in place and
re-timestamped. The idea is to keep the same permalink, but update the
content. --&gt;

&lt;p&gt;We make a few programs that we've developed available on this
server. You can download them from our source-code repositories:&lt;/p&gt;

&lt;h4&gt;&lt;a name="a-href-http-www-selenic-com-mercurial-mercurial-a"&gt;&lt;/a&gt;&lt;a href="http://www.selenic.com/mercurial/"&gt;Mercurial&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;We're gradually switching away from darcs to mercurial or git. You can
browse the mercurial-controlled code with &lt;a href="http://www.eighty-twenty.org/hgwebdir.cgi"&gt;hgwebdir at
80/20&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;tonyg&lt;/code&gt;'s projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/hgwebdir.cgi/ometa-scheme/"&gt;ometa-scheme&lt;/a&gt;:
An implementation
of &lt;a href="http://www.cs.ucla.edu/%7Eawarth/ometa/"&gt;OMeta&lt;/a&gt;
for scheme. Currently it runs
in &lt;a href="http://plt-scheme.org/software/mzscheme/"&gt;MzScheme&lt;/a&gt;,
but it should be fairly portable, with dependencies only on a
handful of
commonly-implemented &lt;a href="http://srfi.schemers.org/"&gt;SRFIs&lt;/a&gt;. For
more information, see
the &lt;a href="http://www.lshift.net/blog/2008/07/01/ometa-for-scheme"&gt;ometa-scheme
blog post&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/hgwebdir.cgi/smalltalk-tng/"&gt;smalltalk-tng&lt;/a&gt;:
An &lt;a
href="http://www.eighty-twenty.org/index.cgi/tech/smalltalk/thing"&gt;experimental
language&lt;/a&gt; I'm developing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;&lt;a name="a-href-http-git-scm-com-git-a"&gt;&lt;/a&gt;&lt;a href="http://git-scm.com/"&gt;Git&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;While we generally prefer to use mercurial, git is more appropriate
for some projects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;tonyg&lt;/code&gt;'s projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://homepages.kcbbs.gen.nz/tonyg/projects/gyre.html"&gt;gyre&lt;/a&gt;:
The web-log engine behind this site; written in python, very
simple, blosxom-like&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://homepages.kcbbs.gen.nz/tonyg/projects/newmoon.html"&gt;newmoon&lt;/a&gt;:
An incredibly naive CPS-based Scheme compiler, currently torn
between JVM, .NET and C backend support&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;&lt;a name="a-href-http-abridgegame-org-darcs-darcs-a"&gt;&lt;/a&gt;&lt;a href="http://abridgegame.org/darcs/"&gt;Darcs&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;Most of our older projects are currently held in these archives,
though as we switch to Mercurial and Git, this will change. You can
browse the darcs-controlled code with &lt;a
href="http://www.eighty-twenty.org/darcsweb/"&gt;DarcsWeb at
80/20&lt;/a&gt;&lt;/li&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;tonyg&lt;/code&gt;'s archive: &lt;a href="http://www.eighty-twenty.org/~tonyg/Darcs/"&gt;http://www.eighty-twenty.org/~tonyg/Darcs/&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/~tonyg/Darcs/chicken-sdl/"&gt;chicken-sdl&lt;/a&gt;:
&lt;a href="http://www.libsdl.org/"&gt;SDL&lt;/a&gt; bindings for &lt;a
href="http://www.call-with-current-continuation.org/"&gt;Chicken
Scheme&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/~tonyg/Darcs/macromod/"&gt;macromod&lt;/a&gt;:
A portable (re-)implementation of a &lt;code&gt;syntax-case&lt;/code&gt;
Scheme macro-expander; &lt;abbr title="Real Soon
Now!"&gt;eventually&lt;/abbr&gt; to sprout a portable implementation of
&lt;a
href="http://citeseer.ist.psu.edu/flatt02composable.html"&gt;Matthew
Flatt's "macromod"&lt;/a&gt; module system&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/~tonyg/Darcs/scheme-pg/"&gt;scheme-pg&lt;/a&gt;:
Some &lt;a
href="http://www.eighty-twenty.org/index.cgi/tech/scheme/scheme-pg-20050924.html"&gt;small
changes&lt;/a&gt; I made to the &lt;a
href="http://scheme-pg.sourceforge.net/"&gt;&lt;tt&gt;scheme-pg&lt;/tt&gt;
Scheme PostgreSQL bindings&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/~tonyg/Darcs/slate/"&gt;slate&lt;/a&gt;:
My development branch of &lt;a
href="http://slate.tunes.org/"&gt;Slate&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;mikeb&lt;/code&gt;'s archive: &lt;a href="http://www.eighty-twenty.org/~mikeb/Darcs/"&gt;http://www.eighty-twenty.org/~mikeb/Darcs/&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/~mikeb/Darcs/chicken-cairo/"&gt;chicken-cairo&lt;/a&gt;:
&lt;a href="http://cairographics.org/"&gt;Cairo&lt;/a&gt; bindings for &lt;a
href="http://www.call-with-current-continuation.org/"&gt;Chicken
Scheme&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/~mikeb/Darcs/fuschia-rdf/"&gt;fuschia-rdf&lt;/a&gt;:
A sketch of an RDF aggregating blog engine in Python&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/~mikeb/Darcs/sticky-wiki/"&gt;sticky-wiki&lt;/a&gt;:
A half-arsed variation on &lt;a
href="http://www.tiddlywiki.com/"&gt;TiddlyWiki&lt;/a&gt; that looks a
bit like sticky notes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.eighty-twenty.org/~mikeb/Darcs/zowie/"&gt;zowie&lt;/a&gt;:
An experimental foundation for a zooming user interface.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;!--
    &lt;dt&gt;&lt;a href="http://www.eighty-twenty.org/~mikeb/Darcs/fractal-mirage/"&gt;fractal-mirage&lt;/a&gt;&lt;/dt&gt;
    &lt;dd&gt;&lt;/dd&gt;
    &lt;dt&gt;&lt;a href="http://www.eighty-twenty.org/~mikeb/Darcs/sake/"&gt;sake&lt;/a&gt;&lt;/dt&gt;
    &lt;dd&gt;&lt;/dd&gt;
    &lt;dt&gt;&lt;a href="http://www.eighty-twenty.org/~mikeb/Darcs/zooming-ifs/"&gt;zooming-ifs&lt;/a&gt;&lt;/dt&gt;
    &lt;dd&gt;&lt;/dd&gt;
--&gt;

&lt;h4&gt;&lt;a name="a-href-http-wiki-gnuarch-org-gnu-arch-tla-a"&gt;&lt;/a&gt;&lt;a href="http://wiki.gnuarch.org/"&gt;GNU/Arch (tla)&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;These repositories are obsolete, as we've mostly &lt;a
href="http://www.eighty-twenty.org/index.cgi/tech/releases/archives-moved-2.html"&gt;switched
to using darcs&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2004 archives: &lt;code&gt;tla register-archive http://www.eighty-twenty.org/archives/2004/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;2005 archives: &lt;code&gt;tla register-archive http://www.eighty-twenty.org/archives/2005/&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>FIB in PowerPC assembly and in JONESFORTH</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/shootout-20071010.html</link>
      <description>&lt;p&gt;Recently I've been teaching myself PowerPC assembly through &lt;a
href="http://www.lshift.net/blog/2007/10/04/jonesforth-ported-to-powerpc-and-mac-os-x"&gt;porting
JONESFORTH to PowerPC on Mac OS X&lt;/a&gt;. It struck me to run the same
little fibonacci-sequence microbenchmark that I ran &lt;a
href="http://www.eighty-twenty.org/index.cgi/_STORY_/tech/shootout-20041030.html"&gt;lo
these many years past&lt;/a&gt;. The results were interesting:&lt;/p&gt;

&lt;table class="columnar" cellspacing="5" cellpadding="0" border="0"&gt;
  &lt;tr&gt;
    &lt;th&gt;Language&lt;/th&gt;
    &lt;th&gt;Implementation Detail&lt;/th&gt;
    &lt;th&gt;Time (per &lt;tt&gt;(fib 29)&lt;/tt&gt; call, in milliseconds)&lt;/th&gt;
    &lt;th&gt;Ops/s&lt;/th&gt;
    &lt;th&gt;Ratio (opt. C)&lt;/th&gt;
    &lt;th&gt;Ratio (unopt. C)&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;PPC assembly&lt;/td&gt;
    &lt;td&gt;-&lt;/td&gt;
    &lt;td&gt;24&lt;/td&gt;
    &lt;td&gt;935983000&lt;/td&gt;
    &lt;td&gt;0.43&lt;/td&gt;
    &lt;td&gt;0.205&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;FORTH&lt;/td&gt;
    &lt;td&gt;&lt;a href="http://www.annexia.org/forth"&gt;JONESFORTH&lt;/a&gt; ported to PPC&lt;/td&gt;
    &lt;td&gt;277&lt;/td&gt;
    &lt;td&gt;81096000&lt;/td&gt;
    &lt;td&gt;4.95&lt;/td&gt;
    &lt;td&gt;2.37&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;The hand-coded assembly beats all the &lt;a
href="http://www.eighty-twenty.org/index.cgi/_STORY_/tech/shootout-20041030.html"&gt;other
entrants&lt;/a&gt; (perhaps unsurprisingly). The naive indirect-threaded
FORTH is the fastest interpreted language, merely 5 times slower than
fully optimised C.&lt;/p&gt;

&lt;p&gt;Here's the JONESFORTH code:&lt;/p&gt;

&lt;pre class="code"&gt;
: FIB DUP 2 &gt;= IF 1- DUP RECURSE SWAP 1- RECURSE + ELSE DROP 1 THEN ;
&lt;/pre&gt;

&lt;p&gt;and here's the PPC assembly (arg and result in &lt;code&gt;r3&lt;/code&gt;):&lt;/p&gt;

&lt;pre class="code"&gt;
_SFIB:  cmpwi   r3,2
        bge     1f
        li      r3,1
        blr
1:      mflr    r0
        stw     r0,-4(r1)
        addi    r3,r3,-1
        stwu    r3,-8(r1)
        bl      _SFIB
        lwz     r4,0(r1)
        stw     r3,0(r1)
        addi    r3,r4,-1
        bl      _SFIB
        lwz     r4,0(r1)
        add     r3,r3,r4
        lwz     r0,4(r1)
        addi    r1,r1,8
        mtlr    r0
        blr
&lt;/pre&gt;
</description>
    </item>
    <item>
      <title>Reflection on floats</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/reflection-on-floats.html</link>
      <description>&lt;p&gt;&lt;a
href="http://www.agileprogrammer.com/eightytwenty/archive/2007/04/30/22652.aspx"&gt;Gordon
Weakliem writes&lt;/a&gt; about literal hash-table syntax, and touches on
some of the problems that programmers run in to with floating-point
numbers. He writes:&lt;/p&gt;

&lt;blockquote&gt;12 years ago, I spent half a day in the debugger trying to
figure out why the computer would not believe that 0.0 == 0.0
[...]&lt;/blockquote&gt;

&lt;p&gt;
This triggered two thoughts:
&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;floating-point numbers in GUIs should be represented differently
depending on whether they are an exact representation or an inexact
one - which might have saved Gordon's 12 hours. For instance, inexact
representations could be a slightly different shade from exact
representations, making the hidden difference between the two zeros
apparent at a glance; and&lt;/li&gt;

&lt;li&gt;programming languages &lt;i&gt;must&lt;/i&gt; provide reflective access to the
representation of floating point numbers, if they are used. As a
programmer, I must be able to access the exact bit sequence used to
represent the sign, mantissa and exponent of the float.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Regarding reflective access to floats, Java provides &lt;a
href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Float.html#floatToIntBits(float)"&gt;floatToIntBits&lt;/a&gt;
and &lt;a
href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Float.html#intBitsToFloat(int)"&gt;intBitsToFloat&lt;/a&gt;,
and C provides (quasi-portable) pointer-based memory-aliasing
type-punning to the same effect: &lt;code&gt;float f = 1.23; int i = *((int
*) &amp;f);&lt;/code&gt;.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Submatches vs. Recursion in ThiNG Patterns</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/smalltalk/thing/submatch-vs-recpattern-20060522.html</link>
      <description>&lt;p&gt;Submatching in a pattern, &lt;code&gt;+var@pattern&lt;/code&gt;, looks
suspiciously similar to recursion in a
value, &lt;code&gt;var=value&lt;/code&gt;. In each case, we expect a value which
is both named and processed, and in each case, a binding is introduced
into code. The processing in the submatch case is a further
pattern-match operation, and in the recursion case it is a nested
evaluation.&lt;p&gt;

&lt;p&gt;The main difference, besides the overall context, between the two
forms is the scope of the introduced binding: in the submatch, the
pattern variable to the left of the &lt;code&gt;@&lt;/code&gt; sign is bound only
in the right-hand-side of the overall pattern, at present, whereas in
the recursive value the variable to the left of the &lt;code&gt;=&lt;/code&gt; is
bound in the right-hand-side of the recursion itself. Another
important difference is that in the submatch context,
the &lt;code&gt;+var&lt;/code&gt; is clearly just a binding form, whereas in the
recursion context, &lt;code&gt;var&lt;/code&gt; can be seen as acting both as a
binding form and a reference to the bound value. Another way of
looking at it, though, has the &lt;code&gt;var&lt;/code&gt; acting solely as a
binding form, with the right-hand-side of the &lt;code&gt;=&lt;/code&gt; being the
actual result of the expression &amp;mdash; the fact that the left and
right-hand-sides are equivalent is not relevant, in this
interpretation.&lt;/p&gt;

&lt;p&gt;What if the two forms were unified, based on their similarities,
using either &lt;code&gt;var=pattern-or-value&lt;/code&gt;
or &lt;code&gt;+var=pattern-or-value&lt;/code&gt; for both pieces of syntax? The
former seems out-of-place for submatches, since we want to clearly
mark bindings that will propagate their bound value into the code on
the right-hand-side of an object clause; and the latter seems
out-of-place in a recursive value, since &lt;code&gt;+var&lt;/code&gt; implies a
binding object, which is a first-class datum in ThiNG.&lt;/p&gt;

&lt;p&gt;Compare and contrast the following &amp;mdash; a string-interleaving
routine using the current syntax for both submatch and recursion:&lt;/p&gt;

&lt;pre class="code"&gt;
sepList: [+s: loop=[(cons +x +more@(cons _ _)): (x ++ s ++ loop more)
                    (cons +x _): x
                    _: EmptyString]]
&lt;/pre&gt;

&lt;p&gt;The same routine using &lt;code&gt;+var=pattern-or-value&lt;/code&gt; for
both:&lt;/p&gt;

&lt;pre class="code"&gt;
sepList: [+s: +loop=[(cons +x +more=(cons _ _)): (x ++ s ++ loop more)
                     (cons +x _): x
                     _: EmptyString]]
&lt;/pre&gt;

&lt;p&gt;Finally, the same routine using &lt;code&gt;var=pattern-or-value&lt;/code&gt; for
both:&lt;/p&gt;

&lt;pre class="code"&gt;
sepList: [+s: loop=[(cons +x more=(cons _ _)): (x ++ s ++ loop more)
                    (cons +x _): x
                    _: EmptyString]]
&lt;/pre&gt;

&lt;p&gt;Finally, there's the question of scope: if the same syntax is used
for both submatch and for recursion, what happens if we adjust the
scoping rules to be as similar as possible? It doesn't make sense for
recursive-value's scoping rule to be changed to be the same as
submatch's scoping rule &amp;mdash; there's no right-hand-side in a value
for the binding to be visible in! &amp;mdash; but the other way around
might be worth considering: let the binding introduced as part of a
submatch be visible as part of the right-hand-side of the
submatch. What happens then? Do we end up with infinite patterns? Do
we instead end up with a kind of unification-constraint in which an
object matching a submatch that is referred to within that same
submatch is constrained to have the same recursive topology as the
pattern itself?&lt;/p&gt;

&lt;p&gt;[&lt;b&gt;Update:&lt;/b&gt; Something I forgot to mention &amp;mdash; with the
scope rule for submatches as it stands, it's possible to evaluate and
then compile patterns ahead of execution time. Changing the scope rule
can make compilation of ThiNG code more difficult, forcing the system
to be more late-bound than perhaps it needs to be.]&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Partial-evaluation of Monads in Scheme - A New Hope?</title>
      <link>http://www.eighty-twenty.org/index.cgi/tech/smalltalk/thing/monads-in-scheme-20060521.html</link>
      <description>&lt;p&gt;The other day, I &lt;a
href="http://www.eighty-twenty.org/index.cgi/_STORY_/tech/smalltalk/thing/monads-in-scheme-20060519.html"&gt;noted&lt;/a&gt;
that my generic-monad-in-Scheme implementation suffered from the flaw
of not being able to type-check monad assemblies before any actions
had been executed, and that in general such ahead-of-time checking is
not possible without abstract interpretation of some kind, because the
&lt;em&gt;functional&lt;/em&gt; code in the right-hand-side of the bind operator
can decide &lt;em&gt;which action&lt;/em&gt; to splice into the monad next:&lt;/p&gt;

&lt;pre class="code"&gt;
&lt;b&gt;(define (goes-wrong)
  (run-io (mlet* ((val mread))
            (if val &lt;/b&gt;&lt;i&gt;;; if the user entered #f, we break, otherwise we're fine&lt;/i&gt;&lt;b&gt;
                (mlet* ((_ (mdisplay "Was true\n"))) (return 'apples))
                'bananas))))&lt;/b&gt; &lt;i&gt;;; Note: missing "(return ...)"!&lt;/i&gt;
&lt;/pre&gt;

&lt;p&gt;Perhaps a partial-evaluator can play the part of a
Haskell-type-system-like abstract interpretation well enough to drive
the type-safety checks through the code at PE time (loosely equivalent
to static-analysis time) for most cases (leaving the remaining cases
for runtime-detection, as in the present implementation, and perhaps
warning the user)? In order to find out, my next experiment in this
direction will be marrying the &lt;a
href="http://www.eighty-twenty.org/hgwebdir.cgi/smalltalk-tng/file/tip/experiments/monad/general-monad.scm"&gt;monad
code&lt;/a&gt; to the &lt;a
href="http://www.eighty-twenty.org/index.cgi/_STORY_/tech/scheme/partial-eval-20050313.html"&gt;partial-evaluator&lt;/a&gt;
I &lt;a
href="http://www.eighty-twenty.org/hgwebdir.cgi/smalltalk-tng/file/tip/experiments/partial-eval/pe.scm"&gt;implemented&lt;/a&gt;
some months ago.&lt;/p&gt;
</description>
    </item>


  </channel>
</rss>
