How Libraries Work

Harding can load installable external libraries through harding lib. These packages can bundle Harding source in .hrd files, native Nim code and primitives, and metadata in .harding-lib.json.

This keeps the Harding-facing API and the native implementation in one installable unit.

In practice, a Harding library is just a git repository with a small metadata file. Installing a library clones that repository into the local external/ directory. The next Harding build regenerates the external-library wiring so the library is compiled into the VM/runtime binary.

Library Commands
harding lib list
harding lib install sqlite
harding lib install bitbarrel
harding lib install nimcp

# then rebuild Harding so the library is compiled into the binary
nimble harding

Current Libraries

BitBarrel

Persistent storage integration with hash and sorted table abstractions.

harding-bitbarrel

harding lib install bitbarrel

SQLite

SQLite database connectivity for embedded local persistence.

harding-sqlite

harding lib install sqlite

MySQL

MySQL database connectivity for external database-backed applications.

harding-mysql

harding lib install mysql

NimCP

Model Context Protocol server support through NimCP.

harding-nimcp

harding lib install nimcp

Curly

HTTP client support for talking to external APIs and services.

harding-curly

harding lib install curly

OAuth2

OAuth2 integration helpers for authorization flows.

harding-oauth2

harding lib install oauth2

Google OAuth

Google-specific OAuth integration on top of OAuth2 flows.

harding-googleoauth

harding lib install googleoauth

JWT

JSON Web Token support for auth tokens and API security.

harding-jwt

harding lib install jwt

Package Layout

Typical Layout
external/my-lib/
|- .harding-lib.json
|- lib/
|  `- my-lib/
|     `- Bootstrap.hrd
`- src/
   `- native_impl.nim

Installed libraries simply live under external/, for example external/sqlite/, external/mysql/, or external/bitbarrel/.

Install

Clone the library git repository into external/.

Build

Regenerate the external-library wiring and compile the library into Harding.

Use

Load and use the library through its normal Harding bootstrap and API.

Why This Matters

The external library model lets Harding stay small while still supporting databases, HTTP clients, authentication, MCP tooling, and custom native extensions. It also keeps the Harding and Nim sides versioned together as one installable unit.