Velo by Example: Modules

Velo uses the include directive to import code from other files. Standard library modules live in the lang/ directory.

Use include to load other .vel files. Paths are relative to the current file.

include "lang/bool.vel";       # bool extension functions

Terminal term = new Terminal();
term.println(true.str);        # "true"

Standard library modules are real Velo code you include to use. Native classes (Terminal, Time, Http, FileSystem, Socket) need no include — the runtime provides them.

# Type extensions & utilities
include "lang/bool.vel";        # Bool extensions
include "lang/int.vel";         # Int extensions
include "lang/str.vel";         # String extensions
include "lang/array.vel";       # Array extensions
include "lang/map.vel";         # Generic hash map
include "lang/base64.vel";      # Base64 encoding