Matt Birkholz [Sun, 4 Aug 2019 23:56:01 +0000 (16:56 -0700)]
Plugin builds: Restore dependence of stamp-scheme on -const.bin.
The stamp-scheme target builds -types.bin, not -const.bin. The
-const.bin comes from plugin-const.scm which comes from ./plugin-const
which comes from -const.c which is a product of stamp-shim.
Matt Birkholz [Thu, 25 Jul 2019 13:31:43 +0000 (08:31 -0500)]
Plugin Makefile.am improvements.
These were backported from recent improvements to x11/Makefile.am.
+ Use EXEEXT where appropriate.
+ Add MOSTLYCLEANFILES and mostlyclean-local.
+ Use TAGS_FILES and punt the ETAGS_ARGS misuse.
+ Add -adapter.lo to _shim_la_OBJECTS, not _shim_la_LIBADD.
+ Eliminate trailing whitespace.
+ Correct the copyright notices for x11 and x11-screen.
+ Punt stamp-scheme's dependence on -const.bin (redundant to the
dependence on stamp-shim).
Chris Hanson [Sat, 20 Jul 2019 08:33:57 +0000 (04:33 -0400)]
Change symbol<? to delegate to bytevector<?.
This is much faster than string comparison, which matters since symbols should
be fast. The downside is that symbols and strings will sort somewhat
differently, but that shouldn't matter since someone can always sort them using
symbol->string.
Chris Hanson [Fri, 19 Jul 2019 03:26:56 +0000 (23:26 -0400)]
Edwin: force subprocess I/O ports to use iso-8859-1 coding.
There may still be a problem with synchronous subprocesses, since we don't have
a way to get at those ports. If the process writes UTF-8, then the I/O copier
will try to write unicode chars to a buffer, and I'm not sure what will happen
in that case. It might just ignore the upper bits.
Chris Hanson [Wed, 17 Jul 2019 22:54:49 +0000 (18:54 -0400)]
Treat keyword-only syntax environments differently from runtime environments.
The former are those created by let-syntax and the like; the latter are models
of runtime environments as created by lambda.
This fixes a bug when let-syntax contains a bunch of definitions, which should
be defined in the parent environment of the let-syntax, because it's meaningless
to define them in the let-syntax environment itself. This was previously worked
around by heuristic means, but this change makes the definitions appear in the
correct syntactic environment corresponding to the runtime environment.
Chris Hanson [Tue, 9 Jul 2019 02:51:41 +0000 (22:51 -0400)]
Fix a bunch of problems caused by the call-with-values/values change.
First, SF was open-coding these, so that the compiled code wasn't using the new
convention. This caused problems at the boundary between interpreted code and
compiled code, and of course the compiled code was now incorrect. This is fixed
but requires stuff in host-adapter to make it work.
Second, eliminating the open-coding exposed a couple of places that would no
longer initialize correctly during the cold load because they were initialized
prior to the loading of the multiple-values procedures. This is fixed by
rewriting those to not use multiple values and have been marked with comments.
Finally, because the host-adapter file is now changing SF, SF must be loaded
prior to loading the host adapter. There was one case in the make file that
needed to be tweaked to make this guarantee.
Plot the new math functions and their condition numbers.
Plots are done purely in PostScript, so no additional tools required
on top of the existing PostScript/PDF stack we essentially already
depended on. Plots are cubic spline interpolations computed by a
little automatic differentiation library in PostScript.
Fix some mistakes in the prose characterizations of the condition
numbers that I had written.
Let SIGALRM do its thing even if we're on the right millisecond.
If we request a timer interrupt now in logic that closes a lot of
files, which runs through %deregister-io-descriptor, it looks like
_all_ the time is spent in closing files even if it's merely the case
that at least one file is closed every millisecond.
If we instead let SIGALRM do its thing, unless the interrupt is
_overdue_, then the profiler can discriminate at sub-millisecond
resolution where the time is spent which is what I really want.
Process pending thread events when unblocking them.
Partly fixes bug where profiler never got a chance to run when the
program was doing most of its work in short routines that block and
unblock thread events, like opening and closing files.
Only partly, because it seems something else unblocks thread events
without processing them -- until we do another block/unblock cycle as
in channel-close. Verified that very little time is actually spent
in channel-close; haven't yet tracked down who the culprit is.
Implement character replacement on ill-formed octet sequences.
- (utf8->string bv start end #t) now replaces by U+FFFD.
Existing behaviour of (utf8->string bv [start end]) is unchanged so
that utf8->string will fail noisily rather than quietly fail to be
invertible by string->utf8 on certain inputs.
- Generic I/O input now replaces ill-formed octet sequences by U+FFFD.
TODO: Add (port/set-coding-error port <action>) for <action> =
replace or <action> = error, perhaps.
TODO: This does not exactly implement the replacement algorithm
recommended as a best practice by Unicode 9, ยง3.9, pp. 127-129. That
algorithm is inconveneint because our decoder is factored into (a)
claiming a length based on the first code unit, and then (b)
consuming exactly that many bytes; the algorithm requires us to
refactor it so that part (b) can say `never mind' and consume fewer
bytes than (a) requeste.
This is a sleazy workaround: sometimes the input is really encoded as
UTF-8, but passing it through Scheme `strings' as ISO-8859-1 works
out to approximately the not-wrong thing. Really we should be
operating on octets, not on characters-as-if-they-were-octets.
Chris Hanson [Wed, 8 May 2019 06:50:48 +0000 (23:50 -0700)]
Treat strings returned from primitives as UTF-8 coded.
In particular, make sure that filenames are treated this way, because this is
normal for modern unix systems. This change mostly affects filenames, but also
environment variables and command-line strings.
This is necessary because strings passed to primitives are converted to UTF-8
bytevectors. Otherwise, a non-ASCII filename returned by a primitive won't be
converted back to the same bytes when passed to another primitive.
Chris Hanson [Sat, 16 Mar 2019 05:15:58 +0000 (22:15 -0700)]
Remove cleverness for SIGTERM and SIGHUP.
SIGTERM shouldn't be caught; instead just leave the default behavior. SIGHUP is
sent by Emacs when the *scheme* buffer is killed; it must kill the process or
we're left with a detached process.