From scripts/compile pushed default assumption of #:from as 'scheme down
into system/base/compile where filename and first line can be used to
deduce intended "from" language. If first line of a file is of the form
#lang ecmascript
then the file is assumed consist of source language "ecmascript".
* module/scripts/compile.scm (compile): changed default #:from to #f
from 'scheme
* module/system/base/compile.scm(lang-from-port, %file-extension-map,
add-lang-extension, lang-extension-for): added global
%file-extension-map with accessor lang-extension-for and updater
add-lang-extension. Also, added lang-from-port to parse first line,
looking for #lang.
* test-suite/tests.scm: added "load-lang" test.
* test-suite/Makefile.am(SCM_TESTS): added tests/load-lang.test
* module/language/cps/compile-bytecode.scm (compile-bytecode):
* module/language/tree-il/compile-bytecode.scm (compile-bytecode):
* module/language/tree-il/compile-cps.scm (compile-cps): Rely on
compiler to lower incoming term already.
* module/language/tree-il/optimize.scm (make-lowerer): New procedure.
* module/system/base/compile.scm (compute-lowerer): New procedure,
replaceing add-default-optimizations.
(compute-compiler): Lower before running compiler.
* module/system/base/language.scm (<language>): Change
optimizations-for-level field to "lowerer".
* module/scripts/compile.scm (%options, compile): Parse -O0, -O1 and so
on to #:optimization-level instead of expanding to all the
optimization flags.
* module/language/cps/optimize.scm (lower-cps): Move here from
compile-bytecode.scm.
(make-cps-lowerer): New function.
* module/language/cps/spec.scm (cps): Declare lowerer.
* module/language/tree-il/analyze.scm (make-analyzer): Expect an int for
optimization level.
* module/scripts/compile.scm (%options, show-warning-help): No more
-Wnone / Wall; use -W0 or -W9 instead.
* module/system/base/compile.scm (level-validator): Validate small int.
(compute-analyzer, add-default-optimizations): Likewise.
* test-suite/tests/optargs.test (without-compiler-warnings):
* test-suite/tests/tree-il.test (call-with-warnings): Parameterize level
to 0, not #f.
* bootstrap/Makefile.am (GUILE_WARNINGS): Use -W0, not -Wnone.
* am/guilec (GUILE_WARNINGS):
* am/bootstrap.am (GUILE_WARNINGS): Explictly default to -W1.
* bootstrap/Makefile.am (GUILE_WARNINGS): Set to -Wnone, as the meaning
of "no -W flags" has changed to be effectively -W1.
* module/scripts/compile.scm (%options): Adapt to parse -Wnone, -W2, and
so on.
(parse-args): Default to (default-warning-level).
(show-warning-help): Add more warning help.
(compile): Pass #:warning-level.
Fixes a bug whereby "guild compile --target=arm-linux-gnueabihf
--from=elisp ... language/elisp/boot.el" would fail with an exception
from 'load-thunk-from-memory' while trying to load (language elisp spec)
from the guile-being-compiled instead of using that of the
guile-for-build.
The problem did not manifest with --from=scheme because (language scheme
spec) happened to be already loaded before we had changed %load-path.
* module/scripts/compile.scm (compile): Add calls to 'lookup-language'.
* module/system/base/optimize.scm: New module.
* module/Makefile.am (SOURCES):
* am/bootstrap.am (SOURCES): Add new module.
* module/language/tree-il/optimize.scm (tree-il-optimizations): Rename
from tree-il-default-optimization-options. Directly specify the
optimization level at which a pass should be enabled.
* module/language/cps/optimize.scm (cps-optimizations): Likewise, rename
from cps-default-optimization-options.
* module/scripts/compile.scm (%options, show-optimization-help): Adapt
to use new module.
* module/scripts/compile.scm (%options): Resurrect -O option and make it
follow GCC, more or less. The default is equivalent to -O2.
* module/language/cps/compile-bytecode.scm (lower-cps):
* module/language/cps/optimize.scm (optimize-higher-order-cps): Move
split-rec to run unconditionally for now, as closure conversion fails
without it.
(define-optimizer): Only verify the result if we are debugging, to
save time.
(cps-default-optimization-options): New exported procedure.
* module/language/tree-il/optimize.scm
(tree-il-default-optimization-options): New exported procedure.
* module/scripts/: Add %summary entries, and in many cases,
%include-in-guild-list entries to inhibit a script from appearing in
"guild list". Update list.scm to respect this new variable.
* meta/guile-tools: Instead of fixing scripts I should have been fixing
the script runner.
* module/scripts/compile.scm:
* module/scripts/snarf-guile-m4-docs.scm: Fix to take rest args.
* meta/guile-tools: Changed to be a scheme script. Instead of looking for
executables in a "scripts dir", we just look for modules in (scripts),
and load the modules directly.
* module/Makefile.am:
* module/scripts/: Move the scripts into module/ so they can be compiled.
Rename scripts from `foo' to `foo.scm'.
* libguile/Makefile.am: Invoke the snarf->texi code via guile-tools.
* configure.in:
* .gitignore: Update for changes.