1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
guile/testsuite
Andy Wingo b0b180d522 nifty generic compiler infrastructure -- no more hardcoded passes
* module/system/base/language.scm (<language>): Rework so that instead of
  hardcoding passes in the language, we define compilers that translate
  from one language to another. Add `parser' to the language fields, a
  bit of a hack but useful for languages with s-expression external
  representations but with record internal representations.
  (define-language, *compilation-cache*, invalidate-compilation-cache!)
  (compute-compilation-order, lookup-compilation-order): Add an algorithm
  that does a depth-first search for a translation path from a source
  language to a target language, caching the result in a lookup table.

* module/language/scheme/spec.scm:
* module/language/ghil/spec.scm: Update to the new language format.

* module/language/glil/spec.scm: Add a language specification for GLIL,
  with a compiler to objcode. Also there are parsers and printers, for
  repl usage, but for some reason this doesn't work yet.

* module/language/objcode/spec.scm: Define a language specification for
  object code. There is some sleight of hand here, in the "compiler" to
  values; but there is method behind the madness, because this way we
  higher levels can pass environments (a module + externals pair) to
  objcode->program.

* module/language/value/spec.scm: Define a language specification for
  values. There is something intellectually dishonest about this, but it
  does serve its purpose as a foundation for the language hierarchy.

* configure.in:
* module/language/Makefile.am
* module/language/ghil/Makefile.am
* module/language/glil/Makefile.am
* module/language/objcode/Makefile.am
* module/language/value/Makefile.am:
  Autotomfoolery for the ghil, glil, objcode, and value languages.

* module/language/scheme/translate.scm (translate): Import the bits that
  understand `compile-time-environment' here, and pass on the relevant
  portions of the environment to the next compiler pass.

* module/system/base/compile.scm (current-language): New procedure, refs
  the current language fluid, or lazily sets it to scheme.
  (call-once, call-with-output-file/atomic): Refactor these bits to use
  with-throw-handler. No functional change.
  (compile-file, compile-and-load, compile-passes, compile-fold)
  (compile): Refactor the public interface of the compiler to be generic
  and simple. Uses `lookup-compilation-order' to find a path from the
  source language to the target language.

* module/system/base/syntax.scm (define-type): Adapt to changes in
  define-record.
  (define-record): Instead of expecting all slots in the first form,
  expect them in the body, and let the first form hold the options.

* module/system/il/compile.scm (compile): Adapt to the compilation pass
  API (three in and two out).

* module/system/il/ghil.scm (<ghil-var>, <ghil-env>)
  (<ghil-toplevel-env>): Adapt to define-record changes.

* module/system/il/glil.scm (<glil-vars>): Adapt to define-record
  changes.
  (<glil>, print-glil): Add a GLIL record printer that uses unparse.
  (parse-glil, unparse-glil): Update unparse (formerly known as pprint),
  and write a parse function.

* module/system/repl/common.scm (<repl>): Adapt to define-record changes.
  (repl-parse): New function, parses the read form using the current
  language. Something of a hack.
  (repl-compile): Adapt to changes in `compile'.
  (repl-eval): Fix up the does-the-language-have-a-compiler check for
  changes in <language>.

* module/system/repl/repl.scm (start-repl): Parse the form before eval.

* module/system/repl/command.scm (describe): Parse.
  (compile): Be more generic.
  (compile-file): Adapt to changes in compile-file.
  (disassemble, time, profile, trace): Parse.

* module/system/vm/debug.scm:
* module/system/vm/assemble.scm: Adapt to define-record changes.

* module/language/scheme/translate.scm (receive): Fix an important bug
  that gave `receive' letrec semantics instead of let semantics. Whoops!
2008-11-14 22:42:31 +01:00
..
Makefile.am fix bug in self-tail-recursion with "external" variables; other sundries 2008-10-18 19:21:44 +02:00
run-vm-tests.scm nifty generic compiler infrastructure -- no more hardcoded passes 2008-11-14 22:42:31 +01:00
t-basic-contructs.scm Encode the length of constant lists/vectors on 2 octets instead of 1. 2008-04-25 19:09:30 +02:00
t-call-cc.scm allocate variables that are set! on the heap 2008-09-28 23:09:11 +02:00
t-catch.scm fix bug in compilation of and' and or'; more robust underflow detection. 2008-08-11 18:35:58 +02:00
t-closure.scm Fixed a Scheme translation bug; cleaned compilation with GCC 4. 2008-04-25 19:09:30 +02:00
t-closure2.scm Fixed a Scheme translation bug; cleaned compilation with GCC 4. 2008-04-25 19:09:30 +02:00
t-closure3.scm Fixed a Scheme translation bug; cleaned compilation with GCC 4. 2008-04-25 19:09:30 +02:00
t-closure4.scm fix bug in self-tail-recursion with "external" variables; other sundries 2008-10-18 19:21:44 +02:00
t-do-loop.scm Fixed a Scheme translation bug; cleaned compilation with GCC 4. 2008-04-25 19:09:30 +02:00
t-global-bindings.scm * src/objcodes.c (make_objcode_by_mmap): Fixed the error type when the 2008-04-25 19:09:30 +02:00
t-macros.scm Added support for defmacro' and define-macro' in the compiler. 2008-04-25 19:09:30 +02:00
t-macros2.scm Added support for defmacro' and define-macro' in the compiler. 2008-04-25 19:09:30 +02:00
t-map.scm fix bug in compilation of and' and or'; more robust underflow detection. 2008-08-11 18:35:58 +02:00
t-match.scm fix use-syntax / use-modules confusion -- fixes testsuites 2008-05-14 14:54:52 +02:00
t-mutual-toplevel-defines.scm Add instructions for doing very late binding 2008-05-19 17:46:05 +02:00
t-or.scm fix *another* bug in compiling `or'. incredible. 2008-09-13 14:19:20 +02:00
t-proc-with-setter.scm Fixed a Scheme translation bug; cleaned compilation with GCC 4. 2008-04-25 19:09:30 +02:00
t-quasiquote.scm fix compilation of quasiquote with splicing and improper lists 2008-09-30 23:41:16 +02:00
t-records.scm fix use-syntax / use-modules confusion -- fixes testsuites 2008-05-14 14:54:52 +02:00
t-values.scm fix for (apply values '(1)) 2008-11-01 18:37:48 +01:00
the-bug.txt * src/objcodes.c (make_objcode_by_mmap): Fixed the error type when the 2008-04-25 19:09:30 +02:00