vyrn

Modules and imports

A file is a module. export decides what leaves it, and an import names what it takes.

Importing

import { a, b } from "std/strings" takes two names. import * as math from "std/math" takes the module under one name and reaches its exports as math.min.

A top-level name is program-wide, so two linked modules cannot both export parse. The namespace form is the answer, and the compiler suggests it by name when the collision happens.

A remote import names github:, gist: or https:. It is pinned in vyrn.lock and cached under ~/.vyrn. --offline refuses to fetch, and Projects and dependencies covers the rest.

padded 0007 clamped 10 min 3