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

11201 commits

Author SHA1 Message Date
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Neil Jerram
a89cafc056 Update README on using libraries in non-standard locations
* README: Update instructions on using libraries in non-standard
  locations.  Also change expected next stable release number from
  1.10.0 to 2.0.0.
2009-06-14 18:41:50 +01:00
Neil Jerram
5aaccd35a2 Add Tex and texinfo output and auxiliary suffixes to .gitignore 2009-06-14 18:07:01 +01:00
Neil Jerram
39b94fee43 Provide easier configure options for GMP and readline
This patch uses the AC_LIB_LINKFLAGS macro, provided by Gnulib's
havelib module, to provide --with-gmp-prefix and
--with-readline-prefix configure options.  Many thanks to Bruno Haible
for suggesting and explaining this to me.

* configure.in (top level): Add AC_LIB_LINKFLAGS(gmp).

* guile-readline/configure.in (AC_CONFIG_AUX_DIR): Change to
  ../build-aux, to share the main build-aux directory and so avoid
  having to distribute multiple copies of config.rpath.
  (top level): Add AC_LIB_LINKFLAGS(readline).

* lib/Makefile.am, m4/gnulib-cache.m4: Regenerated by gnulib-tool for
  new import of the `havelib' module.
2009-06-14 17:58:15 +01:00
Neil Jerram
f856c2b6d7 Fix for make distcheck
* examples/Makefile.am (AM_CFLAGS, AM_LIBS): Set PATH so that
  guile-config can find guile.
2009-06-13 12:17:23 +01:00
Neil Jerram
62e9a9b704 Fix `make distcheck'
* libguile/r6rs-ports.c (scm_init_r6rs_ports): Add libguile/ to
  included .x file name.
2009-06-12 23:04:48 +01:00
Neil Jerram
dffd0672fa Note Andy as a contributor 2009-06-11 23:24:34 +01:00
Andy Wingo
76e834686e fix defmacro*, defmacro*-public
* module/ice-9/boot-9.scm (define-private): Remove apocyphal comment. The
  FIXME would really be to remove `define-private', though...

* module/ice-9/optargs.scm (defmacro*, defmacro*-public): Fix these
  macros. Thanks to Dale Smith for the report.
2009-06-10 10:53:22 +02:00
Andy Wingo
de3d1fc988 bump default stack limit to 160000 words
* libguile/eval.c (scm_debug_opts): Up the default stack limit by a
  factor of 4. Psyntax expansions currently bounce back and forth between
  the VM and the interpreter, due to `map'. (Hopefully that won't be the
  case in the future, when have map in scheme, and we get an inliner.)
  Anyway when expanding a big nested expression, as for example in
  (language ecmascript compile-ghil) -- the pmatch code ends up being
  super-nested -- we can consume loads o stack.

  So given that on desktop machines, where rlimit is likely to be unset,
  default rlimits are around 8 or 10 MB or so, let's bump up our default
  limit to 640KB (on 32-bit). Should be enough for anyone.

  See http://thread.gmane.org/gmane.lisp.guile.devel/8599/focus=8662 for
  more info. Thanks to Mark H. Weaver for the diagnosis!
2009-06-10 10:53:22 +02:00
Andy Wingo
9ea12179ff fix debug-options
* module/ice-9/boot-9.scm (define-option-interface): Fix (debug-options
  'full), along with other options. Thanks to Mark Weaver for the tip.

* THANKS: Update, though many more names need to be added.
2009-06-10 00:03:52 +02:00
Andy Wingo
8f9b968329 some attempts to solve the ecmascript stack overflow problem
* module/language/ecmascript/compile-ghil.scm (comp): Just use pmatch,
  not ormatch. Now with syncase running over everything, it doesn't
  matter.

* module/ice-9/boot-9.scm (false-if-exception): Avoid saving stacks
  inside false-if-exception. There's probably a more general solution to
  this, though. Fixes getting bogus backtraces sometimes.

* module/Makefile.am (ECMASCRIPT_LANG_SOURCES): Reorder things so that
  spec comes last.
2009-06-09 23:42:05 +02:00
Andy Wingo
ac4d09b164 a start to changing VM scheme copyrights
* module/language/tree-il/primitives.scm: Change copyright to LGPLv2.1.
  Others will follow.
2009-06-08 22:44:01 +02:00
Andy Wingo
65dd9e3846 pretty-print psyntax-pp.scm
* module/ice-9/compile-psyntax.scm: Pretty-print psyntax-pp.scm, given
  that we are going to compile it anyway.

* module/ice-9/psyntax-pp.scm: Regenerated.
2009-06-08 22:44:01 +02:00
Andy Wingo
8dd42d3bc9 don't autocompile snarfing m4 docs
* doc/ref/Makefile.am (autoconf-macros.texi): Yet another place we
  shouldn't autocompile.
2009-06-08 11:44:51 +02:00
Andy Wingo
55dce020bd fix bootstrapping after last night's psyntax patch
* module/Makefile.am (ice-9/psyntax-pp.scm): Don't try autocompiling when
  making psyntax-pp.scm.

* module/ice-9/psyntax-pp.scm: Regenerated.

* module/ice-9/psyntax.scm (chi-top): Only affect the compile-time
  environment if modules have booted.
2009-06-08 01:04:16 +02:00
Andy Wingo
f4aa8d53a0 call-with-values can make fewer closures
* module/language/tree-il.scm: Rename let-exp and letrec-exp to let-body
  and letrec-body. Add <let-values>, a one-expression let-values that
  should avoid the needless creation of two closures in many common
  multiple-value cases. We'll need to add an optimization pass to the
  compiler to produce this form, though, as well as rewriting lambdas
  into lets, etc.

  I added this form instead of adding more special cases to the
  call-with-values compile code because it's a useful intermediate form
  -- it will allow the optimizer to perform constant folding across more
  code.

* module/language/tree-il.scm (parse-tree-il, unparse-tree-il)
  (tree-il->scheme, post-order!, pre-order!): Adapt to let/letrec body
  renaming, and let-values.

* module/language/tree-il/analyze.scm (analyze-lexicals): Adapt for
  renaming, and add cases for let-values.

* module/language/tree-il/compile-glil.scm (flatten): Add a new context,
  `vals', used by let-values code for the values producer. Code that
  produces multiple values can then jump to the let-values MV return
  address directly, instead of trampolining into a procedure. Add code to
  compile let-values.
2009-06-08 00:38:49 +02:00
Andy Wingo
c0ee32452f fix incorrect inlining of + when + is locally redefined
* libguile/vm-i-scheme.c (FUNC2): Use a signed value for the intermediate
  result here. Not sure what the effect is, though.

* module/ice-9/psyntax.scm (chi-top): Toplevel definitions ensure that
  variables are defined in the current module. Fixes the specific case of
  guile-lib's md5.scm, which redefines + -- this code is needed so that
  we don't incorrectly open-code +.

* module/language/tree-il/primitives.scm (resolve-primitives!): I think
  there were some cases in which vars and names would not resolve
  properly here. Fix those.
2009-06-07 00:53:48 +02:00
Andy Wingo
586cfdecfa new instructions: make-int64, make-uint64
* doc/ref/vm.texi (Loading Instructions): Remove references to
  load-integer and load-unsigned-integer -- they're still in the VM but
  will be removed at some point.
  (Data Control Instructions): Add make-int64 and make-uint64.

* libguile/vm-i-loader.c (load-unsigned-integer): Allow 8-byte values.
  But this instruction is on its way out, yo.

* libguile/vm-i-system.c (make-int64, make-uint64): New instructions.

* module/language/assembly.scm (object->assembly): Write out make-int64
  and make-uint64 instructions, using bytevectors to do the endianness
  conversion.
  (assembly->object): And pretty-print them back, for disassembly.

* module/language/glil/compile-assembly.scm: Don't generate load-integer
  / load-unsigned-integer instructions.
2009-06-07 00:53:48 +02:00
Andy Wingo
4bcc952d45 fix bug in goops' method cache with rest args
* module/oop/goops/compile.scm (code-table-lookup): Fix a tricky little
  bug!

* test-suite/tests/goops.test ("the method cache"): Add a wee test.
2009-06-07 00:53:48 +02:00
Neil Jerram
12798872ff Fix popen.test on NetBSD and Ubuntu Jaunty, where sh is not Bash
Thanks to Greg Troxel for reporting, and Barry Fishman for the
explanation and fix.

* test-suite/tests/popen.test ("open-input-pipe"): Use shell function
  `read' with an explicit argument, as apparently not all shells
  support read with no argument.
2009-06-06 00:15:32 +01:00
Andy Wingo
a23c940b71 support ((@ ...) ...) where the car is a macro
* module/ice-9/psyntax.scm (syntax-type): Remove `external-macro', not
  used any more. Take an extra arg, `for-car?', indicating that we're
  checking on the type of a form in the car position. In the case that
  the expression is a pair, do a full recursion on the car, which allows
  us to catch the fact that the car of the following form is a macro:
     ((@ (ice-9 optargs) let-optional) ...)
  and thus the form itself should be macroexpanded.

  But, since we want to distingush `lambda' from `(lambda ...)', just as
  we have global and global-call, we have core to the new `core-form'.

  (chi-top, chi, chi-expr, chi-body, set!): Adapt to changes to
  syntax-type.
2009-06-06 00:30:05 +02:00
Neil Jerram
8a8d0ca2fd State and explain dependency on libtool 2.2
* HACKING: Updated to recommend libtool 2.2 and anti-recommend libtool
  1.5.26.
2009-06-05 22:57:52 +01:00
Neil Jerram
cabf1b31a3 Fix `Mismatching FUNC_NAME' warning from guile-func-name-check
* libguile/bytevectors.c (FUNC_NAME): Change to match function name.
2009-06-05 22:54:45 +01:00
Andy Wingo
782a82eed1 add ability to compile uniform arrays
* module/rnrs/bytevector.scm (rnrs):
* libguile/bytevectors.h:
* libguile/bytevectors.c (scm_uniform_array_to_bytevector): New function.

* libguile/unif.h:
* libguile/unif.c (scm_from_contiguous_typed_array): New function.

* libguile/vm-i-loader.c (load-array): New instruction, for loading byte
  data into uniform vectors. Currently it copies out the data, though in
  the future we could avoid that.

* module/language/assembly.scm (align-code): New exported function,
  aligns code on some boundary.
  (align-program): Use align-code.

* module/language/assembly/compile-bytecode.scm (write-bytecode): Support
  the load-array instruction.

* module/language/glil/compile-assembly.scm (dump-object): Dump uniform
  arrays. Neat :)
2009-06-05 16:31:38 +02:00
Andy Wingo
a9b0f876c1 add long-object-ref, long-toplevel-ref, long-toplevel-set
* libguile/vm-i-system.c (long-object-ref, long-toplevel-ref)
  (long-toplevel-set): Add new instructions, for accessing the object
  table with a 16-bit offset. HTMLprag defines a test program that has
  more than 256 constants, necessitating this addition.

* doc/ref/vm.texi: Mention the new instructions.

* module/language/glil/compile-assembly.scm: Emit long refs for object
  tables bigger than 256 entries.
2009-06-05 12:08:02 +02: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
b7393ea123 refactoring for toplevel-ref, toplevel-set, link-now
* libguile/vm-i-system.c (toplevel-ref, toplevel-set)
* libguile/vm-i-loader.c (link-now):
* libguile/vm.c (resolve_variable): Factor out common code to a static
  method. The compiler can still inline it, so it shouldn't have a
  significant performance effect.

* libguile/vm-engine.c (vm_error_no_such_module): Remove now-unused
  label.
2009-06-05 11:47:19 +02:00
Andy Wingo
42193dac58 add gperf-generated files to git
* lib/iconv_open-osf.h:
* lib/iconv_open-aix.h:
* lib/iconv_open-hpux.h:
* lib/iconv_open-irix.h: Add to git. Should remove build-time dep on
  gperf; we'll see if this causes problems.
2009-06-05 10:56:34 +02:00
Andy Wingo
535fb833b3 stamp .go with timestamp of .scm; a fresh go has same mtime of .scm
* libguile/load.c (compiled_is_fresh): Rename from compiled_is_newer.
  Check that the mtines of the .go and .scm match exactly, so we don't
  get fooled by rsync-like modifications of the filesystem.

* module/system/base/compile.scm (call-with-output-file/atomic): Add
  optional arg, a reference file. If present we utime the output file to
  match the source file, before the rename.
  (compile-file): Stamp the .go file with the timestamp of the .scm.
2009-06-05 10:51:21 +02:00
Andy Wingo
822aacbcf4 compile and install srfi-98.
* module/Makefile.am (SRFI_SOURCES): Add SRFI-98.
2009-06-05 10:32:52 +02:00
Andy Wingo
628132c5ac final (?) tweaks to the autocompile code
* libguile/load.c (do_try_autocompile): Use module_variable, not
  module_lookup, when resolving compile-file, so we get #f instead of an
  exception if the compiler is in the process of being loaded.
  (scm_primitive_load_path): In what I hope is the last patch to this
  code, recheck the fallback path if we found a stale installed .go file.
2009-06-05 10:24:35 +02:00
Andy Wingo
3c997c4ba9 simplify autocompilation some more
* libguile/load.c (scm_init_load_path): Set the fallback path even if
  GUILE_SYSTEM_COMPILED_PATH is set. Now that we store full paths in the
  autocompiled files, and the path contains the effective Guile version,
  there's no danger of accidental collisions.
  (do_try_autocompile, autocompile_catch_handler, scm_try_autocompile):
  Simplify again -- since there's only one place we put autocompiled
  files, and compile-file finds it itself, there's no need to pass along
  the compiled file path.
  (scm_primitive_load_path): Don't call out to compiled-file-name to get
  the fallback path, as we might not be autocompiling, and besides that
  we need to check if the file exists at all.

* module/system/base/compile.scm (compiled-file-name): Simplify again.
  The auto-compiled path is just fallback path + full source path + .go.
2009-06-05 10:06:39 +02:00
Andy Wingo
5ea401bffe further autocompilation tweaks
* module/system/base/compile.scm (compiled-file-name):
* libguile/load.c (scm_init_load_path, scm_try_autocompile)
  (scm_primitive_load_path): Rework so that we search for .go files in
  the load-compiled path and in the fallback path, but we only
  autocompile to the fallback path. Should produce a more desirable experience.
2009-06-05 01:20:19 +02:00
Andy Wingo
b193d904bb propagate timestamps to installed .scm and .go files
* am/guilec: Propagate timestamps of .scm and .go files on to their
  installed variants. Helps the is-the-.go-file-stale? code do its job.
2009-06-04 23:11:55 +02:00
Andy Wingo
a46b7f14af fix .go installation
* am/guilec (nobase_ccache_DATA): Fix .go installation.
2009-06-04 12:53:34 +02:00
Andy Wingo
e27f640a6f turn off autocompilation when snarfing
* libguile/Makefile.am (snarf2checkedtexi): Turn off autocompilation when
  snarfing.
2009-06-04 12:47:47 +02:00
Andy Wingo
c2521a2124 fix error autocompiling parts of the compiler; make check works
* libguile/load.c (scm_try_autocompile): Punt if compiled-file-name does
  not resolve, which would indicate that the file in question is part of
  the compiler itself.

* test-suite/tests/elisp.test: Today I was an evil one -- disable
  autocompilation for the elisp tests, as they are meant only for the
  memoizer's eyes. Hopefully Daniel will fix this :-)
2009-06-03 23:59:58 +02:00
Andy Wingo
6fd367e742 tweaks to autocompile code
* libguile/load.c (compiled_is_newer): Tweak diagnostic output.
  (do_try_autocompile, autocompile_catch_handler, scm_try_autocompile):
  Rework to compute the name of the compiled file in advance. If the
  computed name is different from the found .go file and is fresh, use it
  directly.

  Fixes the case where /usr/lib/.../foo.go is out of date but the user
  doesn't have permissions to recompile, so we use the user's local
  compile cache instead if it's fresh.

  (scm_primitive_load): Pass the found .go file as well to
  scm_try_autocompile.
2009-06-03 23:20:44 +02:00
Andy Wingo
ee00175026 implement autocompilation
* am/guilec (.scm.go): Set GUILE_AUTO_COMPILE=0 when compiling individual
  files, and remove the mkdir -p as compile-file takes care of that now.

* libguile/load.c (do_try_autocompile, autocompile_catch_handler)
  (scm_try_autocompile, scm_init_load): Implement autocompilation.

* libguile/script.c (scm_shell_usage, scm_compile_shell_switches): Add
  --autocompile / --no-autocompile command-line options, and support for
  the GUILE_AUTO_COMPILE environment variable, defaulting to
  autocompilation enabled.
2009-06-03 22:20:55 +02:00
Andy Wingo
0fb81f95b0 add exception_on_error optional arg to primitive-load-path
* libguile/init.c (scm_load_startup_files): Use
  scm_c_primitive_load_path.

* libguile/load.c (scm_primitive_load_path): Add an optional arg,
  exception_on_error, which if #f will cause primitive-load-path to just
  return #f if no file is found. This is to help out the semantics of
  try-module-autoload. We can't just catch misc-error, because loading
  the file could raise any exception.
  (scm_c_primitive_load_path): Add the extra arg to
  scm_primitive_load_path.

* libguile/load.h: Adapt scm_primitive_load_path prototype.

* module/ice-9/boot-9.scm (try-module-autoload): Refactor slightly to be
  clearer.
2009-06-03 22:20:55 +02:00
Andy Wingo
1d022387c8 refactors to load.c to support auto-compilation
* libguile/load.c (compiled_is_newer): Factored out of
  scm_primitive_load_path.
  (scm_try_autocompile): New stub, for autocompiling. Currently just
  returns false.
  (scm_primitive_load_path): Refactor, and call out to
  scm_try_autocompile if the .go is missing or not fresh.
2009-06-03 22:20:55 +02:00
Andy Wingo
f3130a2ecf compiled-file-name tries to put the .go in the %load-compiled-path
* module/system/base/compile.scm (ensure-writable-dir): Rename from
  ensure-directory.
  (dsu-sort): Helper, does a decorate / sort / undecorate.
  (compiled-file-name): Refactor to only return a writable filename. The
  readable case is handled by load.c now, and the other case was silly.
  Hopefully it will do the right thing.
  (load-ensuring-compiled): Remove, load.c will call out to compile-file
  if necessary.
  (ensure-fallback-path): Remove, load.c will add the ~/.guile-ccache dir
  to the load-compiled path, which will prompt its creation if necessary.
2009-06-03 22:20:55 +02:00
Andy Wingo
4c9c9b9b98 install .go files under $libdir, not $datadir
* am/guilec: Install .go files to
  $(pkglibdir)/$GUILE_EFFECTIVE_VERSION/ccache.
2009-06-03 22:20:55 +02:00
Andy Wingo
727c259ac5 file-exists? doesn't cause a throw, simpler try-module-autoload
* module/ice-9/boot-9.scm (file-exists?): Change to use the stat
  interface that doesn't throw exceptions.
  (try-module-autoload): Simplify to take advantage of the fact that
  primitive-load-path does the right thing with regards to loading
  compiled files if they are available.
2009-06-03 22:20:55 +02:00
Andy Wingo
d1e47c6e6c update uninstalled-env.in for load-compiled path separation
* meta/uninstalled-env.in: Update to set GUILE_LOAD_COMPILED_PATH and
  GUILE_SYSTEM_COMPILED_PATH.
2009-06-03 22:20:55 +02:00
Andy Wingo
fcb6f5ff33 add exception-on-error optional arg to `stat' in scheme
* libguile/filesys.h:
* libguile/filesys.c (scm_stat): Add optional arg, exception-on-error,
  which if #f (not the default) will just return #f instead of raising an
  exception if the stat fails.
2009-06-03 22:20:55 +02:00
Andy Wingo
5b197db838 separate the load-compiled path from the load path
* libguile/Makefile.am (libpath.h): Add definitions for SCM_CCACHE_DIR
  and SCM_EFFECTIVE_VERSION. These are private, the header is not
  installed. Add ccachedir to build-info. Rework some other build-info
  definitions.

* libguile/load.c (scm_loc_load_compiled_path): New global, corresponding
  to the new environment variable, GUILE_LOAD_COMPILED_PATH. Compiled
  files will now be searched for in this path, and only in this path.
  (scm_init_load_path): Init the load-compiled path too. We initialize it
  with $pkglibdir/guile/$effective_version/ccache, and also with
  $HOME/.guile-ccache/$effective_version/. This will respect the
  libdir/datadir difference, and it is a preparation for automatic
  compilation support.
  (scm_primitive_load_path): Search only the GUILE_LOAD_COMPILED_PATH for
  compiled files.
  (scm_init_load): Cache scm_loc_load_compiled_path.
2009-06-03 22:20:54 +02:00
Julian Graham
2f9ae9b104 Merge branch 'master' of git://git.savannah.gnu.org/guile 2009-06-02 09:35:02 -04:00
Julian Graham
922d417bf4 Implementation of SRFI-98 (An interface to access environment variables).
* NEWS: Add SRFI-98 to 1.8.7 features.

* doc/ref/srfi-modules.text (SRFI-98): Documentation for SRFI-98.

* module/srfi/srfi-98.scm: New file.  SRFI-98 implementation.

* test-suite/tests/srfi-98.test: New file.  SRFI-98 unit tests.
2009-05-30 21:19:59 -04:00
Andy Wingo
938d46a35d Merge branch 'syncase-in-boot-9'
Conflicts:
	module/Makefile.am
2009-05-29 16:01:43 +02:00