unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] tree-il->scheme improvements
@ 2012-03-01 23:34 Mark H Weaver
  2012-03-01 23:40 ` Mark H Weaver
  2012-03-02 18:34 ` Mark H Weaver
  0 siblings, 2 replies; 12+ messages in thread
From: Mark H Weaver @ 2012-03-01 23:34 UTC (permalink / raw)
  To: guile-devel

Hello all,

Here's a significantly refactored version of my 'tree-il->scheme'
improvements.  In addition the previous features, it can now produce
'case' statements, named-let, internal defines, procedure documentation
strings, and various other improvements.  It now works mostly in a
bottom-up fashion, and uses (ice-9 match) to recognize the derived
forms.  I also removed the 'booting-psyntax?' hack; the relevant
workarounds for booting are now contained solely within
compile-psyntax.scm.

The last patch is new.  It minimizes the wraps of the embedded syntax
objects in psyntax-pp.scm, such that they can no longer be used as the
first argument to 'datum->syntax' but are otherwise equivalent.  (The
resulting syntax-objects are the same as those returned by
'locally-bound-identifiers', but without the added anti-marks).

With these patches, 'psyntax-pp.scm' is now less than 1/9 of its
original size.  Also, the output of the ,expand and ,optimize REPL
commands is much nicer.  For example:

Before:

  scheme@(guile-user)> ,use (ice-9 match)
  scheme@(guile-user)> ,optimize (match x ((v . v) v) (_ #f))
  $1 = (begin
    (letrec*
      ()
      (let ((v-159 x))
        (if (pair? v-159)
          (begin
            (letrec*
              ()
              (let ((w-162 (car v-159)) (x-163 (cdr v-159)))
                (if (equal? x-163 w-162) w-162 #f))))
          #f))))

After:

  scheme@(guile-user)> ,use (ice-9 match)
  scheme@(guile-user)> ,optimize (match x ((v . v) v) (_ #f))
  $1 = (let ((v x))
    (and (pair? v)
         (let ((w (car v)) (x (cdr v)))
           (and (equal? x w) w))))

Still yet to do: add tests for full coverage of the new code.

Comments and suggestions solicited.

     Mark



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-03-06 17:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 23:34 [PATCH] tree-il->scheme improvements Mark H Weaver
2012-03-01 23:40 ` Mark H Weaver
2012-03-02  3:29   ` Noah Lavine
2012-03-03 17:28   ` Andy Wingo
2012-03-03 23:59     ` Mark H Weaver
2012-03-04 11:39       ` Andy Wingo
2012-03-04 15:03         ` Mark H Weaver
2012-03-04 18:43           ` Andy Wingo
2012-03-06 17:01   ` Ludovic Courtès
2012-03-02 18:34 ` Mark H Weaver
2012-03-02 19:11   ` Mark H Weaver
2012-03-03 17:10   ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).