guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Brainfuck branch


From: Andy Wingo
Subject: Re: Brainfuck branch
Date: Wed, 24 Jun 2009 13:19:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Hi Daniel,

On Sat 06 Jun 2009 18:05, Daniel Kraft <address@hidden> writes:

> I just re-pushed the brainfuck branch (but should contain not much new
> as compared to the last push) after the savannah break-down.  I think it
> should have gotten right this time, too, but I again had to struggle a
> bit with git ;)

Thanks for the patches!

I cherry-picked the relevant work to master. It's a cool compiler! And,
it brought out some other bugs that I had been meaning to fix.

I added a Tree-IL compiler, because I thought it would be more
illustrative. Then I fixed some repl bugs so that brainfuck can be
compiled with `,c', and input works now too.

I'm still not happy with the generated code (produced by the
tree-il->glil compiler), but I think I have some ideas about how to make
that better.

But for now:

    scheme@(guile-user)> ,L brainfuck
    Guile Brainfuck interpreter 1.0 on Guile 1.9.0
    Copyright (C) 2001-2008 Free Software Foundation, Inc.

    Enter `,help' for help.
    brainfuck@(guile-user)> ++++++++++        initializes cell zero to 10
    ... [
    ...    >+++++++>++++++++++>+++>+<<<<-
    ... ]                 this loop sets the next four cells to 70/100/30/10 
    ... >++.              print   'H'
    ... >+.               print   'e'
    ... +++++++.                  'l'
    ... .                         'l'
    ... +++.                      'o'
    ... >++.                      space
    ... <<+++++++++++++++.        'W'
    ... >.                        'o'
    ... +++.                      'r'
    ... ------.                   'l'
    ... --------.                 'd'
    ... >+.                       '!'
    ... >.                        newline
    ... ]
    Hello World!
    brainfuck@(guile-user)> 

Cheers,

Andy
-- 
http://wingolog.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]