* guile-vm 0.7 released
@ 2008-05-20 13:42 Andy Wingo
2008-05-21 11:56 ` Ludovic Courtès
2008-05-21 15:20 ` Han-Wen Nienhuys
0 siblings, 2 replies; 3+ messages in thread
From: Andy Wingo @ 2008-05-20 13:42 UTC (permalink / raw)
To: guile-devel
[-- Attachment #1: Type: text/plain, Size: 2568 bytes --]
Hi all,
I've released version 0.7 of guile-vm. I hope I'm not stepping on toes
for this one, but I felt it was a good idea to get a tarball out there
that self-compiles fine and that distchecks. I've attached the NEWS.
tarball: http://wingolog.org/pub/guile-vm-0.7.tar.gz
git: http://wingolog.org/git/guile-vm.git
I also have to apologize again for not working in Ludovic's doc updates,
or responding properly -- my mail is still borked. Perhaps it will
unbork today.
So the question is: where to from here? Here is an unordered series of
thoughts, observations, etc.
* Guile-VM does not currently offer a significant speed advantage over
the interpreter. It is mostly faster by about 2 times or so, but
sometimes slower. On the other hand I haven't profiled it yet. And,
on the other other hand, loading compiled code is really quick.
* I have fixed macro compilation for syncase macros. Yay.
* Guile-VM appears to produce correct code. I have not comprehensively
proven this, though.
* If you have a .go file in the same place as a .scm file, and you have
loaded (system vm core) at some time in the past, then `use-modules'
will automatically load your compiled file instead of the .scm file.
This is part of boot-9. It should (but currently does not) stat to
make sure the .go file is up to date, though.
* GOOPS-using code does not yet compile. I think that it probably needs
quite a rework in order to compile, in order to make sure that all
effects are performed via e.g. what define-class expands out to
instead of by the expander itself.
* I am relying on a few Guile patches. Some of them I've sent and not
gotten around to properly responding to and fixing, and some of them
I have not. I'm attaching them all after the NEWS.
* The code generated by Guile-VM is OK. The preambles are quite crap
though.
* Debugging currently sucks, there is no source-level information, and
I haven't yet been able to understand Kei's vision in that regard. I
think that Ludovic knows more about this.
* I need to get a copyright assignment for pmatch.scm.
* The real wins on startup time and such will come when boot-9.scm is
compiled, and all of ice-9/ is compiled. I would love for this to
happen. This would require Guile-VM becoming a part of Guile. I think
that the debugging support (backtraces at least) should be better
before that happens, though.
That's all of my thoughts for now. Please give the tarball a go, and let
me know if you react to any of these thoughts!
Andy
[-- Attachment #2: NEWS --]
[-- Type: text/plain, Size: 2041 bytes --]
Guile-VM NEWS
Guile-VM is a bytecode compiler and virtual machine for Guile.
guile-vm 0.7 -- 2008-05-20
==========================
* Initial release with NEWS.
* Revived from Keisuke Nishida's Guile-VM project from 2000-2001, with
the help of Ludovic Courtès.
* Meta-level changes
** Updated to compile with Guile 1.8.
** Documentation updated, including documentation on the instructions.
** Added benchmarking and a test harness.
* Changes to the inventory
** Renamed the library from libguilevm to libguile-vm.
** Added new executable script, guile-disasm.
* New features
** Add support for compiling macros, both defmacros and syncase macros.
Primitive macros produced with the procedure->macro family of procedures
are not supported, however.
** Improvements to the REPL
Multiple values support, readline integration, ice-9 history integration
** Add support for eval-case
The compiler recognizes compile-toplevel in addition to load-toplevel
** Completely self-compiling
Almost, anyway: not (system repl describe), because it uses GOOPS
* Internal cleanups
** Internal objects are now based on Guile records.
** Guile-VM's code doesn't use the dot-syntax any more.
** Changed (ice-9 match) for Kiselyov's pmatch.scm
** New instructions: define, link-later, link-now, late-variable-{ref,set}
** Object code now represented as u8vectors instead of strings.
** Remove local import of an old version of slib
* Bugfixes
** The `optimize' procedure is coming out of bitrot
** The Scheme compiler is now more strict about placement of internal
defines
** set! is now compiled differently from define
** Module-level variables are now bound at first use instead of in the
program prolog
** Bugfix to load-program (stack misinterpretation)
Copyright (C) 2008 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice
and this notice are preserved.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-make-readline-s-repl-reader-impl-check-the-current.patch --]
[-- Type: text/x-patch, Size: 1043 bytes --]
From a488aa59468f60133fc8767b3ffafa2e098bda4f Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@pobox.com>
Date: Fri, 9 May 2008 13:07:32 +0200
Subject: [PATCH] make readline's `repl-reader' impl check the current-reader fluid
* guile-readline/ice-9/readline.scm (activate-readline): Use the current
binding of the current-reader fluid, if it is available.
---
guile-readline/ice-9/readline.scm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/guile-readline/ice-9/readline.scm b/guile-readline/ice-9/readline.scm
index 363b7c0..dce7755 100644
--- a/guile-readline/ice-9/readline.scm
+++ b/guile-readline/ice-9/readline.scm
@@ -212,7 +212,7 @@
(set-buffered-input-continuation?! (readline-port) #f)
(set-readline-prompt! prompt "... ")
(set-readline-read-hook! read-hook))
- (lambda () (read))
+ (lambda () ((or (fluid-ref current-reader) read)))
(lambda ()
(set-readline-prompt! "" "")
(set-readline-read-hook! #f)))))
--
1.5.5-rc2.GIT
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0002-support-thunks-as-prompts-as-readline-does.patch --]
[-- Type: text/x-patch, Size: 779 bytes --]
From 69fc67efaad628a866e14ead4cb96f102316b82b Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@pobox.com>
Date: Fri, 9 May 2008 16:42:44 +0200
Subject: [PATCH] support thunks as prompts, as readline does.
* ice-9/boot-9.scm (repl-reader): Support thunks as prompts.
---
ice-9/boot-9.scm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm
index d1e6306..b92cfd6 100644
--- a/ice-9/boot-9.scm
+++ b/ice-9/boot-9.scm
@@ -2518,7 +2518,7 @@
;;; the readline library.
(define repl-reader
(lambda (prompt)
- (display prompt)
+ (display (if (string? prompt) prompt (prompt)))
(force-output)
(run-hook before-read-hook)
((or (fluid-ref current-reader) read) (current-input-port))))
--
1.5.5-rc2.GIT
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0003-Support-loading-of-compiled-syncase-macros.patch --]
[-- Type: text/x-patch, Size: 2550 bytes --]
From d0c2de85c139319a34718984855ec9f07f958ede Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@pobox.com>
Date: Mon, 19 May 2008 12:19:28 +0200
Subject: [PATCH] Support loading of compiled syncase macros
* ice-9/syncase.scm (current-eval-closure): New procedure.
(env->eval-closure): Don't default to the root module: if we have no
environment, we default to the current module via the logic in
current-eval-closure. This is because psyntax's compilation mode
doesn't know about guile modules, and thus won't dump the code to
twiddle the current eval closure.
(putprop, getprop, guile-macro): Use `current-eval-closure'.
At the end, leave the expansion-eval-closure set to #f.
---
ice-9/syncase.scm | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/ice-9/syncase.scm b/ice-9/syncase.scm
index 6ee4d16..d3e5bb5 100644
--- a/ice-9/syncase.scm
+++ b/ice-9/syncase.scm
@@ -35,11 +35,12 @@
\f
(define expansion-eval-closure (make-fluid))
+(define (current-eval-closure)
+ (or (fluid-ref expansion-eval-closure)
+ (module-eval-closure (current-module))))
(define (env->eval-closure env)
- (or (and env
- (car (last-pair env)))
- (module-eval-closure the-root-module)))
+ (and env (car (last-pair env))))
(define sc-macro
(procedure->memoizing-macro
@@ -107,7 +108,7 @@
(fluid-set! expansion-eval-closure the-syncase-eval-closure)
(define (putprop symbol key binding)
- (let* ((eval-closure (fluid-ref expansion-eval-closure))
+ (let* ((eval-closure (current-eval-closure))
;; Why not simply do (eval-closure symbol #t)?
;; Answer: That would overwrite imported bindings
(v (or (eval-closure symbol #f) ;lookup
@@ -122,7 +123,7 @@
(set-object-property! v key binding)))
(define (getprop symbol key)
- (let* ((v ((fluid-ref expansion-eval-closure) symbol #f)))
+ (let* ((v ((current-eval-closure) symbol #f)))
(and v
(or (object-property v key)
(and (variable-bound? v)
@@ -137,7 +138,7 @@
(if (symbol? e)
;; pass the expression through
e
- (let* ((eval-closure (fluid-ref expansion-eval-closure))
+ (let* ((eval-closure (current-eval-closure))
(m (variable-ref (eval-closure (car e) #f))))
(if (eq? (macro-type m) 'syntax)
;; pass the expression through
@@ -244,4 +245,4 @@
;(eval-case ((load-toplevel) (export-syntax name)))
(define-syntax name rules ...)))))
-(fluid-set! expansion-eval-closure (env->eval-closure #f))
+(fluid-set! expansion-eval-closure #f)
--
1.5.5-rc2.GIT
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0004-update-INSTALL.patch --]
[-- Type: text/x-patch, Size: 1037 bytes --]
From 59ca82b1c15835d413d08e74997fb25464d248c9 Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@pobox.com>
Date: Mon, 19 May 2008 12:21:53 +0200
Subject: [PATCH] update INSTALL
* INSTALL: update.
---
INSTALL | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/INSTALL b/INSTALL
index 5458714..d3c5b40 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,7 +2,7 @@ Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
@@ -67,6 +67,9 @@ The simplest way to compile this package is:
all sorts of other programs in order to regenerate files that came
with the distribution.
+ 6. Often, you can also type `make uninstall' to remove the installed
+ files again.
+
Compilers and Options
=====================
--
1.5.5-rc2.GIT
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: 0005-make-has-suffix-use-string-suffix.patch --]
[-- Type: text/x-patch, Size: 829 bytes --]
From 469224129436b576a231cb14b6fb0ade8aa068e6 Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@pobox.com>
Date: Mon, 19 May 2008 12:23:46 +0200
Subject: [PATCH] make has-suffix? use string-suffix?
* ice-9/boot-9.scm (has-suffix?): Use the core / srfi-13's
string-suffix?.
---
ice-9/boot-9.scm | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm
index b92cfd6..c8b9ab6 100644
--- a/ice-9/boot-9.scm
+++ b/ice-9/boot-9.scm
@@ -569,10 +569,7 @@
#f)))))
(define (has-suffix? str suffix)
- (let ((sufl (string-length suffix))
- (sl (string-length str)))
- (and (> sl sufl)
- (string=? (substring str (- sl sufl) sl) suffix))))
+ (string-suffix? suffix str))
(define (system-error-errno args)
(if (eq? (car args) 'system-error)
--
1.5.5-rc2.GIT
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #8: 0006-add-compile-toplevel-and-evaluate-conditions-to-eval.patch --]
[-- Type: text/x-patch, Size: 4573 bytes --]
From 9a44c262d2ff8fb625ca0dafda57d4902a4d9c50 Mon Sep 17 00:00:00 2001
From: Andy Wingo <wingo@pobox.com>
Date: Mon, 19 May 2008 12:26:20 +0200
Subject: [PATCH] add compile-toplevel and evaluate conditions to eval-case
* ice-9/boot-9.scm (eval-case): Define two more conditions:
compile-toplevel and evaluate, as common lisp and chez scheme do.
(defmacro, define-option-interface, define-macro, define-syntax-macro)
(define-module, use-modules, use-syntax, define-public)
(defmacro-public, export, re-export): Add `compile-toplevel' to all
uses of eval-case.
---
ice-9/boot-9.scm | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm
index c8b9ab6..f6fd6fb 100644
--- a/ice-9/boot-9.scm
+++ b/ice-9/boot-9.scm
@@ -92,9 +92,11 @@
;; (eval-case ((situation*) forms)* (else forms)?)
;;
;; Evaluate certain code based on the situation that eval-case is used
-;; in. The only defined situation right now is `load-toplevel' which
-;; triggers for code evaluated at the top-level, for example from the
-;; REPL or when loading a file.
+;; in. There are three situations defined. `load-toplevel' triggers for
+;; code evaluated at the top-level, for example from the REPL or when
+;; loading a file. `compile-toplevel' triggers for code compiled at the
+;; toplevel. `execute' triggers during execution of code not at the top
+;; level.
(define eval-case
(procedure->memoizing-macro
@@ -151,7 +153,7 @@
(lambda (name parms . body)
(let ((transformer `(lambda ,parms ,@body)))
`(eval-case
- ((load-toplevel)
+ ((load-toplevel compile-toplevel)
(define ,name (defmacro:transformer ,transformer)))
(else
(error "defmacro can only be used at the top level")))))))
@@ -2257,8 +2259,8 @@
(define ,(caddr options/enable/disable)
,(make-disable interface))
(defmacro ,(caaddr option-group) (opt val)
- `(,,(car options/enable/disable)
- (append (,,(car options/enable/disable))
+ `(,',(car options/enable/disable)
+ (append (,',(car options/enable/disable))
(list ',opt ,val))))))))))
(define-option-interface
@@ -2699,7 +2701,7 @@
(car rest)
`(lambda ,(cdr first) ,@rest))))
`(eval-case
- ((load-toplevel)
+ ((load-toplevel compile-toplevel)
(define ,name (defmacro:transformer ,transformer)))
(else
(error "define-macro can only be used at the top level")))))
@@ -2712,7 +2714,7 @@
(car rest)
`(lambda ,(cdr first) ,@rest))))
`(eval-case
- ((load-toplevel)
+ ((load-toplevel compile-toplevel)
(define ,name (defmacro:syntax-transformer ,transformer)))
(else
(error "define-syntax-macro can only be used at the top level")))))
@@ -2827,7 +2829,7 @@
(defmacro define-module args
`(eval-case
- ((load-toplevel)
+ ((load-toplevel compile-toplevel)
(let ((m (process-define-module
(list ,@(compile-define-module-args args)))))
(set-current-module m)
@@ -2852,7 +2854,7 @@
(defmacro use-modules modules
`(eval-case
- ((load-toplevel)
+ ((load-toplevel compile-toplevel)
(process-use-modules
(list ,@(map (lambda (m)
`(list ,@(compile-interface-spec m)))
@@ -2863,7 +2865,7 @@
(defmacro use-syntax (spec)
`(eval-case
- ((load-toplevel)
+ ((load-toplevel compile-toplevel)
,@(if (pair? spec)
`((process-use-modules (list
(list ,@(compile-interface-spec spec))))
@@ -2893,7 +2895,7 @@
(let ((name (defined-name (car args))))
`(begin
(define-private ,@args)
- (eval-case ((load-toplevel) (export ,name))))))))
+ (eval-case ((load-toplevel compile-toplevel) (export ,name))))))))
(defmacro defmacro-public args
(define (syntax)
@@ -2908,7 +2910,7 @@
(#t
(let ((name (defined-name (car args))))
`(begin
- (eval-case ((load-toplevel) (export-syntax ,name)))
+ (eval-case ((load-toplevel compile-toplevel) (export-syntax ,name)))
(defmacro ,@args))))))
;; Export a local variable
@@ -2947,7 +2949,7 @@
(defmacro export names
`(eval-case
- ((load-toplevel)
+ ((load-toplevel compile-toplevel)
(call-with-deferred-observers
(lambda ()
(module-export! (current-module) ',names))))
@@ -2956,7 +2958,7 @@
(defmacro re-export names
`(eval-case
- ((load-toplevel)
+ ((load-toplevel compile-toplevel)
(call-with-deferred-observers
(lambda ()
(module-re-export! (current-module) ',names))))
--
1.5.5-rc2.GIT
[-- Attachment #9: Type: text/plain, Size: 25 bytes --]
--
http://wingolog.org/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: guile-vm 0.7 released
2008-05-20 13:42 guile-vm 0.7 released Andy Wingo
@ 2008-05-21 11:56 ` Ludovic Courtès
2008-05-21 15:20 ` Han-Wen Nienhuys
1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2008-05-21 11:56 UTC (permalink / raw)
To: guile-devel
Hello!
Andy Wingo <wingo@pobox.com> writes:
> I've released version 0.7 of guile-vm.
Great news!
(BTW, Keisuke's last release was labeled 0.5, IIRC. There are links in
`README'.)
> I also have to apologize again for not working in Ludovic's doc updates,
> or responding properly -- my mail is still borked. Perhaps it will
> unbork today.
Use Gmane! :-)
> * The code generated by Guile-VM is OK. The preambles are quite crap
> though.
Besides, I think we need to consider providing proper alignment for
instructions, i.e., 32-bit alignment. I recall a paper about a VM
implementation that indicated this would noticeably improve performance
on most architectures.
Besides, having variable-size instructions is also questionable, as
storage is no longer a scarce resource.
> * Debugging currently sucks, there is no source-level information, and
> I haven't yet been able to understand Kei's vision in that regard. I
> think that Ludovic knows more about this.
Not sure I know that much, but we'll see.
Thanks,
Ludo'.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: guile-vm 0.7 released
2008-05-20 13:42 guile-vm 0.7 released Andy Wingo
2008-05-21 11:56 ` Ludovic Courtès
@ 2008-05-21 15:20 ` Han-Wen Nienhuys
1 sibling, 0 replies; 3+ messages in thread
From: Han-Wen Nienhuys @ 2008-05-21 15:20 UTC (permalink / raw)
To: guile-devel
Andy Wingo escreveu:
> * Guile-VM does not currently offer a significant speed advantage over
> the interpreter. It is mostly faster by about 2 times or so, but
> sometimes slower. On the other hand I haven't profiled it yet. And,
> on the other other hand, loading compiled code is really quick.
On a related note: how close could this get to executing the C-bindings? The Guile
interpreter contains lots of C code that could have just as well have been
written in Scheme. It would be cool to drop some of this if there is no
speed penalty?
--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-21 15:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20 13:42 guile-vm 0.7 released Andy Wingo
2008-05-21 11:56 ` Ludovic Courtès
2008-05-21 15:20 ` Han-Wen Nienhuys
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).