The Racket repository
Go to file
dybvig f7c414bda3 Various updates, mostly to the compiler, including a new lambda
commonizatio pass and support for specifying default record
equal and hash procedures:

- more staid and consistent Mf-cross main target
    Mf-cross
- cpletrec now replaces the incoming prelexes with new ones so
  that it doesn't have to alter the flags on the incoming ones, since
  the same expander output is passed through the compiler twice while
  compiling a file with macro definitions or libraries.  we were
  getting away without this just by luck.
    cpletrec.ss
- pure? and ivory? now return #t for a primref only if the prim is
  declared to be a proc, since some non-proc prims are mutable, e.g.,
  $active-threads and $collect-request-pending.
    cp0.ss
- $error-handling-mode? and $eol-style? are now properly declared to
  be procs rather than system state variables.
    primdata.ss
- the new pass $check-prelex-flags verifies that prelex referenced,
  multiply-referenced, and assigned flags are set when they
  should be.  (it doesn't, however, complain if a flag is set
  when it need not be.)  when the new system parameter
  $enable-check-prelex-flags is set, $check-prelex-flags is
  called after each major pass that produces Lsrc forms to verify
  that the flags are set correctly in the output of the pass.
  this parameter is unset by default but set when running the
  mats.
    cprep.ss, back.ss, compile.ss, primdata.ss,
    mats/Mf-base
- removed the unnecessary set of prelex referenced flag from the
  build-ref routines when we've just established that it is set.
    syntax.ss, compile.ss
- equivalent-expansion? now prints differences to the current output
  port to aid in debugging.
    mat.ss
- the nanopass that patches calls to library globals into calls to
  their local counterparts during whole-program optimization now
  creates new prelexes and sets the prelex referenced, multiply
  referenced, and assigned flags on the new prelexes rather than
  destructively setting flags on the incoming prelexes.  The
  only known problems this fixes are (1) the multiply referenced
  flag was not previously being set for cross-library calls when
  it should have been, resulting in overly aggressive inlining
  of library exports during whole-program optimization, and (2)
  the referenced flag could sometimes be set for library exports
  that aren't actually used in the final program, which could
  prevent some unreachable code from being eliminated.
    compile.ss
- added support for specifying default record-equal and
  record-hash procedures.
    primdata.ss, cmacros.ss, cpnanopass.ss, prims.ss, newhash.ss,
    gc.c,
    record.ms
- added missing call to relocate for subset-mode tc field, which
  wasn't burning us because the only valid non-false value, the
  symbol system, is in the static generation after the initial heap
  compaction.
    gc.c
- added a lambda-commonization pass that runs after the other
  source optimizations, particularly inlining, and a new parameter
  that controls how hard it works.  the value of commonization-level
  ranges from 0 through 9, with 0 disabling commonization and 9
  maximizing it.  The default value is 0 (disabled).  At present,
  for non-zero level n, the commonizer attempts to commonize
  lambda expressions consisting of 2^(10-n) or more nodes.
  commonization of one or more lambda expressions requires that
  they have identical structure down to the leaf nodes for quote
  expressions, references to unassigned variables, and primitives.
  So that various downstream optimizations aren't disabled, there
  are some additional restrictions, the most important of which
  being that call-position expressions must be identical.  The
  commonizer works by abstracting the code into a helper that
  takes the values of the differing leaf nodes as arguments.
  the name of the helper is formed by concatenating the names of
  the original procedures, separated by '&', and this is the name
  that will show up in a stack trace.  The source location will
  be that of one of the original procedures.  Profiling inhibits
  commonization, because commonization requires profile source
  locations to be identical.
    cpcommonize.ss (new), compile.ss, interpret.ss, cprep.ss,
    primdata.ss, s/Mf-base,
    mats/Mf-base
- cpletrec now always produces a letrec rather than a let for
  single immutable lambda bindings, even when not recursive, for
  consistent expand/optimize output whether the commonizer is
  run or not.
    cpletrec.ss,
    record.ms
- trans-make-ftype-pointer no longer generates a call to
  $verify-ftype-address if the address expression is a call to
  ftype-pointer-address.
    ftype.ss

original commit: b6a3dcc814b64faacc9310fec4a4531fb3f18dcd
2018-01-29 09:20:07 -05:00
c Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
csug Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
examples fixed gather-filedata's sort of profile entries. for any two 2017-10-30 21:01:43 -04:00
makefiles - Updated CSUG to replace \INSERTREVISIONMONTHSPACEYEAR with the current 2017-10-13 23:50:20 -04:00
mats Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
nanopass@1f7e80bcff latest nanopass 2016-06-27 09:45:20 -04:00
release_notes Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
s Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05: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 Re-enabling the other build types. 2017-03-12 14:51:09 -04: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 Various updates, mostly to the compiler, including a new lambda 2018-01-29 09:20:07 -05:00
newrelease updated newrelease to handle mats/Mf-*nt 2017-10-30 17:32:37 -04:00
NOTICE - updated version to 9.5.1 2017-10-11 19:57:53 -04:00
README.md updated CSUG pointer 2017-11-02 10:37:55 -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

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.