miniR has a relatively small always-on core and a long list of optional subsystems. The feature flags are not only about smaller binaries. They keep parser and evaluator work fast while letting native code, graphics, linalg, TLS, parquet, and GUI support grow without becoming mandatory for every build.

This is also how miniR keeps a path open for embedded and WASM-oriented builds. The dependency shape is designed so the interpreter can shed heavy host-specific subsystems when the target cannot support them.

Core Crates

These are the main pieces of the always-on Rust stack:

AreaCratesWhy they are here
Parsingpest, pest_deriveR grammar and AST construction start here.
Builtin registrationminir-macros, linkmeAttribute macros declare builtins; linkme turns them into one registry.
Runtime/value plumbingderive_more, smallvec, indexmap, itertoolsReduces boilerplate in value types and call machinery.
Strings and matchingregex, aho-corasick, memchr, unicode-width, unicode-segmentation, unicasePowers string builtins, formatting, and CLI output.
Numeric supportlibm, num-complexMathematical functions and full complex-number support.
Columnar backendarrow-array, arrow-bufferEfficient array-backed storage for vectors and Arrow/Parquet-adjacent work.
General utilityglob, temp-dir, base64, bstr, log, tracingFilesystem helpers, temporary state, binary/text helpers, and instrumentation.

Feature-Gated Subsystems

The optional features are where most crate coupling lives:

FeatureMain cratesWhat it enables
replreedline, crossterm, nu-ansi-termInteractive line editing, completion, terminal UX
randomrand, rand_chacha, rand_distrRNG state, deterministic mode, statistical distributions
datetimejiffTime zones, POSIXct/POSIXlt, date formatting
iocsvDelimited text IO
jsonserde_jsonJSON parsing and emission
tomltoml_editTOML parsing and writing
linalgndarray, nalgebraMatrix factorization and linear algebra helpers
tlsrustls, rustls-native-certs, webpki-rootsHTTPS and secure URL connections
compressionflate2, bzip2Compressed file and serialization support
progressindicatifText progress bars
parallelrayonParallel helpers where the runtime allows them
parquetparquet, arrowArrow tables and Parquet files
svg-devicesvgSVG graphics output
raster-deviceresvg, tiny-skia, usvg, imageRaster graphics from SVG scene data
pdf-devicekrilla, krilla-svg, usvgPDF graphics device
plot / guieframe, egui, egui_plot, egui_table, winit, rfdInteractive plotting and GUI viewers
nativelibloading, cc, pkg-config, addr2line, gimli, objectPackage compilation, shared-library loading, and native stack unwinding

What The Profiles Mean In Practice

The profiles are the fastest way to read the feature graph as an actual development workflow:

  • minimal means parser and evaluator work with zero optional dependencies.
  • fast adds common runtime helpers without pulling in the heaviest features.
  • default is the daily build with the most useful subsystems for ordinary interpreter work.
  • full is the CI and release-style build where everything additive is turned on.

Why Some Dependencies Are Coupled

Several feature flags intentionally pull in bundles rather than single crates:

  • native is not only libloading. miniR also needs cc and pkg-config to build packages, plus addr2line, gimli, and object to turn raw instruction pointers into useful native backtraces.
  • raster-device and pdf-device build on the SVG scene pipeline. That is why they depend on svg-device instead of duplicating graphics generation.
  • gui is layered on top of plotting and viewing support rather than being a separate rendering stack.
  • random uses both fast and deterministic RNG backends because miniR wants good interactive performance and reproducible cross-platform test behavior.

Build Profiles

The repo exposes a few useful build shapes:

ProfileCommandIntent
minimalcargo build --no-default-features --features minimalParser and evaluator work with the lightest dependency set
fastcargo build --no-default-features --features fastQuick iteration with common runtime helpers
defaultcargo buildDaily development build
fullcargo build --features fullCI and release-style build with heavy optional subsystems

Why This Matters For WASM And Embedded Targets

The project does not want every build to drag along:

  • a terminal UI
  • native package compilation
  • TLS stacks
  • GUI plotting
  • large linear algebra dependencies

That is why the feature graph exists at all. The minimal end of the project should remain small enough for sandboxed or non-native targets, even when the full interpreter grows significantly.

Practical Reading Of The Feature Graph

If you are changing parser behavior, basic evaluation, environments, or pure builtins, stay on minimal or fast as long as possible.

If you are changing:

  • package loading or compiled extensions, you probably need native
  • URL connections, you need tls
  • matrix-heavy stats functionality, you need linalg
  • plotting or device output, you need svg-device, raster-device, pdf-device, or gui
  • wasm-target work, you should start from minimal and then add back only what the target can actually support

That split is deliberate. miniR is trying to stay pleasant to work on even while it grows into a serious package runtime.