The Racket repository
Go to file
Andy Keep 18b12f21fd Fixes and small improvements for type recovery.
Removed counter field from prelex, using the operand field instead to
provide the index into the fxmap.  This follows other uses within the compiler
where we use the operand field as a little place for state that is used
within a single pass.  This has a few advantages.  First, it keeps the record a
little smaller.  Second, it means that the prelex numbering can start from 0
for each compilation unit, which should help keep the numbers for the fxmap a
bit smaller in longer running sessions with multiple calls to the compiler.
Finally, it avoids adding to the burden of the tc-mutex, since within the pass
it is safe for us to set the prelexes, since only the instance of the pass
holding this block of code has a handle on it.  As part of this change
prelex-counter is now defined in cptypes and the operand is cleared after the
variables go out of scope.
  base-lang.ss

Fixed the highest-set-bit function in fxmap so that it will work in the 32-bit
versions of Chez Scheme.  The fxsrl by 32 raises an exception, and was leading
to tests to fail in 32-bit mode.
  fxmap.ss

Restructured predicate-implies? so that it uses committed choice instead of
uncommitted choice in comparing x and y.  Basically, this means, instead of
doing:
(or
  (and (predicate-1? x) (predicate-1? y) ---)
  (and (predicate-2? x) (predicate-2? y) ---)
  ...)
we now do:
(cond
  [(predicate-1? x) (and (predicate-1? y) ---)]
  [(predicate-2? x) (and (predicate-2? y) ---)]
  ...)
This avoids running predicates on x that we know will fail because an earlier
predicate matches, generally getting out of the predicate faster.  This did
require a little restructuring, because in some cases x was dominant and in
other cases y was dominant.  This is now restructured with y dominate, after
the eq? and x 'bottom check.

Replaced let-values calls with cata-morphism syntax, including removal of maps
that built up a list of values that then needed to be separated out with
(map car ...) (map cadr ...) etc. calls.  This avoid building up structures we
don't need, since the nanopass framework will generate a mutltivalued let for
these situations.

The if clause in cptypes/raw now uses types1 (the result of the recursive call
on e1) in place of the incoming types clause when processing the e2 or e3
expressions in the cases where e1 is known statically to produce either a false
or non-false value.

Fixed a bug with directly-applied variable arity lambda.  The original code
marked all directly-applied variable arity lambda's as producing bottom,
because it was chacking for the interface to be equal to the number of
arguments.  However, variable arity functions are represented with a negative
number.  For instance, the original code would transform the expression:
(begin
  ((lambda (a . b) (set! t (cons* b a t))) 'a 'b 'c)
  t)
to
((lambda (a . b) (set! t (cons* b a t))) 'a 'b 'c)
anticipating that the call would raise an error, however, it is a perfectly
valid (if some what unusual) expression.  I tried to come up with a test for
this, however, without building something fairly complicated, it is difficult
to get past cp0 without cp0 turning it into something like:
(let ([b (list 'b 'c)])
  (set! t (cons* b 'a t))
  t)

Fixed make-time, time-second-set!, and time-second to indicate that second can
be an exact-integer, since it is not really restricted to the fixnum range (and
if fact we even test this fact in the mats on 32-bit machines).
  primdata.ss

Changed check of prelex-was-assigned (which is not reliably on the input to any
give pass) with prelex-assigned, which should always have an accurate, if
conservative, value in it.

Added enable-type-recovery parameter to allow the type recover to be turned on
and off, and added cptype to the cp0 not run path that runs cpletrec, so that
cptypes can be run independent of cp0.  This is helpful for testing and allows
us to benefit from type recovery, even in cases where we do not want cp0 to
perform any inlining.
  compile.ss, front.ss, primdata.ss

Stylistic changes, mostly for consistency with other parts of the compiler,
though I'm not married to these changes if you'd really prefer to keep things
the way the are.
1. clauses of define-record type now use parenthesis instead of square brackets.
2. indented by 2 spaces where things were only indented by one space
3. define, let, define-pass, nanopass pass productions clauses, now use
   parenthesis for outer markers instead of square brackets.
  fxmap.ss,

original commit: 5c6c5a534ff708d4bff23f6fd48fe6726a5c4e05
2018-04-12 21:54:01 -03:00
.travis More complete build script with checking. 2018-01-15 22:52:45 -05:00
c Fixes #273 (on master this time) with -Wno-implicit-fallthrough 2018-04-08 12:22:25 -04:00
csug add collect-rendezvous 2018-04-02 13:52:03 -04:00
examples fixed gather-filedata's sort of profile entries. for any two 2017-10-30 21:01:43 -04:00
makefiles Makefile-csug.in install target is now consistent with the project 2018-03-28 09:25:20 -07:00
mats Fixes and small improvements for type recovery. 2018-04-12 21:54:01 -03:00
nanopass@1f7e80bcff latest nanopass 2016-06-27 09:45:20 -04:00
release_notes committing @akeep library change with rebuilt boot files: 2018-04-05 21:28:33 -07:00
s Fixes and small improvements for type recovery. 2018-04-12 21:54:01 -03:00
stex@3bd2b86cc5 - compile-whole-program and compile-whole-library now copy the hash-bang 2016-05-04 20:35:38 -04:00
unicode initial upload of open-source release 2016-04-26 10:04:54 -04:00
wininstall Generalized Windows Visual C++ merge module locator for Visual Studio 2017 2018-01-02 13:35:04 -05:00
zlib@cacf7f1d4e updated zlib to latest version, version 1.2.11 2017-02-13 22:27:21 -05:00
.gitattributes Adding .gitattributes files to correct language stats 2016-10-12 11:47:53 -04:00
.gitignore Added generated docs and intermediate files to .gitignore 2017-10-14 12:32:44 -04:00
.gitmodules - compile-whole-program and compile-whole-library now copy the hash-bang 2016-05-04 20:35:38 -04:00
.travis.yml Small update to move build out to a seperate file, also adding expected summary. 2018-01-15 21:24:22 -05:00
bintar - updated version to 9.5.1 2017-10-11 19:57:53 -04:00
BUILDING - Added setting of CHEZSCHEMELIBDIRS to s and mats make files so that 2017-10-12 09:47:58 -04:00
CHARTER.md initial upload of open-source release 2016-04-26 10:04:54 -04:00
checkin changed copyright year to 2017 2017-04-06 11:41:33 -04:00
configure Merge branch 'master' of github.com:cisco/ChezScheme 2017-10-14 00:00:19 -04:00
CONTRIBUTING.md - added custom install options. workarea creates an empty config.h, 2016-05-06 18:30:06 -04:00
LICENSE initial upload of open-source release 2016-04-26 10:04:54 -04:00
LOG Fixes #273 (on master this time) with -Wno-implicit-fallthrough 2018-04-08 12:22:25 -04:00
newrelease Makefile-csug.in install target is now consistent with the project 2018-03-28 09:25:20 -07:00
NOTICE - updated version to 9.5.1 2017-10-11 19:57:53 -04:00
README.md Changed the travis-ci monitoring image to match the current brnach (master). 2018-04-09 21:47:03 -04:00
scheme.1.in spelling 2017-12-04 09:35:31 +00:00
workarea attempt to stabilize timing tests let-values source-caching 2017-10-29 17:48:43 -04:00

Build Status

Chez Scheme is both a programming language and an implementation of that language, with supporting tools and documentation.

As a superset of the language described in the Revised6 Report on the Algorithmic Language Scheme (R6RS), Chez Scheme supports all standard features of Scheme, including first-class procedures, proper treatment of tail calls, continuations, user-defined records, libraries, exceptions, and hygienic macro expansion.

Chez Scheme also includes extensive support for interfacing with C and other languages, support for multiple threads possibly running on multiple cores, non-blocking I/O, and many other features.

The Chez Scheme implementation consists of a compiler, run-time system, and programming environment. Although an interpreter is available, all code is compiled by default. Source code is compiled on-the-fly when loaded from a source file or entered via the shell. A source file can also be precompiled into a stored binary form and automatically recompiled when its dependencies change. Whether compiling on the fly or precompiling, the compiler produces optimized machine code, with some optimization across separately compiled library boundaries. The compiler can also be directed to perform whole-program compilation, which does full cross-library optimization and also reduces a program and the libraries upon which it depends to a single binary.

The run-time system interfaces with the operating system and supports, among other things, binary and textual (Unicode) I/O, automatic storage management (dynamic memory allocation and generational garbage collection), library management, and exception handling. By default, the compiler is included in the run-time system, allowing programs to be generated and compiled at run time, and storage for dynamically compiled code, just like any other dynamically allocated storage, is automatically reclaimed by the garbage collector.

The programming environment includes a source-level debugger, a mechanism for producing HTML displays of profile counts and program "hot spots" when profiling is enabled during compilation, tools for inspecting memory usage, and an interactive shell interface (the expression editor, or "expeditor" for short) that supports multi-line expression editing.

The R6RS core of the Chez Scheme language is described in The Scheme Programming Language, which also includes an introduction to Scheme and a set of example programs. Chez Scheme's additional language, run-time system, and programming environment features are described in the Chez Scheme User's Guide. The latter includes a shared index and a shared summary of forms, with links where appropriate to the former, so it is often the best starting point.

Get started with Chez Scheme by Building Chez Scheme.

For more information see the Chez Scheme Project Page.