Andy Wingo [Sun, 11 May 2008 19:48:10 +0000 (21:48 +0200)]
<foo>? -> foo?; some exports cleanups
* module/system/base/compile.scm: Export cenv? also.
* module/system/base/syntax.scm: Clean up vestiges of the old structure
code. Make accessors defined as foo? instead of <foo>?.
* module/system/il/glil.scm:
* module/system/il/ghil.scm: Remove <foo>-1 accessors, since we have
named accessors.
Andy Wingo [Sun, 11 May 2008 19:30:02 +0000 (21:30 +0200)]
pmatchify a cond for prettiness
* module/language/scheme/translate.scm: pmatchify, it's prettier.
Andy Wingo [Sun, 11 May 2008 18:53:47 +0000 (20:53 +0200)]
fix to meta-reader's optional port argument
* module/system/repl/repl.scm (meta-reader): Make the generated read
procedure accept a port argument.
Andy Wingo [Fri, 9 May 2008 11:21:23 +0000 (13:21 +0200)]
ice-9 history integration
* module/system/repl/repl.scm (start-repl): (ice-9 history) integration
via the before-eval-hook and the before-print-hook.
Andy Wingo [Fri, 9 May 2008 11:15:15 +0000 (13:15 +0200)]
readline integration for guile-vm
* module/system/repl/common.scm (repl-prompt): Return a string instead of
outputting to the port, for better readline integration.
* module/system/repl/repl.scm (meta-reader, prompting-meta-read)
(start-repl): Integrate with (ice-9 readline) via the current-reader
fluid and the repl-reader function, both from boot-9.scm.
Andy Wingo [Fri, 9 May 2008 10:14:15 +0000 (12:14 +0200)]
more exports cleanups
* module/system/repl/common.scm: Declare exports in the module
declaration.
Andy Wingo [Fri, 9 May 2008 10:08:06 +0000 (12:08 +0200)]
multiple-values help for the repl; exports cleanups
* module/system/repl/command.scm (system): Declare exports in the module
declaration.
* module/system/repl/repl.scm (start-repl): If the evaluation returns
multiple values, print them separately.
Andy Wingo [Sun, 4 May 2008 15:25:13 +0000 (17:25 +0200)]
Replace ice-9 match's structures with guile's records
* module/system/base/syntax.scm (define-record): Rebase to implement on
top of Guile's records, which are the substrate of srfi-9's records.
(%compute-initargs): Rename from %make-struct, just return the list of
values.
(get-slot, set-slot!, slot): Removed, no longer used.
(record-case): Allow slots of the form (MYNAME SLOTNAME), which binds
SLOTNAME to MYNAME (instead of SLOTNAME to SLOTNAME).
(record-case, record?): No more ice-9 match!
* module/system/il/compile.scm (codegen): Tweaks so that the new record
code works.
* module/system/il/ghil.scm: Fix some slot references.
* module/system/vm/assemble.scm (preprocess, codegen): Remove calls to
`slot'.
(codegen): Fix some slot references.
Andy Wingo [Sun, 4 May 2008 14:26:56 +0000 (16:26 +0200)]
Removed dot-expander syntax foo
* module/system/base/syntax.scm (expand-dot!, expand-symbol, syntax):
Removed, we don't use this syntax any more.
Andy Wingo [Sun, 4 May 2008 14:25:36 +0000 (16:25 +0200)]
finish dedottifying
* module/system/base/compile.scm: Dedottify.
* module/system/base/language.scm: Export language accessors.
* module/system/repl/common.scm: Dedottify. It's ugly, I know.
Andy Wingo [Sun, 4 May 2008 14:12:36 +0000 (16:12 +0200)]
more dedottification, almost done
* module/system/repl/common.scm:
* module/system/base/compile.scm: Export some more things.
* module/system/repl/command.scm: Dedottify.
Andy Wingo [Sun, 4 May 2008 13:59:40 +0000 (15:59 +0200)]
Dedottify some more
* module/system/il/compile.scm: Dedottify.
* module/system/il/ghil.scm: Export some more thingies.
Andy Wingo [Sun, 4 May 2008 13:37:54 +0000 (15:37 +0200)]
procedures-with-setters, debitrot `optimize', dedottification
* module/system/base/syntax.scm (define-record): Define the accessors as
procedures-with-setters, not just as getters.
* module/system/il/compile.scm (optimize): This function was bitrotten
since the addition of source locations in
cb4cca12e719edfef1740f238d9187c21c8e1e35. Untested attempts to
de-bitrot it. Dedottify as well.
* module/system/il/ghil.scm:
* module/system/il/glil.scm (unparse):
* module/system/vm/debug.scm (debugger-repl): Ongoing dedottification.
Andy Wingo [Sun, 4 May 2008 12:28:16 +0000 (14:28 +0200)]
fix errors in (language scheme translate) introduced in pmatchification
* module/language/scheme/translate.scm (trans-pair): Fix some errors
introduced in pmatchification.
Andy Wingo [Sun, 4 May 2008 12:03:53 +0000 (14:03 +0200)]
Start the process of de-dottification.
* module/system/vm/assemble.scm: De-dottify.
Andy Wingo [Sun, 4 May 2008 11:54:41 +0000 (13:54 +0200)]
Define named accessors for legacy record types
* module/system/base/syntax.scm (define-record): Define named accessors,
to prepare the code for srfi-9 records switchover.
* module/system/il/ghil.scm:
* module/system/il/glil.scm: Export a bunch of named accessors.
Andy Wingo [Sun, 4 May 2008 11:26:00 +0000 (13:26 +0200)]
Refactor (language scheme translate) to use pmatch
* module/language/scheme/translate.scm: Refactor use of `match' to use
`pmatch'. Relatively straightforward.
* module/system/base/pmatch.scm (ppat): Fix some copy-n-paste bugs: the _
rule, the quote rule.
Andy Wingo [Sat, 3 May 2008 17:39:41 +0000 (19:39 +0200)]
more pmatchification
* module/system/il/ghil.scm: No need for a match
* module/system/repl/command.scm: Pmatchify
* module/system/vm/disasm.scm: Pmatchify.
Andy Wingo [Sat, 3 May 2008 17:38:10 +0000 (19:38 +0200)]
bugfix to make-cenv
* module/system/base/compile.scm (make-cenv): Fix make-cenv.
Andy Wingo [Sat, 3 May 2008 17:23:45 +0000 (19:23 +0200)]
start using pmatch instead of match
* module/system/base/Makefile.am: Add pmatch.scm.
* module/system/base/pmatch.scm: New file, taken from Dan Friedman's
alpha-kanren paper. Implements a less magical match syntax, pmatch.
* module/system/vm/assemble.scm: No more need for (ice-9 match).
* module/system/vm/conv.scm (code-pack, code->object): Change to use
pmatch.
Andy Wingo [Sat, 3 May 2008 17:13:51 +0000 (19:13 +0200)]
s/match-lambda\*/case-lambda/g
* module/system/il/macros.scm: Use case-lambda from srfi-16 rather than
match-lambda*.
Andy Wingo [Sat, 3 May 2008 16:47:05 +0000 (18:47 +0200)]
convert a couple more modules to record-case
* module/system/base/syntax.scm (record-case): Capture the match macro.
* module/system/il/glil.scm:
* module/system/il/compile.scm: Convert to record-case.
Andy Wingo [Sat, 3 May 2008 16:32:46 +0000 (18:32 +0200)]
unify variant types and records; also make-foo instead of <foo>
* module/system/base/syntax.scm (define-record): Rework to separate the
type and its constructor. Now (define-record (<foo> bar)) will create
`make-foo' as the constructor, not `<foo>'. Also the constructor now
takes either keyword or positional arguments, so that it can be used as
the implementation of variant types as well.
(|): Map directly to define-record instead of rolling our own thing.
* module/language/scheme/translate.scm:
* module/system/base/language.scm:
* module/system/il/compile.scm:
* module/system/il/ghil.scm:
* module/system/il/glil.scm:
* module/system/repl/common.scm:
* module/system/vm/assemble.scm:
* module/system/vm/debug.scm: Change instances of record creation to use
the make-foo procedures instead of <foo>. Adjust module exports as
necessary.
Andy Wingo [Sat, 3 May 2008 12:52:36 +0000 (14:52 +0200)]
Convert assemble.scm to use record-case.
* module/system/base/syntax.scm (record?): Temporarily export this thing,
so that code will remain correct when I change to srfi-9 records.
* module/system/vm/assemble.scm: Convert to use record-case.
Andy Wingo [Sat, 3 May 2008 12:00:45 +0000 (14:00 +0200)]
fix to (system base syntax)'s syntax
* module/system/base/syntax.scm: Fix define-module
Andy Wingo [Sat, 3 May 2008 11:55:33 +0000 (13:55 +0200)]
rebase record-case on `match'
* module/system/base/syntax.scm (record-case): Rebase on `match', for
transition purposes.
Andy Wingo [Sat, 3 May 2008 11:46:56 +0000 (13:46 +0200)]
pull in srfi-9, implement record-case
* module/system/base/syntax.scm: Pull in srfi-9. Define a record-case
macro that will replace (match foo (($ <type> slot ...) body...)).
Andy Wingo [Fri, 2 May 2008 16:59:04 +0000 (18:59 +0200)]
clean up some syntax imports and exports
* module/system/base/syntax.scm (system): Don't re-export receive or
and-let*; modules should explicitly import these if they want to. Don't
export an empty stack-catch definition!
* module/system/repl/command.scm (system): Pull in and-let*.
* module/system/vm/disasm.scm (system): Don't import and-let*.
Andy Wingo [Fri, 2 May 2008 15:51:34 +0000 (17:51 +0200)]
remove module.scm
* module/system/base/module.scm: Removed module.scm, as it was unused
(see
9419ff9ae91c93983972797e607e135ecd1233bb).
Andy Wingo [Fri, 2 May 2008 15:35:25 +0000 (17:35 +0200)]
cleanups in syntax.scm
* benchmark/lib.scm (fibo): Make fibo actually a fibonacci sequence.
* module/system/base/syntax.scm (system): Forward-declare all exports.
(expand-symbol, slot): Rewrite expand-symbol to expand to a
non-recursive invocation of `slot', so that in the future when we get
rid of this syntax, the replacement will be more palatable to the eyes.
Ludovic Courtes [Sun, 30 Jul 2006 21:01:40 +0000 (21:01 +0000)]
Slowly improving support for macro compilation.
* module/language/scheme/translate.scm (¤t-macros): Removed.
(¤t-macro-module): Removed.
(&compile-time-module): New.
(eval-at-compile-time): New.
(translate): Initialize `&compile-time-module'.
(expand-macro)[use-syntax]: New case.
[begin let...]: Don't expand these built-in macros.
[else]: Rewrote the macro detection and invocation logic. Invoke macro
transformers in the current compile-time module.
(trans): Let `expand-macro' raise an exception if needed.
(trans-pair)[defmacro define-macro]: Evaluate the macro definition in
the compile-time module.
* testsuite/t-match.scm: Use `use-syntax' instead of `use-modules' for
`(ice-9 match)' and `(srfi srfi-9)'.
* testsuite/t-records.scm: Likewise.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-15
Ludovic Court`es [Tue, 10 Jan 2006 08:36:43 +0000 (08:36 +0000)]
Fixed `autogen.sh' and removed `module' from the list of dirs to build.
* autogen.sh: Fixed (call `libtoolize').
* Makefile.am (SUBDIRS): Removed `module' which doesn't build right now.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-16
Ludovic Courtes [Tue, 3 Jan 2006 23:13:30 +0000 (23:13 +0000)]
Improved macro handling; started documenting the issue.
* doc/guile-vm.texi (Compiling Scheme Code): New node.
* module/language/scheme/translate.scm (¤t-macro-module): New.
(translate): Evaluate macros in `¤t-macro-module'.
(trans-pair): Likewise.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-13
Ludovic Courtes [Mon, 2 Jan 2006 18:05:23 +0000 (18:05 +0000)]
Fixed the exception handler of `guilec'.
* src/guilec.in: Fixed the exception handler.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-12
Ludovic Courtes [Mon, 2 Jan 2006 18:04:04 +0000 (18:04 +0000)]
Encode the length of constant lists/vectors on 2 octets instead of 1.
* module/system/vm/assemble.scm (dump-object!): New sub-procedure
`too-long'. For `list' and `vector', encode the length on 2 octets
instead of 1 and report an error if a list/vector is longer than 65535.
* module/system/vm/disasm.scm (original-value): New sub-procedure
`list-or-vector?'; when true, return the number of elements for that
list/vector.
* src/vm_system.c (list): Fetch the length as a two-octet integer.
(vector): Likewise.
* testsuite/t-basic-contructs.scm: New.
* testsuite/Makefile.am (vm_test_files): Added the above file.
* module/system/vm/core.scm (load-compiled): Added a bit of
documentation.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-11
Ludovic Courtes [Mon, 2 Jan 2006 15:20:33 +0000 (15:20 +0000)]
Renamed the library from `libguilevm' to `libguile-vm'.
* src/Makefile.am (lib_LTLIBRARIES): Renamed to `libguilevm.la' to
`libguile-vm.la'.
* module/system/vm/core.scm: Dynamic-link "libguile-vm" instead of
"libguilevm.so".
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-10
Ludovic Courtes [Tue, 20 Dec 2005 23:22:11 +0000 (23:22 +0000)]
Added support for `defmacro' and `define-macro' in the compiler.
* module/language/scheme/translate.scm: Use `(srfi srfi-39)'.
(¤t-macros): New top-level.
(expand-macro): New.
(scheme-primitives): Renamed `%scheme-primitives'.
(%forbidden-primitives): New.
(trans): Use `expand-macro' instead of `macroexpand'.
(trans-pair): Handle `define-macro' and `defmacro'.
* module/system/base/compile.scm (call-with-compile-error-catch): Handle
non-pair LOC.
* testsuite/t-macros2.scm: New test case.
* testsuite/Makefile.am (vm_test_files): Updated.
* testsuite/t-macros.scm: Test `read-options'.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-9
Ludovic Courtes [Tue, 20 Dec 2005 23:12:10 +0000 (23:12 +0000)]
Fixed an "unbound variable" in `(system vm conv)'.
* module/system/vm/conv.scm: Autoload `(system vm core)' also when
`opcode->instruction' is hit. This fixes an "unbound variable" problem.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-8
Ludovic Courtes [Tue, 13 Dec 2005 21:33:50 +0000 (21:33 +0000)]
Fixed error handling; detect and report macro expansion errors.
* module/language/scheme/translate.scm (trans): Catch exceptions thrown
by `macroexpand' and throw a syntax error.
(trans-pair): Catch calls to `procedure->memoizing-macro' and raise a
syntax error.
* module/system/base/compile.scm (call-with-compile-error-catch): Made a
macro (a procedure doesn't do the job).
(compile-file): Uncommented call to `call-with-compile-error-catch'.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-7
Ludovic Courtes [Tue, 1 Nov 2005 23:24:15 +0000 (23:24 +0000)]
Tried compiling more code; augmented the doc.
* module/language/Makefile.am: New.
* module/language/scheme/Makefile.am: New.
* configure.in: Produce these two new Makefiles.
* doc/guile-vm.texi: Documented `compile-file', `compiled-file-name', and
`compile-in'.
* module/system/base/compile.scm: Cosmetic changes.
* module/system/base/language.scm: Likewise.
* module/system/il/Makefile.am: Tried (and failed) to compile more
things.
* module/system/vm/Makefile.am: All source files in here can now be
compiled without harming further compilation.
* module/system/vm/assemble.scm: Select only specific bindings from
`(system vm core)'.
(dump-object!): Show a more meaningful error message.
* module/system/vm/conv.scm: Select only specific bindings from `(system
vm core)'.
* module/system/vm/debug.scm: Likewise.
* module/system/vm/frame.scm: Changed the header. Use a renamer for
`(system vm core)'.
* src/guilec.in: Added options, via `getopt-long'.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-6
Ludovic Courtes [Tue, 1 Nov 2005 21:29:04 +0000 (21:29 +0000)]
Fixed a Scheme translation bug; cleaned compilation with GCC 4.
* module/language/scheme/translate.scm (trans-pair): In the `set!' case,
when a procedure-with-setter is passed, call `trans:pair' with an
actual pair. This fixes a long-lasting bug which prevented compilation
of `set!' statements with procedures-with-setter (this showed up when
compiling `(system vm assemble)').
* module/system/base/compile.scm: Added `objcode->u8vector' to the
`#:select' clause.
* module/system/base/syntax.scm: Cosmetic changes.
* module/system/vm/assemble.scm (preprocess): Removed debugging
statements.
* src/frames.c: Cosmetic changes.
* src/frames.h (SCM_FRAME_SET_DYNAMIC_LINK): New.
* src/objcodes.c: Use `scm_t_uint8' instead of `char' when relevant.
* src/vm.c (vm_heapify_frames_1): Use `SCM_FRAME_SET_DYNAMIC_LINK ()'.
* src/vm_loader.c: Added casts to mute GCC 4 warnings.
* testsuite/run-vm-tests.scm (*scheme*): Renamed to `%scheme'.
(run-test-from-file): Renamed to `compile/run-test-from-file'.
(run-vm-tests): Run each test using both the VM and the interpreter;
compare the results.
* testsuite/t-proc-with-setter.scm: Try out `get/set'.
* doc/Makefile.am (info_TEXINFOS): New.
* doc/guile-vm.texi: Added index entries and indices.
* doc/texinfo.tex: New file.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-5
Ludovic Court`es [Fri, 28 Oct 2005 14:49:25 +0000 (14:49 +0000)]
Minor binding name clash tweak.
* module/system/base/compile.scm: Only import `the-vm' and `vm-load' from
`(system vm core)'.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-10
Ludovic Courtes [Sat, 25 Jun 2005 06:57:20 +0000 (06:57 +0000)]
Started documenting the compiler.
* doc/guile-vm.texi: Documented the compiler (node `The Compiler').
Removed a number of things that might have been relevant to Guile-VM 0.0.
* module/system/il/compile.scm (optimize): Commented out the case
using `<ghil-inst?>'.
* src/vm_engine.c (vm_run)[objects_handle]: New variable.
Before leaving the function, release OBJECTS_HANDLE.
* src/vm_engine.h (CACHE_PROGRAM): Use `scm_vector_writable_elements'
instead of `scm_vector_elements'; don't release the handle right away.
* src/vm_loader.c (load-program): New commented out piece of code
dealing with simple vectors.
* src/vm_system.c (object-ref): Added the type of OBJNUM.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-3
Ludovic Courtes [Sat, 25 Jun 2005 03:13:56 +0000 (03:13 +0000)]
* src/objcodes.c (make_objcode_by_mmap): Fixed the error type when the
object file is too small.
* doc/guile-vm.texi: Documented `make-closure'. Improved the documentation
of `load-program'.
* testsuite: New directory.
* configure.in: Added `testsuite/Makefile' to `AC_OUTPUT'.
* Makefile.am (SUBDIRS): Added `testsuite'.
* src/vm_engine.h (VM_CHECK_OBJECT): New option.
(CHECK_OBJECT): New macro.
* src/vm_system.c (object-ref): Use VM_CHECK_OBJECT.
* module/system/vm/assemble.scm (preprocess): Commented out the debugging
code.
* benchmark/lib.scm (do-loop): New procedure.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-2
Ludovic Courtes [Fri, 24 Jun 2005 17:25:36 +0000 (17:25 +0000)]
Removed a few more deprecated function calls; documented closures.
* src/Makefile.am (.c.x): Fixed the rule.
* src/envs.c: Use `scm_hash_get_handle ()' instead of
`scm_sym2ovcell_soft ()' and `scm_hash_create_handle_x ()' instead of
`scm_intern_symbol ()'.
* src/objcodes.c (bytecode->objcode): Don't use `SCM_VALIDATE_INUM', use
`SCM_VALIDATE_NUMBER' instead.
(make_objcode_by_mmap): Check whether the file is smaller than the
magic cookies; check whether the magic cookies are there.
* src/frames.c (frame-local-ref): Likewise, but use `SCM_MAKE_VALIDATE'.
(frame-local-set!): Likewise.
* src/instructions.c (opcode->instruction): Likewise.
* src/programs.c (program-external-set!): New function.
* src/guile-disasm.in: New file.
* src/Makefile.am: Produce `guile-disasm'.
* doc/guile-vm.texi: Documented `external-ref', `external-set', `local-ref'
and `local-set'.
* module/system/vm/disasm.scm (disassemble-bytecode): Fixed the way
`load-program' is represented.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-1
Ludovic Court`es [Tue, 3 May 2005 15:13:42 +0000 (15:13 +0000)]
Playing with the procedure call mechanism.
* src/objcodes.c (do-pair): New experiment.
* src/vm_engine.h (ALIGN_AS_NON_IMMEDIATE): New macro.
(POP_LIST_ON_STACK): New experimental macro.
* src/vm_engine.c (call): In the procedure call case, I tried using the above
macro.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-8
Ludovic Court`es [Mon, 2 May 2005 16:32:32 +0000 (16:32 +0000)]
Fixed a stack leak. Now observing actual performance.
* src/*.[ch]: Replaced `scm_mem2symbol' by `scm_from_locale_symboln' and
`scm_ulong2num' by `scm_from_ulong'.
* src/vm_system.c (tail-call): Fixed stack leak (SP lacked decrement by
one more Scheme object in the tail-recursive case).
* benchmark/measure.scm (measure): Make sure we are using the compiled
procedure (i.e. a program object) when measuring. This yields better
results than before. :-)
* doc/guile-vm.texi: Augmented the instruction set documentation with
branch instructions, `call' and `tail-call'.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-7
Ludovic Court`es [Fri, 29 Apr 2005 14:12:12 +0000 (14:12 +0000)]
Improved the VM's efficiency. The VM is as fast as the interpreter. :-(
* benchmark/lib.scm: New file.
* benchmark/measure.scm: New file.
* README: Added useful pointers to various threads.
* doc/guile-vm.texi: Fixed the description of `load-program' (it now expects
_immediate_ integers).
* src/*.[ch]: Use immediate integers whereever possible, as in the original
code. For `CONS', use `scm_cell' rather than `scm_cons'.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-6
Ludovic Court`es [Thu, 28 Apr 2005 15:45:59 +0000 (15:45 +0000)]
Got the VM up and running! Augmented the documentation.
* src/*.[ch]: Replaced the remaining `SCM_MAKINUM', and changed `SCM_VELTS'
into `scm_vector_elements ()'.
* src/vm_loader.c (link): Fixed so that it pushed a variable object on
the stack.
* src/vm_system.c (variable-ref): Fixed so that it uses `scm_variable_ref ()'
and friends.
* module/system/vm/assemble.scm (dump-object!): Fixed the string case.
* src/vm_engine.h (CONS): Use `scm_cons' instead of `SCM_NEWCELL'.
* doc/guile-vm.texi: Added actual instruction definitions, explanations of
the program invocation mechanism, programs' object tables, etc., in the
`Instruction Set' chapter.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-5
Ludovic Court`es [Wed, 27 Apr 2005 09:36:52 +0000 (09:36 +0000)]
Fixed the compiler, got the disassembler working.
* doc/guile-vm.texi: Texified and cleaned up.
* src/vm.c: Use `scm_from_locale_string ()' instead of `scm_makfrom0str ()'.
* src/vm_engine.c: Likewise.
* src/programs.c (scm_program_bytecode): Return a u8vector instead of a string.
* module/system/vm/conv.scm (make-byte-decoder): Fixed a few things wrt. to
the string to u8vector transition.
* src/objcodes.c (bytecode->objcode): Fixed a bug where the last 10 bytes of
the bytecode where ignored.
* module/system/vm/assemble.scm (dump-object!): Don't convert everything
to a u8vector, keep strings where it makes sense.
* module/system/vm/conv.scm (code->bytes): Accordingly, convert strings to
u8vectors when needed.
(make-byte-decoder): Accordingly too, when decoding instructions, return
variable-length instructions' argument as strings except for `load-program'.
* module/system/vm/disasm.scm: Export `disassemble-bytecode'.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-4
Ludovic Court`es [Mon, 25 Apr 2005 16:56:18 +0000 (16:56 +0000)]
Updated the assembly process so that `u8vectors' are used. Compilation works.
* module/system/vm/conv.scm (encode-length): Use u8vectors.
(code->bytes): Likewise.
* module/system/vm/assemble.scm (codegen): Use u8vectors instead
of strings.
* src/objcodes.c (objcode->string): Removed.
(objcode->u8vector): New function.
* module/system/base/compile.scm (compile-file): Use `objcode->u8vector'
and `uniform-vector-write'.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-3
Ludovic Court`es [Fri, 22 Apr 2005 16:00:33 +0000 (16:00 +0000)]
Translation from Scheme to GHIL, and compilation to GLIL work.
* src/*.c: Removed calls to `scm_must_malloc', `SCM_MUST_MALLOC' and
`scm_must_free'. Same for `SCM_INUMP', `SCM_INUM', `SCM_STRING_CHARS',
and the likes.
* module/system/base/syntax.scm: Do not import `(ice-9 match)' and do
not re-export `match', do not export `syntax-error' which was not
defined here.
* module/system/base/compile.scm (call-with-compile-error-catch): Use
the `catch' form instead of `try'.
* src/instructions.c: Use `scm_from_char ()' instead of the deprecated
macro `SCM_MAKINUM ()'.
* src/instructions.h (scm_instruction): Made `npop' a signed char.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-2
Ludovic Court`es [Fri, 22 Apr 2005 11:07:06 +0000 (11:07 +0000)]
Updated the C code base so that it compiles with Guile 1.7.2.
* src/*.[ch]: Introduced changes so that it compiles with Guile 1.7.2.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-1
Keisuke Nishida [Wed, 2 May 2001 15:05:05 +0000 (15:05 +0000)]
*** empty log message ***
Keisuke Nishida [Wed, 25 Apr 2001 07:42:32 +0000 (07:42 +0000)]
*** empty log message ***
Keisuke Nishida [Wed, 25 Apr 2001 01:55:45 +0000 (01:55 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 23 Apr 2001 06:17:52 +0000 (06:17 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 23 Apr 2001 04:28:13 +0000 (04:28 +0000)]
*** empty log message ***
Keisuke Nishida [Sun, 22 Apr 2001 11:16:37 +0000 (11:16 +0000)]
*** empty log message ***
Keisuke Nishida [Sun, 22 Apr 2001 02:13:48 +0000 (02:13 +0000)]
*** empty log message ***
Keisuke Nishida [Fri, 20 Apr 2001 18:35:59 +0000 (18:35 +0000)]
*** empty log message ***
Keisuke Nishida [Fri, 20 Apr 2001 18:35:59 +0000 (18:35 +0000)]
*** empty log message ***
Keisuke Nishida [Thu, 19 Apr 2001 06:28:03 +0000 (06:28 +0000)]
*** empty log message ***
Keisuke Nishida [Thu, 19 Apr 2001 05:59:09 +0000 (05:59 +0000)]
*** empty log message ***
Keisuke Nishida [Thu, 19 Apr 2001 03:09:27 +0000 (03:09 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 16 Apr 2001 03:43:48 +0000 (03:43 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 16 Apr 2001 00:08:10 +0000 (00:08 +0000)]
*** empty log message ***
Keisuke Nishida [Sun, 15 Apr 2001 15:02:41 +0000 (15:02 +0000)]
*** empty log message ***
Keisuke Nishida [Sun, 15 Apr 2001 14:54:59 +0000 (14:54 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 14 Apr 2001 11:26:26 +0000 (11:26 +0000)]
SLIB init file for Guile.
Keisuke Nishida [Sat, 14 Apr 2001 11:24:45 +0000 (11:24 +0000)]
Import SLIB 2d1.
Keisuke Nishida [Thu, 12 Apr 2001 23:30:38 +0000 (23:30 +0000)]
*** empty log message ***
Keisuke Nishida [Thu, 12 Apr 2001 00:15:31 +0000 (00:15 +0000)]
*** empty log message ***
Keisuke Nishida [Wed, 11 Apr 2001 23:43:01 +0000 (23:43 +0000)]
*** empty log message ***
Keisuke Nishida [Wed, 11 Apr 2001 23:27:08 +0000 (23:27 +0000)]
*** empty log message ***
Keisuke Nishida [Wed, 11 Apr 2001 23:12:37 +0000 (23:12 +0000)]
*** empty log message ***
Keisuke Nishida [Wed, 11 Apr 2001 21:54:57 +0000 (21:54 +0000)]
*** empty log message ***
Keisuke Nishida [Wed, 11 Apr 2001 20:57:44 +0000 (20:57 +0000)]
*** empty log message ***
Keisuke Nishida [Tue, 10 Apr 2001 06:11:26 +0000 (06:11 +0000)]
*** empty log message ***
Keisuke Nishida [Tue, 10 Apr 2001 00:32:46 +0000 (00:32 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 9 Apr 2001 06:44:26 +0000 (06:44 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 9 Apr 2001 06:36:59 +0000 (06:36 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 9 Apr 2001 05:57:15 +0000 (05:57 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 9 Apr 2001 04:08:46 +0000 (04:08 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 9 Apr 2001 04:02:01 +0000 (04:02 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 9 Apr 2001 01:50:48 +0000 (01:50 +0000)]
*** empty log message ***
Keisuke Nishida [Mon, 9 Apr 2001 01:28:16 +0000 (01:28 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 23:32:30 +0000 (23:32 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 23:32:03 +0000 (23:32 +0000)]
apply
Keisuke Nishida [Sat, 7 Apr 2001 23:14:21 +0000 (23:14 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 12:56:11 +0000 (12:56 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 12:51:36 +0000 (12:51 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 12:36:57 +0000 (12:36 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 12:29:06 +0000 (12:29 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 12:13:40 +0000 (12:13 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 11:54:36 +0000 (11:54 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 10:16:48 +0000 (10:16 +0000)]
*** empty log message ***
Keisuke Nishida [Sat, 7 Apr 2001 09:39:38 +0000 (09:39 +0000)]
*** empty log message ***
Keisuke Nishida [Fri, 6 Apr 2001 23:15:53 +0000 (23:15 +0000)]
*** empty log message ***
Keisuke Nishida [Fri, 6 Apr 2001 10:06:32 +0000 (10:06 +0000)]
*** empty log message ***