4.1. Library Overview
DQ provides runtime services and source packages. The compiler builds imported
package modules for the selected target and stores the results in .dqbuild.
Installing a package does not require prebuilding it for every application.
4.1.1 Runtime and Explicit Imports
The implicit sys interface supplies basic runtime helpers.
Other packages are imported explicitly:
use print
func *Main():
var message : str = Format("{} items", [3])
PrintLn(message)
endfunc
print writes to standard output. Format and the string helpers are available
through the implicit sys runtime interface, so they need no explicit import.
| Need | Documentation |
|---|---|
| Process arguments, memory blocks, runtime helpers | sys |
| Console output | print |
| Formatting and text helpers | String Functions, Text Formatting |
| Files, directories, paths | file |
| JSON trees | json |
| Native threads and channels | threads |
| Timestamps, elapsed time, date formatting, sleeps | time |
| Event-driven sockets and HTTP | nanonet |
| Child processes, captured output, environment variables | shell |
| Math, parsing, databases, C bindings | Additional Standard Packages |
4.1.2 Package Discovery and Platform Dependencies
A bare import is resolved through the compiler's package search roots. Add
project packages with --pkg_path or pkg_path in a .dqproj file. Later
roots take precedence. See Modules and Packages
for identity and lookup rules.
Packages can depend on native libraries and platform APIs. For example,
threads has hosted Linux and Windows implementations; database bindings need
the corresponding client libraries. A package's presence in stdpkg does not
imply that it is available on a bare-metal or WebAssembly target.
The package chapters include the maintained package-local API manuals, so the website, PDF book, and standalone package documentation use the same source.