Skip to content

Namespace catalog

This catalog describes the public namespace families shipped by the current Truffle runtime. Use Var metadata and the REPL for exact documentation and arglists.

NamespaceDefault accessPurposeRepresentative Vars
std.foundationCore names are referred eagerlyPortable L0 functions, collections, sequences, protocols, and macrosmap, reduce, take, comp
std.foundation.stringstr/String comparison, slicing, joining, case conversion, trimming, and UTF-8 conversiontrim, join, to-lower, encode
std.foundation.bytesbytes/Mutable byte buffers with explicit signed and unsigned conversioncount, get, set, slice, u8
std.foundation.promisepromise/Native asynchronous settlement and compositionnew, from, all, then, catch, finally
std.foundation.filefile/Capability-gated path resolution and asynchronous byte I/Oresolve, read, write
std.foundation.osos/Capability-gated environment and process operationsplatform, cwd, spawn, process-wait
std.foundation.socketsocket/Capability-gated asynchronous socket operationsconnect, send, close
std.foundation.ednedn/Restricted EDN parsing and canonical readable encodingread, write, pretty
std.foundation.jsonjson/Strict JSON parsing and encodingread, write, pretty
std.foundation.coroutineco/Lua-style coroutines with bidirectional yield and promise awaitcreate, resume, yield, status, close, await
std.foundation.setset/Portable immutable set algebraunion, intersection, difference, subset?, select
std.foundation.prettypretty/Portable readable formatting façadepprint-str
std.foundation.pretty.engineThrough std.foundation.prettyDocument layout and rendering engineInternal formatting primitives
std.prettypretty/Portable readable formattingpprint-str
std.lib.blockExplicit requireStructured source blocksBlock construction and traversal
std.lib.taskExplicit requirePortable task construction and executionTask composition and execution
std.lib.zipExplicit requirePersistent zipper navigation and editingLocation, movement, and editing
code.testExplicit requireFact lifecycle and structured test executionTest registration and execution

(ns app) and (ns app (:config {:intrinsics :all})) install the same default aliases. Intrinsic aliases can be excluded or renamed through (:config {:intrinsics ...}) without removing their underlying provider namespaces.

Startup namespaces also refer protocol descriptors (ICount, IFn, and the other public I* values) and native-type descriptors (Maths, String, Edn, Json, and the other std.native.<Type> values). These short names retain the identity and metadata of their canonical objects in every namespace, including blank namespaces; for example, (= Maths std.native.Maths) is true. The same short name is also the method namespace alias, so native calls use Maths/sin, Json/read, and Iter/iter-map.

Portable namespaces do not expose ambient JVM interop. A namespace explicitly selects the JVM flavor:

(ns example.jvm
(:flavor :jvm)
(:import [java.lang String]))

The provider family is:

NamespacePurpose
hara.native.jvmNative values, construction, member access, and invocation
hara.native.jvm.reflectCapability-gated reflection operations
hara.native.jvm.classpathCapability-gated classpath operations
hara.native.jvm.compilerCapability-gated compilation and class definition

Selecting a flavor is local to the declaring namespace and does not grant a capability or affect required namespaces.

Project namespaces come from .hal files beneath source or test roots declared by the nearest project.edn. Hara resolves services.api-test to services/api_test.hal. The file must declare the requested namespace; mismatches fail instead of installing definitions under a surprising name.

Extension manifests declare a namespace and export map. Requiring that symbol discovers the nearest project extension root or a packaged extension, validates its descriptor, and generates public Vars under the declared namespace:

(ns digest.app
(:require [crypto.hash.sha256 :as sha]))

The same Hara call site can bind to a supported WASM or process-backed provider. Manifest discovery, provider availability, and capability authority are separate checks.

FamilyCreationFile authority neededAutomatically visible
FoundationEager provider plus packaged HAL fallbackNoUnqualified core Vars
Intrinsic librariesGenerated providersNo for loading; operations may require authorityQualified default aliases
Project source.hal under project rootsYesOnly after require or direct evaluation
ExtensionsValidated manifest and provider artifactDepends on provider and operation
Native flavorExplicit :flavor clauseDepends on operationOnly in the declaring namespace