Vile feature checklist
Missing features and follow-up work, excluding exception handling. Vile is one R5RS-based dialect with selected R6RS/R7RS extensions. Do not add standards profiles, version modes, or separate compatibility runtimes. The report names below identify where features come from; they are not separate implementation targets or a promise to implement either entire report. Scheme and Vile remain two surface syntaxes for the same language. An unchecked item is work remaining.
Select extensions individually for their usefulness in Vile, not to complete a newer report. Where standards conflict, choose and document one behavior for the shared dialect instead of adding a profile switch.
Libraries use R7RS-small's define-library, declarations, and import sets.
Selected R6RS procedures use that same machinery; (rnrs ...) names are binding
aliases. Do not add R6RS library forms, versioned import references, or an
R6RS expansion/run phase system.
Allocation priorities: avoid implicit copies and unnecessary heap work. Reuse V's existing facilities; use explicitly owned arenas without GC where lifetimes allow. Published values, callbacks, and continuations must retain valid ownership.
Already present: lexical closures, proper tail calls, hygienic R5RS
syntax-rules, continuations, dynamic-wind, multiple values, promises,
mutable pairs/strings/vectors, basic textual/file ports, and datum eval.
Those should be extended where necessary rather than reimplemented.
Shared foundations
- Add explicitly owned GC-free host regions and bounded compiler scratch using V's existing arena allocator. Host examples copy results out before reset; compiler scratch is lazy and freed on all exits. Published values, source staging, diagnostics, continuations, and nested owners retain valid lifetimes. Tiny list scopes reserve at least 1 KiB; this is not persistent VM collection.
- Fix borrowed-arena calls when the VM or compiled functions outlive the caller's region. Cover cold initialization, reentrant entry-buffer growth, syntax mark domains, capture-free closure caches, and return bridges. Entry bookkeeping and persistent caches must not retain released caller storage. Dedicated lifetime tests cover these paths. Durable VM growth and published values still require a retained allocation owner, as documented for host arenas.
- Use one R5RS-based dialect with selected R6RS/R7RS extensions, available
through both
.scmand.vile. No standards profiles or version-selection flags. - Implement Scheme-level
load, file-relative source resolution, and.vile/.scmdetection. Loaded macros affect subsequent top-level forms; hosteval_fileAPIs retain source filenames and support frontend overrides. - Build library resolution, isolated library namespaces, import/export binding identities, and dependency initialization. Preserve macro hygiene across library boundaries. Named libraries resolve relative to callers and discovered library roots; dependency initialization uses the existing machine and dynamic extents. Imports retain locations and macro origins. Cycles and failed/suspended initialization have explicit diagnostics; V hosts can add search paths.
- Retain default R5RS case folding; add
#!fold-case/#!no-fold-casedirectives so individual sources can opt into case-sensitive identifiers. - Extend lexical syntax: datum comments
#;, nested#| ... |#comments, escaped identifiers, hexadecimal character/string escapes, more named characters, and string line continuations. Apply each report's grammar. - Add newer reader directives/aliases, including R6RS
#!r6rsand R7RS#true/#false; keep port-basedreadconsistent with source reading. - Add shared/cyclic datum notation with
#n=and#n#, including safe construction and rejection of cycles in executable syntax where necessary. - Add Unicode identifiers. Runtime Unicode17 predicates, scalar/full casing, folding, comparison/hash behavior and normalization share the same pinned data with identifier classification and folding in both readers.
References: R7RS reader rules, R7RS program/library structure.
R7RS-small syntax and libraries
- Add
when,unless,case-lambda, and explicitletrec*. - Add
let-values,let*-values, anddefine-values, reusing the existing multiple-value representation and control bridges. - Extend
casewith=>receiver clauses. - Add
make-parameterandparameterize, including converters, mutable dynamic binding locations, host reentry, and restoration across continuation exits/reentry without reconverting saved values. - Extend lazy evaluation with
delay-force,promise?, andmake-promise. Shared memoization preserves recursive forcing and continuation reentry; long forcing chains keep bounded frame, stack, and retained-memory use. - Update
syntax-rulesfor the newer wildcard, ellipsis-identifier, and pattern rules. The shared dialect uses R7RS wildcard/literal precedence, custom hygienic markers, fixed suffixes in proper/improper lists and vectors, and escaped templates. Trailing repetitions retain a single streaming pass. - Add
include,include-ci,cond-expand, and truthfulfeaturesoutput. Inclusion shares lexical scope and preserves source files; library declaration inclusion, host search paths, cycle checks, and continuation reentry are covered. Library queries do not initialize user libraries; features describe the shared dialect. - Implement
define-library,import,export, import-set transformations, and the standard(scheme ...)library exports.export,import, andbeginlibrary declarations are implemented. Catalogs expose implemented bindings; remaining procedures are tracked in their own items.(vile base)exports the combined dialect. - Add the R7RS
environmentprocedure and library-based evaluation environments. Imported environments are immutable; report/null environments retain their version-5 API. V hosts also haveVM.environment. - Make vector literals self-evaluating as an R7RS extension; quoted vectors remain valid, and literal contents stay immutable.
- Add R7RS
define-record-type, constructors, predicates, accessors, and field mutation. Types are generative at runtime, including local definitions and continuation reentry. Instances use one scanned allocation; accessors use fixed field indexes.
References: R7RS expressions, definitions, records, and libraries.
R7RS-small data, I/O, and system access
- Add bytevector values,
#u8(...), mutation/copy operations, and UTF-8 conversion procedures. Runtime bytevectors, constructors, mutation/copy/append, structural equality, printing, UTF-8 conversion, and immutable source literals are implemented. - Add missing sequence procedures and newer arities:
make-list,list-copy,list-set!, string/vector mapping and iteration, copying/appending, optional ranges, andboolean=?/symbol=?. List mapping stops at the shortest finite input;member/assocalso accept Scheme comparison procedures. - Add string and bytevector ports, binary port operations, port-open
predicates,
close-port, andcurrent-error-port. Make current-port selection participate inparameterize. Textual and binary operations enforce the port's mode. V hosts can select binary mode for borrowed Readers/Writers; memory ports return independent snapshots. - Add
read-line,read-string,write-string, byte/block I/O,flush-output-port, and the EOF-object constructor.read-bytevector!drains lookahead and reads directly into its fixed destination; counts/ranges are validated before I/O. Flushing supports both port modes. - Extend
writeto represent cyclic data and addwrite-sharedandwrite-simple, preserving ordinary acyclic output. Cyclic pairs/vectors use datum labels;write-sharedalso preserves acyclic pair/vector sharing.write-simplerejects cycles. Flat list tails iterate, records remain opaque, and V hosts have matching owned-string formatting APIs. Datum-label reader syntax remains a separate item. - Add
command-line, environment-variable access,exit,emergency-exit, file existence/deletion, and time/jiffy procedures. Keep process termination controllable by embedding hosts. Hosts receive typed exit requests by default and can configure an exit hook, copied argument/environment overrides, and a TAI/UTC offset. Normal exit shares continuation winding; emergency exit skips user winders. The CLI opts into OS termination and forwards script arguments through the flag module. - Add the newer numeric procedures and spellings:
exact/inexact,exact-integer?,exact-integer-sqrt, division families, and supported infinity/NaN input/output and predicates. Runtime procedures, division families, square roots, NaN predicates, decimal nonfinite string conversion, printing, and source/port-reader literals are implemented.
Reference: R7RS standard procedures.
R6RS extension candidates
Choose these individually for the shared dialect. This is not a commitment to full R6RS conformance or a separate R6RS mode.
- Add procedural macro transformers:
syntax-case, syntax objects, identifier comparison, datum/syntax conversion, and temporary generation. Hygienic patterns/fenders, syntax/quasisyntax templates, graph-preserving conversion and temporary identities share the runtime and R7RS-small library machinery. Independent semantic, control, ownership and both-frontend cases are included in the full Scheme suite. - Add the R6RS record syntax, procedural construction, inheritance, inspection, and opaque/sealed record behavior. Captured shorthand helpers keep their identity across lexical scopes and library namespaces; constructor protocols share the machine and continuation controls.
- Add hashtables, including user-supplied hash/equivalence procedures.
Eq/eqv tables use native fast paths; custom callbacks and updates share the
existing machine, continuation snapshots, and mutation validation. Immutable
copies own their containers.
(vile hashtables)/(rnrs hashtables)expose the same selected procedures through unversioned library aliases. - Add enumeration types and enumeration-set operations.
Immutable sets, hygienic
define-enumeration, and all 13 selected procedures share universe metadata and the existing VM. Small sets use one inline word; larger sets own additional words.(vile enums)/(rnrs enums)are unversioned binding aliases in the shared dialect. - Add the R6RS list utilities and list/vector sorting libraries.
Stable sorting, short-circuit searches/predicates, folds, filtering/partitioning,
removal, and
cons*share the existing machine and continuation machinery.(vile lists)/(rnrs lists)and sorting collections are unversioned aliases for the same pristine procedures. Imports use the same R7RS-small import sets. - Add selected fixnum, flonum, and exact bitwise computational libraries,
including numeric predicates, corrected division/bit-field domains, checked
bounded fixnums and arbitrary exact bitwise results. All 108 computational
procedures share pristine unversioned
(rnrs arithmetic ...)/(vile ...)aliases. Six R6RS infinity/NaN condition bindings remain deferred with the excluded exception hierarchy; exact-to-flonum range limits are documented. - Add R6RS bytevector notation
#vu8(...), endian-aware typed accessors, binary/textual I/O distinctions, transcoders, and custom port facilities. Literal notation, typed integer/IEEE access, UTF16/32 conversions and immutable whole-value transcoders are implemented. Port-first get/put APIs include start/count ranges, Unicode string input into existing strings, available-chunk reads and reads through EOF. Position queries/seeking support memory ports, owned seekable files and optional V host capabilities, including buffered logical positions and opaque textual tokens. Attached port transcoders stream split Unicode units and newline sequences, transfer binary resource ownership, and preserve output retry suffixes. Memory constructors, destructive extractors, output collectors and mode-aware EOF queries reuse the same ports and wind controls; extraction transfers owned buffers when possible. File-option enum sets, buffer modes and atomic binary/textual file constructors are implemented, including no-create/no-fail/no-truncate and line flushing after transcoding. Fresh standard binary streams and common port exports preserve shared stdio, independent wrapper state and pristine parameter/control identities. Windows binary reads share C read-ahead; output duplicates retain process modes. Custom binary/textual callback ports, datum input/output, selected file options, and native binary/textual combined files are implemented. Native shared UTF16 updates preserve the initial BOM and byte order; borrowed V duplex streams retain independent input/output. Custom combined transcoder attachment and same-machine final-input output drain are implemented, including half-closes and continuation reentry after terminal physical close. Custom binary duplex positions support exact shared cursors, independent optional capabilities, failure-safe half-closes and stale continuation checks. Textual duplex positions preserve opaque token identity, reusable snapshots, Unicode and segmented probe coordinates, same-machine alignment and recovery across half-closes. Positioned custom transcoders track exact raw boundaries across split codecs, normalized newlines, ignored bytes, datum probes, callback replay and half-closes; pending output drains on input. Selected I/O libraries export the custom constructors and half-close APIs; conformance fixtures include the new procedures. Normal exit cleanup runs custom closers on the same machine, preserving continuation replay, superseding exit status and failure-safe pending-output cleanup. The integrated batch passed the full Mac Scheme suite, lexer/reader/CLI tests, Windows x64 smoke cases, and nine idle-Mac performance workloads. - Add the R6RS Unicode string case and normalization operations. Pinned Unicode17 backends share full-fold comparison/hash behavior and scalar case data. Caller-owned output and lexical scratch preserve arena lifetimes; Identifier classification/folding and the extended readers use the same data.
- Add selected R6RS evaluation-library APIs on top of the shared
library/environment machinery; retain the R5RS environment-specifier API.
(rnrs eval)/(vile eval)expose pristineevalandenvironmentas unversioned aliases of the existing procedures. Imported locations remain immutable; the shared evaluator handles continuations and multiple values. Library syntax and imports follow R7RS-small; R6RS conditions remain excluded.
References: R6RS library catalog, procedural macros, records, hashtables, enumerations, arithmetic, Unicode.
Numeric extensions
- Add runtime bignums and larger exact rationals while retaining the current small-integer fast paths. Canonical values promote/demote without changing small layouts; numeric conversion, arithmetic, comparison, printing, and host ownership share the same exact runtime.
- Add complex values, arithmetic, conversions, constructors, component access, and printing. Exact components reuse canonical integer/rational values; inexact kernels use scaled and compensated arithmetic plus the C math backend. Zero imaginary components collapse to real values. Host snapshots own their data.
These extend the shared exact integer/rational and inexact-real numeric tower. Do not treat every numeric extension as an unconditional R5RS/R7RS-small conformance requirement.
Vile syntax and embedding extensions
Implement GOOPS (Guile Object Oriented Programming System), integrated with the shared runtime and available through R7RS-small libraries in both Scheme and Vile syntax. Builtin class identity and precedence,
make-class,define-class, compact instances, and basic slot operations are implemented. Directmake-generic,<method>construction,add-method!, class-based dispatch, method introspection,define-generic,define-methodwith fixed and rest arguments, and callablemake <generic>are implemented. Lexicalnext-methodwith escaped closure and method-chain snapshots is implemented. Class-allocated slots share one cell across subclasses and keep instance storage compact.method*anddefine-method*support optional, keyword, and rest arguments. Instances of<applicable-struct>inherit aprocedureslot and can be called directly, passed as callbacks, and used as bare Vile statements. Calls preserve tail behavior and detect forwarding cycles.#:allocation #:each-subclassgives each class its own shared cell, initialized at class definition, without instance fields.#:getter,#:setter, and#:accessorcreate or extend generic slot methods in local and global scopes; accessors also support generalized assignment. Virtual slots use user supplied getter/setter callbacks without reserving instance fields, including initialization and continuation exits. Hot virtual reads and writes forward on the current machine without nested entry allocation. Virtualslot-bound?uses the current machine through a reusable bridge, preserving tail calls and continuation reentry with bounded arena usage.class-slot-refandclass-slot-set!access shared cells directly through classes, including inherited and per-subclass slots. Accessors have GOOPS class identity, generic introspection and method extension;make-accessor,<accessor>and<generic-with-setter>construction are available, with independently extensible setter generics. Dispatch hooksno-applicable-methodandno-next-methodare generic and customizable. Missing applications retry after the hook, allowing method installation; missing next methods pass original or replacement arguments. Hooks preserve public accessor identity, continuation exits and budgets.no-methodis also exported as a generic for explicit protocol use. Genericslot-missingandslot-unboundhooks cover reads, writes, generated accessors, bound checks and class slots. Missing writes delegate to the read hook by default; virtual unbound values and continuation replay use reusable bridges on the current evaluator. Slot reflection exposes stable<slot>handles throughclass-direct-slots,class-slots, andclass-slot-definition, with names, options, allocation, accessor procedures, init keywords, values, forms and thunks. Direct and effective definitions have distinct identity; initializer forms retain their lexical thunks.slot-init-functionreturns the recorded initializer. Property queries reuse class-owned metadata. The public unbound marker is ordinary immutable data and is recognized by instance, shared and virtual slots. Raw<slot>and<class>construction and prebuilt slots inmake-classare implemented. Direct slot identity is preserved, effective definitions are separate, and newly defining classes get independent shared cells. Raw slots retain options and do not synthesize initializer thunks. Custom metaclasses, native metadata fields and constructor/layout protocols (allocate-instance,initialize,make-instance, CPL/slot computation and generated method construction) are implemented on the existing evaluator. Extended generics retain directional method relations; aggregate-method and ordered-applicability caches track edits and arena lifetimes. Lexical method factories and the class/method/extended-generic convenience forms are present. Ordinary redefinable classes retain identity and migrate instances lazily; migration hooks preserve continuations, cancellation and committed updates. Metadata writes and construction enforce arena ownership before publication. Under Boehm, registry entries, direct class lists, reverse generic links, and cached metaclasses use weak handles for heap targets. Arena targets still use lifetime tokens. Warmed dispatch caches retain their recorded dependencies. Native metaobjects support migration and cloning. Changes between ordinary objects and methods preserve references and identity-hashtable keys. Generic calls cache effective procedures, including custom factories. Primitive generics cover arithmetic, equality, setters and port writers. Class printers run on the evaluator and can capture continuations. Boehm enqueues instance finalizers for the owner VM. Hosts can drain arena-owned instances explicitly. All 363 combined GOOPS cases pass with Boehm, without GC, and under ASan and UBSan. Independent Scheme/Vile fixtures cover dispatch, native migration, inherited shared slots and class printers. Same-machine comparisons record improved factory caching and VM construction, plus the remaining slot-read and migration overhead.Set and enforce contextual-keyword rules.
fn(...)is a call unless a body follows; parenthesizedif/whilecalls also remain ordinary calls without a body. Bare names support values, infix operators, and indexing. A bare procedure name used as a standalone Vile expression calls it with no arguments; data names retain their values. Arguments, assignment values and computed operator results remain references. Scheme syntax and host lookup behavior stay unchanged. Implicit calls share the existing tail-call path.Allow declarations after expressions and bodies containing only declarations in both syntaxes. Locals have body-wide scope; initializers run in source order, early reads fail, and final declarations/empty bodies return an unspecified value. Definitions remain invalid in expression operands.
Add Vile syntax coverage for libraries, records, multiple-value bindings, and the currently implemented standard forms. Independently written
.scm/.vilefixtures share explicit oracles; tests cover import transformations, private macro origins, inherited record protocols, value-binding scopes, parameters/lazy forms, selected collections, lexical shadowing, located errors, native reentry, multishot continuations and bounded tail calls. Extend this coverage alongside later features, including procedural macros.Consider
for,break,continue, and explicitreturnas optional surface-language additions, with defined scope and tail-call behavior.for(init, condition, step) { ... }is implemented using the existing scopedlet/dolowering. Initialization runs once, each true condition runs the body then step, and the result is unspecified. Header declarations are loop-local; body declarations get fresh locations per iteration. Explicitreturnis implemented for procedure bodies, including multiple values, lexical helper scopes, parameter restoration and continuation replay. Tail returns use the existing tail-call path; cross-helper exits allocate a destination only when Scheme winding callbacks require one.breakexits the nearestdo,while, orforloop, skips its steps, restores dynamic bindings, and preserves continuation replay; lexical procedure/delay boundaries block it. Its marker is initialized once per loop, with no added per-iteration state.continueresumes the full step sequence with the current iteration's bindings and restores parameters.foruses a printable effect-onlydobinding so its step runs on continue without a dummy variable. A continue in a step restarts all steps, discarding partial arguments and preserving explicit mutations. Empty binding scopes use direct compiler-owned calls; continue reuses abandoned unescaped helper activations instead of allocating per iteration. True tail exits also recycle unescaped parents abandoned by transparent helpers; live non-tail callers and captured ancestors retain their locations.Add opt-in cooperative arena usage thresholds through
VM.with_arena_usage_limit, with absolute sampled usage, typed host requests, nested controls and managed-resource cleanup. This is not a hard memory cap.Add hard allocation/resource controls beyond the existing instruction, frame, and macro-expansion budgets. Cooperative host cancellation is implemented through
VM.with_context; sampled arena usage is available throughVM.with_arena_usage_limit. Hard owned-file quotas are implemented through optionalOptions.max_open_files, including transient source readers, shared stream accounting and constructor rollback. Compiler list allocations expose live, peak and cumulative usage and configurable limits. A bounded VM charges its own and nested arenas against hard backing chunk limits. Tests cover denial during parsing, primitive evaluation, host identifier reads, variable publication in root and private namespaces, and nested host-call setup, evaluation activation setup, source-driver construction, staged compilation, host-datum conversion, ordinary closure activation, call-frame reservation, ordinary/extended rest-list reservation, and direct scope, syntax, promise and custom-port activation. Custom-port frames reserve before activation; rejected entry leaves the promise or port retryable. Bridge entry, explicit returns, winding and continuation restoration reserve private buffers before changing invocation state. Exit failure cleanup borrows immutable file queues, and return calls recycle abandoned unescaped helpers. Lexical GOOPS next-method metadata is completed before marking its activation escaped or publishing the callable; denied construction preserves the caller. Earlier bindings, cyclic literals, procedural macros and closures remain usable on these paths. Temporary reader, Unicode and macro scratch restores the caller's allocator after denial. Graph conversion records rollback before publishing placeholders, and compiler-list cleanup reuses its existing map without allocating. An allocation panic during other mutations can still disable the VM. Linux has a separate cgroup test for the kernel kill counter and worker replacement.
Validation for each addition
- Extend the existing conformance fixtures with new exported bindings and independent semantic cases. Track extension provenance while testing the single combined dialect; do not introduce separate standards modes.
- Exercise both frontends for shared features, including malformed and incomplete input, source positions, lexical shadowing, and reentrant hosts.
- Check tail-space behavior, continuation reentry, captured mutation, aliasing, literal immutability, and GC lifetimes where the feature affects them.
- Run the relevant tests and sanitizer checks, and measure representative workloads when changing value representation, dispatch, or allocation.
Continue the integrated GOOPS validation and audit the remaining allocation failure paths for reusable embedded VMs.