Slide 19 of 37

Modules

import hive.crypto as crypto

proc main(): void {
	echo crypto.sha256("hive")
}
import brings another file's declarations into scope, reached through a name — the file's own by default, or whatever `as` renames it to. The path itself says what kind of import it is: a bare path is a Hive file on disk, an https:// path is a file inside a git repository — pinned to a commit, a tag or a branch — and hive.* names a standard library module, reached the same way and adding nothing to the build unless it is actually used.