mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
*** empty log message ***
This commit is contained in:
parent
c4c8c433b9
commit
0b5437c988
7 changed files with 50 additions and 52 deletions
|
@ -1,3 +1,7 @@
|
|||
2001-04-07 Keisuke Nishida <kxn30@po.cwru.edu>
|
||||
|
||||
* Version 0.4 is released.
|
||||
|
||||
2000-08-20 Keisuke Nishida <kxn30@po.cwru.edu>
|
||||
|
||||
* Version 0.2 is released.
|
||||
|
|
78
README
78
README
|
@ -1,77 +1,67 @@
|
|||
Installation
|
||||
------------
|
||||
|
||||
% ./autogen.sh
|
||||
1. Install the latest Guile from CVS.
|
||||
|
||||
2. Install slib.
|
||||
|
||||
3. Install Guile VM:
|
||||
|
||||
% configure
|
||||
% make
|
||||
% su
|
||||
# make install
|
||||
# ln -s module/{system,language} /usr/local/share/guile/site/
|
||||
% make install
|
||||
% ln -s module/{system,language} /usr/local/share/guile/site/
|
||||
|
||||
Add the following lines to your ~/.guile:
|
||||
4. Add the following lines to your ~/.guile:
|
||||
|
||||
(if (string=? (car (command-line)) "guile-vm")
|
||||
(begin
|
||||
(cond ((string=? (car (command-line)) "guile-vm")
|
||||
(use-modules (system repl repl))
|
||||
(start-repl 'r5rs)
|
||||
(start-repl 'gscheme)
|
||||
(quit)))
|
||||
|
||||
Example Session
|
||||
---------------
|
||||
|
||||
% guile-vm
|
||||
Standard Scheme (R5RS + syntax-case) interpreter 0.3 on Guile 1.4.1
|
||||
Guile Scheme interpreter 0.4 on Guile 1.4.1
|
||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
|
||||
Enter `,help' for help.
|
||||
r5rs@guile> (+ 1 2)
|
||||
gscheme@guile> (+ 1 2)
|
||||
$1 = 3
|
||||
r5rs@guile> ,c -c (+ 1 2) ;; Compile into GLIL
|
||||
gscheme@guile> ,c -c (+ 1 2) ;; Compile into GLIL
|
||||
(@asm (0 0 0 0)
|
||||
(const 1)
|
||||
(const 2)
|
||||
(add)
|
||||
(return))
|
||||
r5rs@guile> ,c -l (+ 1 2) ;; Compile into loadable code
|
||||
0 make-int8:0 ;; 0
|
||||
1 load-program #0
|
||||
8 return
|
||||
(add 2)
|
||||
(return 0))
|
||||
gscheme@guile> ,c (+ 1 2) ;; Compile into bootcode
|
||||
Disassembly of bootcode:
|
||||
|
||||
Bytecode #0:
|
||||
Compiled for Guile VM 0.4
|
||||
|
||||
nlocs = 0 nexts = 0
|
||||
|
||||
0 make-int8:1 ;; 1
|
||||
1 make-int8 2 ;; 2
|
||||
3 add
|
||||
4 return
|
||||
|
||||
r5rs@guile> ,c (+ 1 2) ;; Compile and disassemble
|
||||
Disassembly of #<program 0x810f75b>:
|
||||
|
||||
args = 0 rest = 0 locals = 0
|
||||
|
||||
Bytecode:
|
||||
|
||||
0 make-int8:1 ;; 1
|
||||
1 make-int8 2 ;; 2
|
||||
3 add
|
||||
4 return
|
||||
|
||||
r5rs@guile> (define (add x y) (+ x y))
|
||||
r5rs@guile> (add 1 2)
|
||||
gscheme@guile>
|
||||
gscheme@guile> (add 1 2)
|
||||
$2 = 3
|
||||
r5rs@guile> ,x add ;; Disassemble
|
||||
Disassembly of #<program 0x8125f70>:
|
||||
gscheme@guile> ,x add ;; Disassemble
|
||||
Disassembly of #<program add>:
|
||||
|
||||
args = 2 rest = 0 locals = 0
|
||||
nargs = 2 nrest = 0 nlocs = 0 nexts = 0
|
||||
|
||||
Bytecode:
|
||||
|
||||
0 local-ref 1
|
||||
2 local-ref:0
|
||||
3 add
|
||||
4 return
|
||||
0 local-ref 0
|
||||
2 local-ref 1
|
||||
4 add
|
||||
5 return
|
||||
|
||||
r5rs@guile>
|
||||
gscheme@guile>
|
||||
|
||||
Write Modules
|
||||
-------------
|
||||
|
@ -81,10 +71,10 @@ Write Modules
|
|||
:use-module (system vm load)
|
||||
:export (fib))
|
||||
|
||||
(load/compile "fib.gsm")
|
||||
(load/compile "fib.gs")
|
||||
----------------------------------------
|
||||
|
||||
---- fib.gsm ---------------------------
|
||||
---- fib.gs ----------------------------
|
||||
(define (fib n)
|
||||
(if (< n 2)
|
||||
1
|
||||
|
@ -98,7 +88,7 @@ executed by the Guile VM:
|
|||
guile> (use-modules (fib))
|
||||
guile> (time (fib 30))
|
||||
clock utime stime cutime cstime gctime
|
||||
2.89 2.88 0.00 0.00 0.00 0.00
|
||||
2.80 2.79 0.00 0.00 0.00 0.00
|
||||
$1 = 1346269
|
||||
guile> (define (fib n) (if (< n 2) 1 (+ (fib (- n 1)) (fib (- n 2)))))
|
||||
guile> (time (fib 30))
|
||||
|
|
2
THANKS
2
THANKS
|
@ -1 +1 @@
|
|||
Guile VM was motivated by QScheme and librep.
|
||||
Guile VM was inspired by QScheme, librep, and Objective Caml.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
AC_INIT(src/guile-vm.c)
|
||||
AM_INIT_AUTOMAKE(guile-vm, 0.3)
|
||||
AM_INIT_AUTOMAKE(guile-vm, 0.4)
|
||||
AM_CONFIG_HEADER(src/config.h)
|
||||
|
||||
GUILE_FLAGS
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
dist-hook:
|
||||
mkdir $(distdir)/module
|
||||
$(TAR) cf - --exclude=CVS $(srcdir)/language $(srcdir)/system \
|
||||
| (cd $(distdir)/module; $(TAR) xf -)
|
|
@ -123,7 +123,7 @@
|
|||
|
||||
(define-language gscheme
|
||||
:title "Guile Scheme"
|
||||
:version "0.3"
|
||||
:version "0.4"
|
||||
:reader read
|
||||
:expander expand
|
||||
:translator translate
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
(compiled (object-file-name file)))
|
||||
(if (or (not (file-exists? compiled))
|
||||
(> (stat:mtime (stat file)) (stat:mtime (stat compiled))))
|
||||
(compile-file-in file #f (lookup-language 'gscheme) :O))
|
||||
(compile-file-in file #f (lookup-language 'gscheme) #:O))
|
||||
(let ((bytes (make-uniform-vector (stat:size (stat compiled)) #\a)))
|
||||
(call-with-input-file compiled
|
||||
(lambda (p) (uniform-vector-read! bytes p)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue