1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

31 commits

Author SHA1 Message Date
Andy Wingo
a20ef7e769 Bump copyright years for user-visible copyright messages
* module/ice-9/command-line.scm (version-etc):
* module/scripts/compile.scm (show-version):
* module/system/repl/common.scm (*version*): Bump to 2021.
2021-01-07 13:00:46 +01:00
Andy Wingo
cb8cabe85f Delay loading CPS unless CPS compiler used
* module/language/tree-il/spec.scm: Remove #:compilers declaration;
  instead rely on choose-compiler.
  (choose-compiler): Load compilers on demand.
* module/system/base/compile.scm (find-language-joint): Use next-pass
  instead of lookup-compilation-order, to avoid loading unused
  compilers.
  (read-and-compile): Adapt to find-language-joint change.
  (compute-compiler): Export.
* module/scripts/compile.scm (compile): Use compute-compiler to load
  compiler modules.
2020-05-12 09:54:19 +02:00
Andy Wingo
6c741a04ef Fix "fail" helper in guild compile
* module/scripts/compile.scm (fail): Users expect this to be a format
  string, so adapt.
  (compile): Fix use that passed multiple strings.
2020-05-11 11:14:30 +02:00
Andy Wingo
4311dc9858 Define new "lowering" phase in compiler
* 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.
2020-05-08 17:07:56 +02:00
Andy Wingo
e9c0f3071d Warning and optimization levels always small integers
* 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.
2020-05-08 16:35:04 +02:00
Andy Wingo
220934c49d Wire up simplified warning levels in "guild compile"
* 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.
2020-05-08 16:03:32 +02:00
Andy Wingo
ad88afdc5e Bump user-visible copyright years to 2020
* module/ice-9/command-line.scm (version-etc):
* module/scripts/compile.scm (show-version): Bump to 2020.
2020-01-13 08:36:23 +01:00
Andy Wingo
0f61d8d797 Add --r6rs and --r7rs options to "guild compile"
* module/scripts/compile.scm (%options, compile): Add --r6rs and --r7rs
  options.
* doc/ref/api-evaluation.texi (Compilation): Add docs.
2019-12-02 17:32:34 +01:00
Ludovic Courtès
cbc2445eb1 compile: Update copyright year.
* module/scripts/compile.scm (show-version): Update copyright year.
2018-08-07 12:34:22 +02:00
Ludovic Courtès
240cc54659 compile: Improve error message.
* module/scripts/compile.scm (parse-args): Add missing newline in
"unrecognized option" message.
2018-08-07 12:34:17 +02:00
Ludovic Courtès
44cdabd9e3 compile: Add '-x' flag.
* module/scripts/compile.scm (%options, compile): Add '-x'.
* doc/ref/api-evaluation.texi (Compilation): Document it.
2018-08-07 12:34:11 +02:00
Ludovic Courtès
c91e9e9220 compile: Load language modules upfront.
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'.
2018-08-07 11:35:34 +02:00
Andy Wingo
16db934bbc Add (system base optimize) module
* 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.
2018-01-05 10:19:54 +01:00
Andy Wingo
f169be9fc8 Wire up `guild compile -O0 foo.scm'
* 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.
2015-10-22 17:44:17 +00:00
Mark H Weaver
856d318a9f Merge branch 'stable-2.0'
Conflicts:
	benchmark-suite/benchmarks/ports.bm
	libguile/async.h
	libguile/bytevectors.c
	libguile/foreign.c
	libguile/gsubr.c
	libguile/srfi-1.c
	libguile/vm-engine.h
	libguile/vm-i-scheme.c
	module/Makefile.am
	module/language/tree-il/analyze.scm
	module/language/tree-il/peval.scm
	module/scripts/compile.scm
	module/scripts/disassemble.scm
	test-suite/tests/asm-to-bytecode.test
	test-suite/tests/peval.test
	test-suite/tests/rdelim.test
2014-09-30 03:50:47 -04:00
Ludovic Courtès
2da97f1c7c 'guild compile' doesn't leave temporary files behind it.
* module/scripts/compile.scm (compile): Add 'sigaction' call.
* test-suite/standalone/test-guild-compile: New file.
* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.
2014-06-03 15:01:58 +02:00
Andy Wingo
691697de09 Rename "RTL" to "bytecode"
"RTL" didn't make any sense, and now that there's no other bytecode to
disambiguate against, just call it bytecode.

* module/Makefile.am:
* module/ice-9/eval-string.scm:
* module/language/bytecode.scm:
* module/language/bytecode/spec.scm:
* module/language/cps/arities.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/compile-rtl.scm:
* module/language/cps/contification.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/primitives.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/spec.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/rtl.scm:
* module/language/rtl/spec.scm:
* module/scripts/compile.scm:
* module/system/base/compile.scm:
* module/system/repl/common.scm:
* module/system/vm/assembler.scm:
* module/system/vm/debug.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/dwarf.scm:
* test-suite/tests/cross-compilation.test:
* test-suite/tests/dwarf.test:
* test-suite/tests/rtl-compilation.test:
* test-suite/tests/rtl.test:
* test-suite/vm/run-vm-tests.scm: Fixups.
2013-12-02 21:31:47 +01:00
Andy Wingo
84680d2382 Miscellaneous fixups related to objcode removal.
* module/scripts/compile.scm: Fix --help message.

* module/system/repl/command.scm (disassemble): Fix error message.

* module/system/vm/frame.scm: Remove objcode import.

* module/system/vm/objcode.scm: Remove some exports related to the
  objcode type.
2013-11-08 17:42:54 +01:00
Andy Wingo
b73a2ee017 Default to compiling to RTL
* module/ice-9/eval-string.scm (eval-string)
* module/language/tree-il/spec.scm (tree-il)
* module/scripts/compile.scm (compile)
* module/system/base/compile.scm (compile-file, read-and-compile)
* module/system/repl/common.scm (repl-compile, repl-prepare-eval-thunk):
  Default to compiling to RTL.

* module/language/rtl/spec.scm (rtl->value): Add value compiler.
2013-10-31 14:17:30 +01:00
Ludovic Courtès
d4b8894520 Add a --target' option to guild compile'.
* module/scripts/compile.scm (%options)["--target"]: New option.
  (show-version): Update copyright year.
  (compile): Use `with-target' to install the target.

* doc/ref/api-evaluation.texi (Compilation): Mention `--target' option.
2011-11-22 00:22:46 +01:00
Andy Wingo
a1a2ed5342 more work on "guild list"
* 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.
2011-07-23 17:50:41 +02:00
Ludovic Courtès
a4060f6710 Add `*current-warning-prefix*'.
* module/system/base/message.scm (*current-warning-prefix*): New
  variable.
  (%warning-types): Honor `*current-warning-prefix*'.

* module/scripts/compile.scm (compile): Use an empty
  `*current-warning-prefix*'.

* module/system/repl/common.scm (repl-compile): Likewise.

* test-suite/tests/tree-il.test (call-with-warnings): Likewise.
2011-02-13 19:13:36 +01:00
Andy Wingo
6f06e8d35f autocompile -> auto-compile
* NEWS:
* check-guile.in:
* doc/guile.1:
* doc/ref/scheme-scripts.texi:
* libguile/init.c:
* libguile/load.c:
* libguile/load.h:
* libguile/script.c:
* module/Makefile.am:
* module/ice-9/boot-9.scm:
* module/scripts/compile.scm:
* module/system/base/compile.scm:
* test-suite/Makefile.am:
* test-suite/tests/popen.test: Change "autocompile" to "auto-compile" or
  "auto_compile", as appropriate, in variable names, function names,
  command line arguments, and the documentation.
2011-02-13 15:06:11 +01:00
Ludovic Courtès
796c980a6a Placate `-Wformat'.
* module/scripts/compile.scm (fail): Use a fancy format string instead
  of a non-literal one.
2010-10-13 00:06:29 +02:00
Ludovic Courtès
bce5cb5641 Provide Guile-friendly `coding:' meta-data.
* module/ice-9/i18n.scm, module/rnrs/bytevector.scm,
  module/rnrs/io/ports.scm, module/scripts/compile.scm,
  module/srfi/srfi-35.scm, module/srfi/srfi-88.scm: Write `coding:'
  comment at the top.
2010-01-11 01:21:13 +01:00
Ludovic Courtès
54b38caf19 Add proper --help' and --version' for `guile-tools compile'.
* configure.ac: Produce `meta/guile-tools'.

* meta/Makefile.am (EXTRA_DIST): Add `guile-tools.in'.
  (bin_SCRIPTS): Remove `guile-tools'.

* meta/uninstalled-env.in (PATH): Add "${top_builddir}/meta".

* module/scripts/compile.scm (%options): Add `--version'.
  (parse-args): Show the offending option name upon error.
  (show-version): New.
  (compile): Use `%guile-bug-report-address'.
2009-08-15 14:18:57 +02:00
Ludovic Courtès
2e4c3227ce Add `(system base message)', a simple warning framework.
* module/Makefile.am (SOURCES): Add `system/base/message.scm'.

* module/scripts/compile.scm (%options): Add `--warn'.
  (parse-args): Update default value for `warnings'.
  (show-warning-help): New procedure.
  (compile)[compile-opts]: Add `#:warnings'.
  Update help message.

* module/system/base/compile.scm (compile): Sanity-check the requested
  warnings.

* module/system/base/message.scm: New file.
2009-07-31 00:49:22 +02:00
Neil Jerram
83ba2d3750 Complete changing license to LGPLv3+
(Still guile-readline to do, but that will all be GPLv3+.)
2009-06-17 22:30:26 +01:00
Andy Wingo
5e89cd13c0 disable autocompilation when running guile-tools compile
* module/scripts/compile.scm (compile): Disable autocompilation when
  running guile-tools compile.
2009-06-05 11:47:34 +02:00
Andy Wingo
fb3807793f scripts take rest args
* 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.
2009-04-20 18:20:01 +02:00
Andy Wingo
6d66647d5b guile-tools is a scheme script that loads scheme modules
* 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.
2009-04-17 11:19:42 +02:00
Renamed from scripts/compile (Browse further)