mit-scheme.git
6 years agoExpose flo:radix = 2 too, just for good measure, and for assertions.
Taylor R Campbell [Sat, 27 Oct 2018 02:37:06 +0000 (02:37 +0000)]
Expose flo:radix = 2 too, just for good measure, and for assertions.

6 years agoExport primitive flonum-denormalize as flo:ldexp and flo:scalbn.
Taylor R Campbell [Sat, 27 Oct 2018 02:21:06 +0000 (02:21 +0000)]
Export primitive flonum-denormalize as flo:ldexp and flo:scalbn.

These are the familiar -- and when FLT_RADIX = 2, equivalent -- names
for the operation in libm.

`Denormalize' is not right: neither does it turn a normal number into
a subnormal, nor does it put anything into a canonical interval like
[1/2, 1) or [1, 2).  I personally favour `shift' -- it is, in Z, the
same as the bitwise shift operation.  But unless anyone else wants to
join me against this windmill I'll just stay with the familiar if
ugly libm names.

6 years agoDisable errno checking in libm functions.
Taylor R Campbell [Sat, 27 Oct 2018 02:11:27 +0000 (02:11 +0000)]
Disable errno checking in libm functions.

If there's a floating-point exception, we have a mechanism for
dealing with it -- and continuing without a trap if the user so
desires.

Leave in the restriction on flo:log1p and flo:expm1 because those are
implementation limitations in the i386 compiler; the full functions
are implemented in the runtime.

6 years agolog1pexp(x) is never exactly x even if that's the best approximation.
Taylor R Campbell [Sat, 27 Oct 2018 02:11:14 +0000 (02:11 +0000)]
log1pexp(x) is never exactly x even if that's the best approximation.

6 years agoTabify.
Taylor R Campbell [Sat, 27 Oct 2018 02:05:18 +0000 (02:05 +0000)]
Tabify.

6 years agoUse named constants rather than magic numbers.
Taylor R Campbell [Sat, 27 Oct 2018 02:04:17 +0000 (02:04 +0000)]
Use named constants rather than magic numbers.

6 years agoDefine and export some more floating-point parameters.
Taylor R Campbell [Sat, 27 Oct 2018 01:39:58 +0000 (01:39 +0000)]
Define and export some more floating-point parameters.

6 years agotest-driver is autocrud too.
Taylor R Campbell [Sat, 27 Oct 2018 00:37:54 +0000 (00:37 +0000)]
test-driver is autocrud too.

6 years agoSimple-minded criterion to compute x^-y by 1/x^y was too simple.
Taylor R Campbell [Sat, 27 Oct 2018 00:23:12 +0000 (00:23 +0000)]
Simple-minded criterion to compute x^-y by 1/x^y was too simple.

For any |x| > 1, we can't do this without comparing the size of
log(x) and y well enough to discern what might yield subnormal, so
might as well just compute the general case then.

6 years agoOmit unnecessary case for logistic. Add a test for this case.
Taylor R Campbell [Sat, 27 Oct 2018 00:03:42 +0000 (00:03 +0000)]
Omit unnecessary case for logistic.  Add a test for this case.

The relative error is small in naive evaluation of 1/(1 + e^{-x})
even if x is very negative.

6 years agoExtend expt to generate subnormals with exact integer exponents.
Taylor R Campbell [Fri, 26 Oct 2018 23:41:39 +0000 (23:41 +0000)]
Extend expt to generate subnormals with exact integer exponents.

6 years agoExpose the minimum and maximum finite normal floating-point exponents.
Taylor R Campbell [Fri, 26 Oct 2018 23:32:37 +0000 (23:32 +0000)]
Expose the minimum and maximum finite normal floating-point exponents.

6 years agoAdd some .gitignore files so I can use git status.
Taylor R Campbell [Fri, 26 Oct 2018 16:53:13 +0000 (16:53 +0000)]
Add some .gitignore files so I can use git status.

6 years agoNew primitives for ChaCha stream cipher core.
Taylor R Campbell [Fri, 26 Oct 2018 16:20:09 +0000 (16:20 +0000)]
New primitives for ChaCha stream cipher core.

Should maybe provide a version that produces many blocks of output,
and perhaps xor's them into an existing message, but this will do for
my needs now.  Plan to use this for a PRNG.

6 years agoFix unparser->print method fallout.
Taylor R Campbell [Fri, 26 Oct 2018 16:17:41 +0000 (16:17 +0000)]
Fix unparser->print method fallout.

6 years agoAvoid using uninitialized stack garbage.
Taylor R Campbell [Fri, 26 Oct 2018 16:17:10 +0000 (16:17 +0000)]
Avoid using uninitialized stack garbage.

6 years agoclock() returns (clock_t)-1 on error, not necessarily negative.
Taylor R Campbell [Fri, 26 Oct 2018 16:15:28 +0000 (16:15 +0000)]
clock() returns (clock_t)-1 on error, not necessarily negative.

If clock_t is unsigned, n < 0 is always false.  Compare for equality
with (clock_t)-1.

6 years agoBug reported by Arthur: case-fold-string was dropping tail of string.
Chris Hanson [Thu, 25 Oct 2018 21:21:08 +0000 (14:21 -0700)]
Bug reported by Arthur: case-fold-string was dropping tail of string.

6 years agoAdd --no-init-file to those places that might be calls to 9.2.
Chris Hanson [Thu, 25 Oct 2018 20:59:31 +0000 (13:59 -0700)]
Add --no-init-file to those places that might be calls to 9.2.

This isn't needed any more since --no-init-file is implied by --batch-mode, and
can be removed after the next release.

6 years agoApply the same bound to the other region.
Taylor R Campbell [Thu, 25 Oct 2018 05:33:57 +0000 (05:33 +0000)]
Apply the same bound to the other region.

6 years ago...yes, I know how to count.
Taylor R Campbell [Thu, 25 Oct 2018 05:25:37 +0000 (05:25 +0000)]
...yes, I know how to count.

6 years agoCatch more stray `.' loitering around.
Taylor R Campbell [Thu, 25 Oct 2018 05:22:00 +0000 (05:22 +0000)]
Catch more stray `.' loitering around.

6 years agoClarify justification for ditching the denominator.
Taylor R Campbell [Thu, 25 Oct 2018 05:21:46 +0000 (05:21 +0000)]
Clarify justification for ditching the denominator.

6 years agolog(a/b), not log(a)/log(b).
Taylor R Campbell [Thu, 25 Oct 2018 05:20:53 +0000 (05:20 +0000)]
log(a/b), not log(a)/log(b).

6 years agoOmit stray sentence terminator.
Taylor R Campbell [Thu, 25 Oct 2018 05:16:50 +0000 (05:16 +0000)]
Omit stray sentence terminator.

6 years agoThe bounds of Lemma 4 are <=, not <, as is this branch's condition.
Taylor R Campbell [Thu, 25 Oct 2018 05:09:48 +0000 (05:09 +0000)]
The bounds of Lemma 4 are <=, not <, as is this branch's condition.

6 years agoInadvertently substituted d0 for d2. Fix.
Taylor R Campbell [Thu, 25 Oct 2018 05:05:59 +0000 (05:05 +0000)]
Inadvertently substituted d0 for d2.  Fix.

No change in conclusion -- there was no convenient cancellation or
anything as a consequence of this.

6 years agoI accidentally a predicate.
Taylor R Campbell [Thu, 25 Oct 2018 05:02:39 +0000 (05:02 +0000)]
I accidentally a predicate.

6 years agoFix stray line, clarify, and simplify.
Taylor R Campbell [Thu, 25 Oct 2018 04:57:30 +0000 (04:57 +0000)]
Fix stray line, clarify, and simplify.

6 years agoAllow overlap of imports provided that the imported values are eqv?.
Chris Hanson [Thu, 25 Oct 2018 04:26:11 +0000 (21:26 -0700)]
Allow overlap of imports provided that the imported values are eqv?.

6 years agoImplement scheme-report-environment and null-environment.
Chris Hanson [Thu, 25 Oct 2018 02:14:01 +0000 (19:14 -0700)]
Implement scheme-report-environment and null-environment.

6 years agoAdd SRFI libraries.
Chris Hanson [Thu, 25 Oct 2018 01:53:11 +0000 (18:53 -0700)]
Add SRFI libraries.

6 years agoMerge branch 'riastradh-logisticerrbounds'
Taylor R Campbell [Thu, 25 Oct 2018 02:46:45 +0000 (02:46 +0000)]
Merge branch 'riastradh-logisticerrbounds'

6 years agoCompiling stuff depends on the cdecls' *-const.bin files.
Taylor R Campbell [Thu, 25 Oct 2018 02:45:40 +0000 (02:45 +0000)]
Compiling stuff depends on the cdecls' *-const.bin files.

6 years agoTest some more edge cases.
Taylor R Campbell [Thu, 25 Oct 2018 01:47:22 +0000 (01:47 +0000)]
Test some more edge cases.

6 years agoTest some edge cases for logit(near 1/2).
Taylor R Campbell [Thu, 25 Oct 2018 01:44:12 +0000 (01:44 +0000)]
Test some edge cases for logit(near 1/2).

6 years agoUse (assert-<= (relerr ...) bound) for better error messages.
Taylor R Campbell [Thu, 25 Oct 2018 01:43:40 +0000 (01:43 +0000)]
Use (assert-<= (relerr ...) bound) for better error messages.

6 years agoFix sense of test. Do this part only if 1 - p is guaranteed exact.
Taylor R Campbell [Thu, 25 Oct 2018 01:42:22 +0000 (01:42 +0000)]
Fix sense of test.  Do this part only if 1 - p is guaranteed exact.

6 years agoUse and prove bounds for a better formula for logit-exp.
Taylor R Campbell [Thu, 25 Oct 2018 01:41:53 +0000 (01:41 +0000)]
Use and prove bounds for a better formula for logit-exp.

6 years agoClarify some of the proofs and logic.
Taylor R Campbell [Thu, 25 Oct 2018 01:40:10 +0000 (01:40 +0000)]
Clarify some of the proofs and logic.

Style: Avoid log1p for anything but the floating-point approximation
just to be extra-clear; write log(1 + ...) in the math otherwise.

Reverse order of branches to make the condition (<= lo x hi) clearer.

6 years agoDon't show compilation dependencies by default.
Chris Hanson [Thu, 25 Oct 2018 00:09:59 +0000 (17:09 -0700)]
Don't show compilation dependencies by default.

6 years agoUse better formulas for logistic(negative) and logit(near 1/2).
Taylor R Campbell [Thu, 25 Oct 2018 00:05:37 +0000 (00:05 +0000)]
Use better formulas for logistic(negative) and logit(near 1/2).

Prove some error bounds in comments.

6 years agoFix up code to clean test subdirs.
Chris Hanson [Wed, 24 Oct 2018 21:03:55 +0000 (14:03 -0700)]
Fix up code to clean test subdirs.

6 years agoGet FFI tests working when run from a build directory.
Chris Hanson [Wed, 24 Oct 2018 20:57:24 +0000 (13:57 -0700)]
Get FFI tests working when run from a build directory.

6 years agoFix capitalization of error messages.
Chris Hanson [Wed, 24 Oct 2018 04:40:42 +0000 (21:40 -0700)]
Fix capitalization of error messages.

6 years agoImplement let-values and let*-values.
Chris Hanson [Wed, 24 Oct 2018 04:28:42 +0000 (21:28 -0700)]
Implement let-values and let*-values.

6 years agoChange scode libraries to carry both imports and imports-used.
Chris Hanson [Wed, 24 Oct 2018 04:26:45 +0000 (21:26 -0700)]
Change scode libraries to carry both imports and imports-used.

6 years agoChange ->environment to work with library names too.
Chris Hanson [Wed, 24 Oct 2018 03:18:48 +0000 (20:18 -0700)]
Change ->environment to work with library names too.

6 years agoRename current-load-library-db to current-library-db.
Chris Hanson [Wed, 24 Oct 2018 00:57:32 +0000 (17:57 -0700)]
Rename current-load-library-db to current-library-db.

6 years agoAdd code to enable x11/x11-screen only if X is available.
Chris Hanson [Wed, 24 Oct 2018 00:47:20 +0000 (17:47 -0700)]
Add code to enable x11/x11-screen only if X is available.

6 years agoMerge branch 'master' into makefile-refactor
Chris Hanson [Tue, 23 Oct 2018 21:12:52 +0000 (14:12 -0700)]
Merge branch 'master' into makefile-refactor

6 years agoChange plugin support to work in uninstalled build directory.
Chris Hanson [Tue, 23 Oct 2018 21:09:47 +0000 (14:09 -0700)]
Change plugin support to work in uninstalled build directory.

6 years agoChange cref/generate-trivial-constructor to default os-types compatibly.
Chris Hanson [Tue, 23 Oct 2018 21:08:56 +0000 (14:08 -0700)]
Change cref/generate-trivial-constructor to default os-types compatibly.

6 years agoSupport running edwin plugins in build directory.
Chris Hanson [Tue, 23 Oct 2018 21:08:35 +0000 (14:08 -0700)]
Support running edwin plugins in build directory.

6 years agoRefactor plugins to simplify compilation.
Chris Hanson [Tue, 23 Oct 2018 21:07:26 +0000 (14:07 -0700)]
Refactor plugins to simplify compilation.

6 years agofind_binding_cell: no bindings in a null environment
Matt Birkholz [Tue, 23 Oct 2018 18:39:51 +0000 (11:39 -0700)]
find_binding_cell: no bindings in a null environment

No need to fail an assert during test-library-loader neither.

6 years agoFix http-get; use binary IO and new open-binary-tcp-stream-socket.
Matt Birkholz [Tue, 23 Oct 2018 06:49:21 +0000 (23:49 -0700)]
Fix http-get; use binary IO and new open-binary-tcp-stream-socket.

6 years agoEliminate use of 'all arg to cref/generate-constructors.
Chris Hanson [Tue, 23 Oct 2018 02:44:40 +0000 (19:44 -0700)]
Eliminate use of 'all arg to cref/generate-constructors.

6 years agoEliminate obsolete option.
Chris Hanson [Tue, 23 Oct 2018 02:43:51 +0000 (19:43 -0700)]
Eliminate obsolete option.

6 years agoTighten range where it's worthwhile to evaluate this.
Taylor R Campbell [Mon, 22 Oct 2018 16:35:50 +0000 (16:35 +0000)]
Tighten range where it's worthwhile to evaluate this.

6 years agoMore changes so that installation works sort-of right.
Chris Hanson [Mon, 22 Oct 2018 08:06:31 +0000 (01:06 -0700)]
More changes so that installation works sort-of right.

6 years agoGet plugins working using the top-level makefile.
Chris Hanson [Mon, 22 Oct 2018 07:04:11 +0000 (00:04 -0700)]
Get plugins working using the top-level makefile.

Probably still some bugs; note workarounds for interaction between edwin and
blowfish/gdbm.  I'd like to fix those by making new plugins for the parts of
edwin that use those; that way they're installed only if both edwin and the
matching plugin is installed.

6 years agoMerge branch 'makefile-refactor' of git.sv.gnu.org:/srv/git/mit-scheme into makefile...
Chris Hanson [Mon, 22 Oct 2018 00:21:49 +0000 (17:21 -0700)]
Merge branch 'makefile-refactor' of git.sv.gnu.org:/srv/git/mit-scheme into makefile-refactor

6 years agoInitial draft of changes for optional modules.
Chris Hanson [Mon, 22 Oct 2018 00:20:07 +0000 (17:20 -0700)]
Initial draft of changes for optional modules.

6 years agoFix automake library goo.
Taylor R Campbell [Sun, 21 Oct 2018 17:14:34 +0000 (17:14 +0000)]
Fix automake library goo.

- Respect LDFLAGS in configure.
- Let automake figure out the .lo files.
- Specify -lX11 only if no pkg-config.

6 years agoOmit spurious redefinition of SCM in x11.h.
Taylor R Campbell [Sun, 21 Oct 2018 16:30:48 +0000 (16:30 +0000)]
Omit spurious redefinition of SCM in x11.h.

6 years agoSimplify 5*eps and assume the number of digits we wrote down.
Taylor R Campbell [Sun, 21 Oct 2018 07:21:32 +0000 (07:21 +0000)]
Simplify 5*eps and assume the number of digits we wrote down.

6 years agoAdd logistic/logit-family functions.
Taylor R Campbell [Sun, 21 Oct 2018 07:15:32 +0000 (07:15 +0000)]
Add logistic/logit-family functions.

Inverse pairs:

(logistic x) = 1/(1 + e^{-x})
(logit p) = log p/(1 - p)

(log-logistic x) = log 1/(1 + e^{-x})
(logit-exp t) = log e^t/(1 - e^t)

6 years agoDefine log1p and expm1 with no range limitations.
Taylor R Campbell [Sun, 21 Oct 2018 05:43:17 +0000 (05:43 +0000)]
Define log1p and expm1 with no range limitations.

6 years agoFix sloppy change: unintentionally downcased a file name.
Chris Hanson [Sun, 21 Oct 2018 02:13:44 +0000 (19:13 -0700)]
Fix sloppy change: unintentionally downcased a file name.

6 years agoFix C compiler warning of assigning register to itself.
Chris Hanson [Sat, 20 Oct 2018 23:38:25 +0000 (16:38 -0700)]
Fix C compiler warning of assigning register to itself.

6 years agoAdd missing dependency.
Chris Hanson [Sat, 20 Oct 2018 22:07:16 +0000 (15:07 -0700)]
Add missing dependency.

6 years agoFix typo in previous change.
Chris Hanson [Sat, 20 Oct 2018 07:52:23 +0000 (00:52 -0700)]
Fix typo in previous change.

6 years agoDon't use *-w32.* files for LIARC.
Chris Hanson [Sat, 20 Oct 2018 03:23:59 +0000 (20:23 -0700)]
Don't use *-w32.* files for LIARC.

6 years agoAttempt to make LIARC lap files more readable.
Chris Hanson [Sat, 20 Oct 2018 03:23:42 +0000 (20:23 -0700)]
Attempt to make LIARC lap files more readable.

6 years agoFix problem: MODULE_CFLAGS no longer exists.
Chris Hanson [Sat, 20 Oct 2018 03:23:02 +0000 (20:23 -0700)]
Fix problem: MODULE_CFLAGS no longer exists.

6 years agoFor --with-scheme-build, no need to make pathname absolute.
Chris Hanson [Sat, 20 Oct 2018 03:22:26 +0000 (20:22 -0700)]
For --with-scheme-build, no need to make pathname absolute.

6 years agoImplement MIT_SCHEME_COMPILER_TARGET for TL and microcode configuration.
Chris Hanson [Sat, 20 Oct 2018 03:21:29 +0000 (20:21 -0700)]
Implement MIT_SCHEME_COMPILER_TARGET for TL and microcode configuration.

6 years agoFix bug in LIARC that tried to compile unused code.
Chris Hanson [Sat, 20 Oct 2018 03:19:07 +0000 (20:19 -0700)]
Fix bug in LIARC that tried to compile unused code.

6 years agoFix bug in LIARC code generator.
Chris Hanson [Sat, 20 Oct 2018 03:18:08 +0000 (20:18 -0700)]
Fix bug in LIARC code generator.

6 years agoAdapt LIARC to use new strings.
Chris Hanson [Sat, 20 Oct 2018 03:16:29 +0000 (20:16 -0700)]
Adapt LIARC to use new strings.

6 years agoAdd --with-scheme-build to simplify building from another build.
Chris Hanson [Thu, 18 Oct 2018 23:05:17 +0000 (16:05 -0700)]
Add --with-scheme-build to simplify building from another build.

6 years agoAnother major refactoring, to split up cross host/target.
Chris Hanson [Thu, 18 Oct 2018 08:25:27 +0000 (01:25 -0700)]
Another major refactoring, to split up cross host/target.

Primary testing so far is for SVM.  To build SVM from 9.2 x86-64, do the
following:

1. Generate a new build with an SVM compiler:
     ./configure --with-compiler-target=svm
     make

2. Create a second build configured with:
     ./configure --enable-native-code=svm --enable-cross-compiling
     make
     make cross-target

6 years agoUpdate MacOSX -> macOS.
Chris Hanson [Thu, 18 Oct 2018 08:24:21 +0000 (01:24 -0700)]
Update MacOSX -> macOS.

6 years agoAdd "run-build" shell script to simplify working with uninstalled builds.
Chris Hanson [Wed, 17 Oct 2018 21:47:46 +0000 (14:47 -0700)]
Add "run-build" shell script to simplify working with uninstalled builds.

6 years agoBump version number coming into release.
Chris Hanson [Wed, 17 Oct 2018 21:47:24 +0000 (14:47 -0700)]
Bump version number coming into release.

6 years agoSplit handling of compiler target from host architecture.
Chris Hanson [Wed, 17 Oct 2018 02:28:14 +0000 (19:28 -0700)]
Split handling of compiler target from host architecture.

6 years agoMerge branch 'master' into makefile-refactor
Chris Hanson [Tue, 16 Oct 2018 04:22:23 +0000 (00:22 -0400)]
Merge branch 'master' into makefile-refactor

6 years agoLoad macros needed by machines/svm/machine.
Chris Hanson [Tue, 16 Oct 2018 04:14:55 +0000 (21:14 -0700)]
Load macros needed by machines/svm/machine.

6 years agoForgot to make changes to other compiler.pkg files.
Chris Hanson [Tue, 16 Oct 2018 04:14:06 +0000 (21:14 -0700)]
Forgot to make changes to other compiler.pkg files.

One of these days this stuff will be shared.

6 years agoEliminate warning about old-style function declaration.
Chris Hanson [Tue, 16 Oct 2018 04:07:20 +0000 (21:07 -0700)]
Eliminate warning about old-style function declaration.

6 years agoLoad macros needed by machines/svm/machine.
Chris Hanson [Mon, 15 Oct 2018 06:18:15 +0000 (23:18 -0700)]
Load macros needed by machines/svm/machine.

6 years agoAdd back guarantee since it's needed for compiling svm.
Chris Hanson [Mon, 15 Oct 2018 04:54:12 +0000 (21:54 -0700)]
Add back guarantee since it's needed for compiling svm.

6 years agoGuarantee that SF is loaded by compiler.sf.
Chris Hanson [Mon, 15 Oct 2018 04:53:52 +0000 (21:53 -0700)]
Guarantee that SF is loaded by compiler.sf.

6 years agoEliminate a bunch of now-unnecessary stuff from host-adapter.
Chris Hanson [Mon, 15 Oct 2018 03:50:20 +0000 (20:50 -0700)]
Eliminate a bunch of now-unnecessary stuff from host-adapter.

6 years agoRefactor top-level Makefile to use a single pass.
Chris Hanson [Mon, 15 Oct 2018 02:48:43 +0000 (19:48 -0700)]
Refactor top-level Makefile to use a single pass.

6 years agoFix bug where the result of char-upcase is multibyte.
Chris Hanson [Mon, 15 Oct 2018 01:46:32 +0000 (18:46 -0700)]
Fix bug where the result of char-upcase is multibyte.

This was previously hidden because the compiler isn't doing range checking on
the third argument to bytevector-u8-set!.

6 years agoRemove redundant clause from test for unquoted symbols.
Chris Hanson [Sun, 14 Oct 2018 04:38:16 +0000 (21:38 -0700)]
Remove redundant clause from test for unquoted symbols.

6 years agoDon't print "program" for R7RS top-level.
Chris Hanson [Sun, 14 Oct 2018 03:03:39 +0000 (20:03 -0700)]
Don't print "program" for R7RS top-level.

6 years agoExtensive work to get compiler to work with R7RS libraries.
Chris Hanson [Sun, 14 Oct 2018 02:54:58 +0000 (19:54 -0700)]
Extensive work to get compiler to work with R7RS libraries.

The bulk of the work is to refactor the debugging info so that it's generated
and consumed properly; this required upgrading the version and introducing a new
top-level info form.

I also eliminated the now-ancient and unused BSM file support, which was making
things more difficult than necessary.

The compiler top level required only to detect an R7RS input file and to compile
each part separately, plus collecting all of the debugging information from the
parts.  Some tweaks were used to make RTL/LAP files work right with multiple
roots.

Finally, the runtime system was modified so that compiled-code blocks and
entries now show the R7RS library name if there is one, both when printed and in
various other places.