Chez Scheme
Chez Scheme is both a programming language and an implementation of that language, serving as a dialect of Scheme that extends the Revised6 Report on the Algorithmic Language Scheme (R6RS) with numerous additional features and tools.[1] Developed by R. Kent Dybvig, it emphasizes high performance through an incremental optimizing compiler that generates native machine code on-the-fly, supporting platforms such as x86-64, ARM64, PowerPC, and others.[1] The system includes a runtime with generational garbage collection, a programming environment featuring an interactive REPL, source-level debugger, and profiler, as well as facilities for interfacing with C and multi-threaded execution across multiple cores.[1] Initiated in 1985 as part of Dybvig's work at Indiana University, Chez Scheme evolved from early versions focused on efficient implementation of Scheme's core features like first-class procedures, continuations, and tail calls.[2] It was commercialized through Cadence Research Systems, which was acquired by Cisco Systems on December 16, 2011, after which development continued under Cisco until the project was open-sourced in 2016 under the Apache 2.0 license.[3][4] The open-source release, hosted on GitHub, has facilitated broader adoption and contributions, including its use as an alternative backend (Racket CS) for the Racket programming language starting in version 7.9 (November 2020), becoming the default primary backend in version 8.0 (February 2021).[5] Key strengths of Chez Scheme include its support for whole-program optimization, non-blocking I/O, and foreign-function interfaces, making it suitable for systems programming, scripting, and research in programming languages.[1] Documentation is provided through resources like The Scheme Programming Language (4th edition) and the Chez Scheme User's Guide, which detail its extensions beyond R6RS, such as Unicode support, exception handling, and a module system.[6][7] As of 2025, the project remains actively maintained by Cisco, with recent releases incorporating improvements in portability and performance, with the latest release being version 10.3.0 on October 29, 2025.[8]Overview
Description
Chez Scheme is a programming language, specifically a dialect of the Scheme programming language, which itself belongs to the Lisp family of languages.[1] It serves as both the language definition and its primary reference implementation, providing a complete environment for developing and executing Scheme programs.[1] At its core, Chez Scheme functions as an incremental native-code compiler that generates optimized machine code for Scheme programs, enabling efficient compilation either on-the-fly during interactive sessions or ahead-of-time for larger applications.[1] This design supports rapid development cycles while delivering high performance for production use.[4] The implementation includes a suite of supporting tools, such as a source-level debugger, profiling capabilities, memory inspection utilities, and an interactive REPL shell known as the expeditor.[1] Chez Scheme is largely compliant with the R6RS standard, with some deviations in versions 10 and later, and provides partial support for R7RS features, with ongoing efforts to improve compatibility.[1][9][10] As of version 10.3.0 (October 2025), it includes support for portable bytecode and limited iOS platforms, enhancing portability.[11] Since 2016, it has been released as open-source software under the Apache License 2.0, hosted by Cisco on GitHub.[4][1]Key Characteristics
Chez Scheme emphasizes native-code compilation, generating optimized machine code directly for the target architecture, which enables high performance in both interactive development and standalone applications. This approach allows for on-the-fly compilation of source code during interactive sessions or precompilation into efficient executables, contributing to low-latency startup times for compiled programs by avoiding interpretation overhead at runtime.[1][12] As a mostly compliant implementation of the Revised^6 Report on Scheme (R6RS) with some deviations, Chez Scheme provides support for core Scheme features such as first-class procedures, tail calls, continuations, records, libraries, exceptions, and hygienic macros, while maintaining backward compatibility with earlier standards like R5RS through compatibility modes and libraries. It incorporates tailored extensions beyond these standards, including enhanced syntax for scripting and Unicode support, and partial alignment with R7RS-small, though full R7RS-large implementation is not native.[1][12][13][9] Chez Scheme exhibits strong portability, supporting a range of architectures including x86 (both 32-bit and 64-bit), ARM (including AArch64), and PowerPC (such as ppc32le), as well as emerging platforms like RISC-V (RV64G) and LoongArch64.[11][14] Its bootstrapping capabilities allow the system to be built from source using an existing Chez Scheme compiler, facilitating cross-compilation and maintenance across diverse environments without reliance on external tools.[15] The implementation integrates a robust read-eval-print loop (REPL), known as the "expeditor," which supports multiline expression editing, command history, and customizable key bindings for efficient interactive development. Debugging features include source-level inspection via a debug handler that displays continuation stacks upon interruptions (e.g., via ^C), along with built-in profiling tools to analyze execution time and identify bottlenecks.[16] Chez Scheme is designed with thread safety in mind, where most primitive procedures, including memory allocation and garbage collection operations, can be invoked concurrently from multiple threads without corruption. It provides a native thread system supporting concurrent execution across multiple cores, including primitives for thread creation, synchronization via locks and conditions, and thread-safe parameters with per-thread values to manage shared state safely.[17][18]History and Development
Origins
Chez Scheme was created by R. Kent Dybvig in 1985 at Indiana University as a research project originating from his earlier work on Scheme implementations.[2] The first version, documented in the Chez Scheme Reference Manual, Version 1.0 co-authored with Bruce T. Smith, was released in May 1985 under the auspices of Cadence Research Systems in Chapel Hill, North Carolina.[19] The initial goals centered on developing a high-performance Scheme system emphasizing compilation techniques and optimizations to enable practical, real-world applications beyond academic experimentation.[2] Dybvig aimed for an efficient and portable implementation that could deliver robust performance while adhering to Scheme standards, addressing limitations in contemporary Lisp and Scheme systems of the era.[2] Early releases marked the transition from an academic prototype to a commercial product under Cadence Research Systems, which published subsequent manuals including the Chez Scheme System Manual in August 1989 and its Revision 2.0 in December 1990 from Bloomington, Indiana.[19] Key innovations during this foundational phase included incremental compilation, which allowed for rapid recompilation of modified code without rebuilding the entire system, and a portable runtime system designed to support cross-platform deployment.[2]Milestones and Releases
Chez Scheme's development saw significant milestones beginning with its adoption of the Revised^6 Report on Scheme (R6RS) standard. Version 7.9.1, released in 2007, introduced initial support for R6RS, marking a major step toward standardization while retaining Chez Scheme's extensions for performance and usability.[20] Full R6RS compliance was achieved in subsequent minor releases, such as version 7.9.3, enabling broader compatibility with the Scheme ecosystem.[20] In December 2011, Cisco Systems acquired Cadence Research Systems, the company behind Chez Scheme, integrating it into Cisco's operations for internal use in networking and systems software.[3] This acquisition shifted development to a proprietary model under Cisco, with R. Kent Dybvig, Chez Scheme's creator, joining the company to continue maintenance. Following years of internal enhancements, Cisco open-sourced Chez Scheme in April 2016 under the Apache License 2.0, releasing version 9.4 as the initial public version on GitHub.[14] This move facilitated community contributions and wider adoption, while preserving Cisco's hosting of the repository.[4] Post-open-sourcing, development transitioned toward community maintenance, with Dybvig serving as the lead maintainer alongside contributions from users and integrators like the Racket team. Key releases highlighted ongoing evolution: version 9.5, starting in late 2021 and refined through 2022, improved Unicode handling, including support for the Basic Multilingual Plane in console I/O on Windows and enhanced string operations.[21] Version 10.0, released in February 2024, added features like Unicode 15.1 support, new platforms (AArch64, RV64G, LoongArch64), and compiler optimizations such as floating-point unboxing.[9] The most recent stable release, version 10.3.0 on October 29, 2025, focused on refinements including ARM64 (AArch64) performance improvements, bug fixes for threading and garbage collection, and platform-specific enhancements for stability across supported architectures. These updates underscore Chez Scheme's continued relevance in high-performance computing, with the project maintaining active development through community input on GitHub.[14]Implementation
Compiler Design
Chez Scheme employs an incremental compiler that translates Scheme source code into native machine code via assembly, enabling just-in-time compilation during interactive sessions or file loading.[22] This approach allows source forms to be compiled as they are encountered, facilitating rapid development and evaluation, while batch modes support precompilation of files into object files for faster subsequent loading.[23] The compiler is structured as a whole-program optimizer when invoked viacompile-whole-program, which processes an entire top-level program or library set to enable cross-unit optimizations and produce a single binary output.[23]
The compilation process operates in two phases: an initial phase converts source code to an intermediate representation (IR) through parsing and expansion into a core language, followed by a second phase that applies optimizations and generates machine code.[23] Key optimizations in the second phase include closure conversion, which transforms higher-order functions into explicit data structures for efficient representation, and lambda lifting, which hoists nested procedures to top-level to reduce closure overhead and enable better inlining.[24] These transformations are implemented within the nanopass framework, a modular system of small, composable passes that progressively refine the IR.[24]
The runtime system integrates seamlessly with the compiler, providing generational garbage collection that reclaims memory in a precise, copying manner across a static generation and up to 255 nonstatic generations to minimize pause times for long-running applications.[25] It also supports comprehensive exception handling, extending R6RS mechanisms with formatted error reporting, condition types like &warning and &assertion, and customizable handlers via guard and raise for robust error recovery.[26] Dynamic loading is facilitated through load-shared-object, allowing runtime incorporation of shared libraries and foreign procedures without recompilation.[27]
Chez Scheme is a self-hosting implementation, with its compiler written predominantly in Scheme and bootstrapped using tools like make-boot-file to generate initial boot files from a minimal kernel such as petite.boot.[23] This process supports compilation across multiple architectures, including x86-64, ARM, and PowerPC, by leveraging platform-specific assembly generation.[4] Cross-compilation is enabled for libraries and programs, permitting builds for target platforms from a host system via improved support in versions 9.1 and later.[28] For standalone executables, static linking combines compiled object files and runtime components into a single binary using compile-whole-program and boot file concatenation, eliminating external dependencies.[23]
Supported Platforms
Chez Scheme primarily supports 64-bit architectures, with a focus on x86-64, AArch64 (64-bit ARM), RV64G (64-bit RISC-V), and LoongArch64, alongside 32-bit options such as x86, ARMv6, ARMv7, and PowerPC32.[14] Earlier versions also included support for SPARC and additional PowerPC variants.[29] The implementation runs on a range of operating systems, including Linux (with support for x86, x86-64, ARMv6, AArch64, RV64G, LoongArch64, and PowerPC32), macOS (x86, x86-64, AArch64, and PowerPC32), Windows (x86, x86-64, and AArch64), and various Unix-like systems such as FreeBSD, OpenBSD, NetBSD, Solaris, and GNU/Hurd.[14] Limited support extends to mobile environments like Android (ARMv7 and AArch64) and iOS (AArch64), primarily through native compilation on select machine types, though full mobile integration is not emphasized.[11] Bytecode interpretation enables compatibility on additional platforms, including WebAssembly via Emscripten.[14] Building Chez Scheme from source requires a compatible Chez Scheme boot file (version 9.5 or later) and a C compiler such as GCC or Clang to compile the runtime system components written in C.[30] The process uses the Zuo build system, which operates without Unix tools on Windows and supports MinGW; cross-compilation is possible for various targets.[11] Pre-built binaries are provided for major platforms, including x86-64 Linux, macOS, and Windows, simplifying installation without source compilation. Portability is facilitated by an abstract machine model implemented through portable bytecode (pb) variants, which allow interpretation on virtually any desktop platform regardless of native architecture, with optimizations for word size and endianness.[9] This design supports easy adaptation to new architectures by bootstrapping from existing boot files and adjusting machine-specific assembly or C code in the kernel.[14] AArch64 support was added in version 10.0.0, with iOS compatibility improvements in 10.1.0 including machine types for limited native-code use. Version 10.3.0 (October 2025) includes further bug fixes, inlined numeric predicates, and atomic operations for pairs.[31]Features
Core Language Support
Chez Scheme provides full support for the R5RS and R6RS standards, with partial support for R7RS-small through compatibility libraries, encompassing their syntax, semantics, modules, libraries, and hygienic macro systems. This compliance ensures portability of core Scheme code across implementations while leveraging Chez Scheme's efficient compiler for native code generation. The language's modular structure, defined in R6RS libraries and extended in R7RS, allows developers to organize code into self-contained units with explicit imports and exports, facilitating large-scale program development without namespace pollution. Hygienic macros, implemented via thesyntax-case system standardized in R6RS, prevent accidental variable capture during expansion, promoting reliable code generation and abstraction.[7]
At its core, Chez Scheme employs lexical scoping, where the scope of a variable is determined by its position in the source code rather than dynamic binding, enabling predictable and efficient name resolution. Procedures are first-class objects, meaning they can be created dynamically, assigned to variables, passed to other procedures, and returned as results, supporting higher-order functions central to functional programming paradigms. Continuations, as first-class entities, capture the program's state at any point, allowing non-local control transfers such as abortive exception handling or cooperative multitasking; for instance, the call/cc procedure invokes a continuation, passing the current control context to its argument. These constructs align with the standards' emphasis on expressive, composable abstractions.
The built-in data types in Chez Scheme adhere to standard specifications, featuring arbitrary-precision numbers for exact integer and rational arithmetic, alongside inexact floating-point representations compliant with IEEE 754. Strings support mutable and immutable variants with full Unicode encoding, enabling seamless handling of international characters through UTF-8 and other schemes. Vectors provide efficient, indexed collections of homogeneous or heterogeneous elements, with operations for creation, access, and modification optimized for performance. Additional primitive types include symbols for efficient interning, booleans, characters, pairs for list construction, and ports for I/O, all integrated into a uniform type system that supports type predicates like number? and string?.[32]
Control structures emphasize functional purity and efficiency, with proper tail calls guaranteeing that recursive calls in tail position do not consume stack space, thus supporting unlimited recursion depth. Procedures can return multiple values using values and receive them via call-with-values, allowing concise expression of computations that produce several results, such as coordinates or key-value pairs. The dynamic-wind procedure coordinates cleanup actions around dynamic extents, ensuring resources like files or locks are properly managed even when continuations cause non-sequential execution. These mechanisms, inherited from R5RS and elaborated in R6RS, underpin robust program flow in the presence of advanced features like continuations.
Error handling follows the conditions framework outlined in R6RS, where errors are signaled by raising condition objects—simple or compound records carrying diagnostic information—and caught by handlers installed via with-exception-handler or guard. This system distinguishes between serious errors (like division by zero) and continuable conditions, permitting interactive recovery or logging without halting execution. Predicates such as condition? and accessors like condition-message facilitate introspection, while the raise and raise-continuable procedures integrate seamlessly with the continuation model for flexible exception propagation.[32]
Extensions and Interfaces
Chez Scheme provides a robust Foreign Function Interface (FFI) that facilitates seamless integration with C and C++ code, enabling Scheme programs to call external libraries and functions directly. The FFI is primarily implemented through theforeign-declare form, which embeds C declarations directly into the Scheme code for compilation and linking, and the foreign-call form, which invokes the declared foreign procedures at runtime. For example, to integrate the C sqrt function from <math.h>, one might use (foreign-declare "#include <math.h>") followed by (define sqrt-c (foreign-call "sqrt" double double)), allowing the Scheme program to pass and receive double-precision floating-point values. This interface supports a wide range of C types, including integers, floats, pointers, and structures, with automatic memory management for boxed types, making it suitable for high-performance applications requiring low-level system access.[27]
Beyond standard Scheme syntax, Chez Scheme introduces several proprietary syntactic extensions that enhance expressiveness and control over evaluation. The begin0 form evaluates a sequence of expressions but returns the value of the first one, which is particularly useful for performing side effects after capturing a primary result without altering the overall return value; for instance, (begin0 (foo) (bar) (baz)) computes foo's result first and returns it while executing bar and baz afterward. Parameter objects, implemented natively as per SRFI 39, provide a mechanism for dynamic bindings that propagate through procedure calls without explicit parameter passing, allowing values to be rebound locally and restored upon exit from a dynamic extent using parameterize. These objects support thread-safe operations in multithreaded contexts and are commonly used for configurable runtime behaviors, such as current output ports or error handlers.[33]
Chez Scheme extends the standard I/O facilities with advanced features for handling binary data, network communication, and efficient file access. Binary ports are created using procedures like open-binary-input-file and open-binary-output-file, which treat files as sequences of bytes rather than characters, supporting operations such as get-bytevector-n for reading fixed-length byte sequences and put-bytevector for writing them, ideal for processing non-textual data like images or executables. Network support includes TCP sockets via tcp-listen to establish servers on a specified port and tcp-connect for client connections, with bidirectional ports returned for reading and writing over the socket; for example, (tcp-connect "localhost" 8080) opens a connection to a local server. Additionally, file mapping allows direct memory access to file contents through map-file-to-memory, which loads a file into a bytevector-like region for high-speed random access without traditional buffering overhead.
For debugging, Chez Scheme offers powerful interactive tools that integrate deeply with its runtime environment. The inspector, invoked via ,inspect in the REPL or programmatically with inspect, provides a menu-driven interface for examining objects at runtime, including their type, contents, and references; users can navigate closures, environments, and continuations by selecting options like ? for help or p to print details. Tracing facilities include trace and untrace, which instrument procedures to display argument and return values during execution, applicable to both built-in primitives and user-defined functions; for instance, (trace +) logs all calls to the addition operator. Stepping support is available through the single-step mode in the debugger, activated by errors or explicit breaks, allowing execution to pause at each expression for inspection and continuation.
Chez Scheme includes comprehensive support for Unicode and internationalization, ensuring compatibility with global text processing needs. It natively handles UTF-8 and UTF-16 encodings through dedicated transcoders for ports, such as make-transcoder (utf-8-codec), which specify how characters are serialized to bytes during I/O operations. String conversion procedures like string->utf8 and utf8->string transform between Scheme strings (which store Unicode code points) and bytevectors in UTF-8 format, while string->utf16be and utf16be->string handle big-endian UTF-16; these support error handling via optional error ports for invalid sequences. Additional codecs for UTF-16LE, UTF-16BE, and even iconv-based non-Unicode sets extend internationalization for legacy systems.
Performance
Optimization Techniques
Chez Scheme employs a series of optimization passes in its compiler to generate efficient machine code. These include type inference, which analyzes expressions to determine types and eliminate unnecessary runtime checks, such as specializing flonum operations in conditional branches like(if (flonum? x) E1 E2); this pass adds compilation time but typically offsets it through reduced checks and improved code generation in safe mode.[9] Constant folding evaluates compile-time constants, such as fixing invalid folding for certain apply calls to produce simpler code.[9] Dead-code elimination removes unreachable or unused code, including discarding calls to procedures like remove, member, or assoc when their results are not used, particularly in unsafe mode via assert-unreachable.[9] Inlining replaces procedure calls with their bodies, supporting cross-library inlining for exported simple procedures and record operations to reduce overhead.[9]
The compiler operates incrementally, compiling source forms to native machine code as they are encountered during interactive use, functioning as a just-in-time (JIT) mechanism integrated into the runtime system by default; this allows seamless development and execution without separate compilation steps.[34] For production, ahead-of-time (AOT) compilation produces standalone executables or fasl files via tools like compile-file, enabling faster startup and deployment.[22]
Memory management in Chez Scheme relies on a generational garbage collector that divides the heap into generations to prioritize collection of short-lived objects, improving efficiency for typical allocation patterns.[25] Write barriers track modifications to older generations from younger ones, enabling incremental and parallel marking in a hybrid mark-copy algorithm that leverages machine parallelism.[9] Heap sizes are tunable through parameters such as s*generation-semispaces and collect-requests, allowing users to adjust nursery and tenured spaces for specific workloads.[25]
Profile-guided optimization (PGO) tools enable tuning by compiling with profiling data from compile-profile on source or block levels, loading it via profile-load-data to inform decisions like branch prediction and inlining during subsequent compilations.[9]
Benchmarks and Comparisons
Chez Scheme has consistently demonstrated strong performance in standardized benchmarks for Scheme implementations. In the R7RS benchmarks suite (57 tests), which evaluates a range of tasks including loops, numerical computations, and recursive functions, version 10.0.0 of Chez Scheme (as of February 2024) achieved a high overall ranking, with a total sum of places score of 171.[35] For instance, in loop-intensive tasks like summing large arrays, Chez Scheme completes execution in approximately 4 seconds, outperforming Guile 3.0.10 (9 seconds) by about 2.25 times and Chicken 5.3.0 (13 seconds) by over 3 times.[35] Similarly, in numerical benchmarks such as Fibonacci computation, Chez Scheme takes 3.8 seconds, roughly 1.9 times faster than Guile's 7.1 seconds.[35]| Implementation | Overall Sum of Places (as of 2024) | Example: Loops (seconds) | Example: Numerical (seconds) |
|---|---|---|---|
| Chez Scheme 10.0.0 | 171 | 4 | 3.8 |
| Racket 8.13 (Chez backend) | 223 | 8 | 3.89 |
| Guile 3.0.10 | 258 | 9 | 7.1 |
| Chicken 5.3.0 | 233 | 13 | 27.24 |
Variants
Petite Chez Scheme
Petite Chez Scheme is a lightweight variant of Chez Scheme designed as a threaded interpreter, omitting the full compiler while sharing the core runtime system with the main implementation. This design enables a smaller footprint suitable for resource-constrained environments.[40][16] It maintains high compatibility with Chez Scheme, allowing most programs to run unchanged provided they avoid invoking the compiler or using foreign function interfaces (FFI). Petite Chez Scheme fully supports the R5RS standard and provides partial support for R6RS and R7RS, making it suitable for a wide range of Scheme applications without requiring native code generation.[16][40] Historically, Petite Chez Scheme has been freely distributable since the 1990s as a companion to the proprietary Chez Scheme, facilitating its use in commercial distributions without royalties. It was open-sourced in 2016 alongside the main Chez Scheme project under the Apache License 2.0. Common use cases include embedded systems, educational settings for teaching Scheme concepts, and quick scripting tasks where rapid startup and minimal resource usage are prioritized over peak performance.[40][4] A key limitation is the absence of native compilation, resulting in interpreted execution that is typically 10 times slower or more than compiled code in Chez Scheme. For detailed performance comparisons, see the benchmarks section.[40][16]Related Projects
One prominent project integrating Chez Scheme is Racket, a descendant of Scheme that adopted Chez as its primary backend starting with version 8.0 released in 2021.[41] This shift improved Racket's performance through Chez's advanced compiler optimizations and native code generation, making Racket CS (Chez Scheme-based) the default implementation.[42] To accommodate Racket-specific modifications, the Racket team maintained a fork of Chez Scheme, which was merged back into the mainline repository in 2023, enhancing compatibility and upstream contributions.[43] Tooling around Chez Scheme includes language server support for integrated development environments. The scheme-langserver project implements the Language Server Protocol (LSP) for R6RS and R7RS Scheme, with extensions for Chez-specific features, enabling autocompletion, diagnostics, and navigation in editors like Emacs (via lsp-mode) and Visual Studio Code.[44] Chez Scheme's build system leverages its incremental compiler and thescheme command-line tool, functioning as a make-like facility for compiling and linking modules efficiently without external build scripts.[16]
Chez Scheme has influenced research in compiler design, particularly through R. Kent Dybvig's contributions. The nanopass framework, developed for Chez Scheme's compiler, structures optimization as a sequence of small, analyzable passes, enabling modular and verifiable transformations; this approach was formalized in a 2013 ICFP paper and powers Chez's high-performance code generation.[24] Flatt et al.'s 2019 ICFP experience report detailed rebuilding Racket atop Chez, highlighting adaptations for continuation marks and runtime integration that advanced practical Scheme implementation techniques.[45] These works underscore Chez's role as a foundation for exploring optimizing compilers in functional languages.[19]
Libraries and Ecosystem
Built-in Components
The standard distribution of Chez Scheme includes a set of core libraries that provide R6RS-compatible modules for essential functionality such as input/output, arithmetic operations, string manipulation, and list processing.[46] These modules encompass bindings like(rnrs io ports (6)) and (rnrs io simple (6)) for I/O operations, (rnrs arithmetic bitwise (6)), (rnrs arithmetic fixnums (6)), and (rnrs arithmetic flonums (6)) for arithmetic, (rnrs unicode (6)) and (rnrs mutable-strings (6)) for strings, and (rnrs lists (6)) and (rnrs mutable-pairs (6)) for lists, enabling portable Scheme programming with support for ports, exceptions, bytevectors, and more.[46]
Chez Scheme extends these core facilities with proprietary libraries, including the (chezscheme) module that exports all standard and extended bindings, such as enhanced syntax-rules with fenders and prefixed R6RS procedures like r6rs:current-input-port.[46] A key extension is the built-in foreign function interface (FFI), accessible via procedures like foreign-procedure and foreign-callable, which allow Scheme programs to invoke C functions with automatic type conversion (e.g., from Scheme integers to C's integer-32) and enable C code to call back into Scheme, supporting dynamic loading of shared libraries like libc.so.[47] Additionally, the distribution incorporates implementations of selected SRFIs as libraries, including SRFI-1 for advanced list operations (e.g., fold, filter) and SRFI-13 for string utilities (e.g., string-join, string-split), facilitating compatibility with community standards without external dependencies.[13]
The Chez Scheme distribution provides several built-in tools for development and analysis. The primary compilers are the scheme executable for full compilation to machine code with optimization levels from 0 to 3, supporting ahead-of-time compilation via compile-file or compile-program to generate loadable object files, and the petit executable for Petite Chez Scheme, an interpreted runtime compatible with full Chez but without the compiler for lightweight deployment.[48] For code inspection, the (disassemble) procedure displays the assembly output of a lambda or code object, aiding in low-level optimization review.[49] Profiling is supported through system-level mechanisms in Section 12.7 of the user's guide, including automatic collection of execution statistics for identifying hotspots, invocable via parameters like collect-profile-information.[50] The (inspect) procedure serves as an interactive inspector, allowing navigation and examination of any Scheme object, such as stack frames or data structures, through a menu-driven interface during debugging sessions.[51]
For graphical user interfaces, the distribution includes the Scheme Widget Library (SWL), a legacy package built on Tcl/Tk that provides an object system, threaded windowing, and tools like a window-based REPL and source viewer, compatible with both full and Petite Chez Scheme across platforms including Windows, Linux, and macOS.[52] However, SWL has been unmaintained since the early 2010s, with source code available for manual building but no ongoing updates or official support.[52]
Starting with version 10.0.0, Chez Scheme introduced enhancements to its built-in components, including expanded Unicode support to version 15.1 for character and string operations, new flonum vector primitives like make-flvector for mutable floating-point arrays, and additional thread management functions such as thread-join.[9] Subsequent releases up to version 10.3.0 (October 2024) have further improved these areas, including an update to Unicode 16.0 support, enhancements to flonum vector operations such as efficient in-place copying with flvector-copy!, and refinements to thread handling like signal constraints to the main thread.[31] These updates build on prior versions by improving numerical and concurrency capabilities, though specific cryptographic primitives and JSON handling remain reliant on FFI integrations or external libraries rather than native modules.[9]