Skip to content
Xen / docs

Search documentation

English · v0.1.0-demo.3

Type to search the documentation.

    한국어
    Xen / coding-class v0.1.0-demo.3

    Installing Xen · Coding Class

    Apply the chapter in three steps: an exercise, a program project, and a debugging task. Implement first, then consult the hints and completion criteria. Use a separate file or working directory for each task.

    Run xen version and uname -m; record the compiler version and host CPU. Choose the matching package from the installation table.

    Completion: The version is xen 0.1.0-demo.3, and the download matches the host CPU.

    Hint: x86_64 maps to Debian amd64; aarch64 maps to arm64.

    Create hello.xen in a new exercise directory using the preparation code below. Run xen check hello.xen and xen run hello.xen, then change directory and run it using an absolute path.

    Completion: Both locations print one line, ready. Checking succeeds without output.

    Hint: Relative file paths are resolved from the current shell directory.

    Assume ./bin/xen version works in the archive directory but xen version fails elsewhere. Explain the cause and fix PATH for the current shell without removing an existing installation.

    Completion: From another directory, command -v xen identifies the intended executable and the version command works.

    Hint: Prepend the installed bin directory to PATH. Keep the distribution’s bin and stdlib together.

    class_ready.xen
    fn main() { println("ready"); }
    class_ready.stdout
    ready

    Use xen check file.xen followed by xen run file.xen for ordinary programs; use xen test file.xen for test-only files. Record the original error, its cause, and the corrected result, then rerun every input in the completion criteria.