Skip to content
Adam
Help

FAQ

Short answers to what people ask first, each with the page that tells the whole story.

Getting started

What do I need besides adam?

No C compiler, assembler or linker: Adam builds a program into native x86_64 machine code with its own instruction encoder, object writers and linkers, and on Windows its own PDB writer for the debug information. The standard library, the runtime and the vendored C libraries ship beside adam, for both targets. Running a x86_64-linux-gnu program on Windows goes through WSL. See Building and Targets.

Which systems can Adam build for?

Two targets, each named by its triple: x86_64-windows-gnu (the default) and x86_64-linux-gnu. One adam builds for both: the Windows adam builds a x86_64-linux-gnu program and -r runs it through WSL; the Linux adam runs its own. See Targets.

Is Adam's compiler written in Adam?

Yes, and it builds itself: a new compiler is installed only when the compiler it built (stage B) and the compiler that one built (stage C) are the same byte for byte. See What Adam is.

C libraries

How do I call a C function?

Declare it: a clink routine with an external clause, with no header and no wrapper. For a whole header, adam cimport turns the headers an import spec names into an Adam .C binding unit. See External declarations and adam cimport.

Which C libraries come with Adam, and how are they linked?

Each vendored C library ships as a static archive per target, lib<name>.a in res/libs/vendor/<triple>, with the headers it was built from. A .C unit's routines name their library in their external clause: external "zlib" is found as libzlib.a. See Vendored libraries.

Projects and assets

How do I start a project?

adam init <name> <exe|dll|lib> makes the folder <name> with project.toml, src/<name>.adam (a starter for the kind) and an empty assets folder; the new project.toml carries a 64-character pack password. adam build <folder> builds the project whose project.toml is in <folder>. See Projects and The adam command.

How does my program read its assets?

adam pack zips the project's assets folder into <name>.rez, and every build copies it beside the exe. The program opens an entry with CreateZipFileIO("$P:<name>.rez", "<entry>", ProjectPassword()): $P: is the folder of the program's exe, and ProjectPassword() is the project file's pack password, handed to the program scrambled. See Projects.

Running and testing

Why does my program print a heap report when it ends?

A debug build counts every heap block it hands out and takes back and prints the heap report as the process ends; a release build counts nothing and prints no report. See The runtime.

How do I run tests?

A test is an ordinary .adam file with a spec block, @@test to @@end, inside a block comment. adamtest <ids or globs> runs those tests, -all every one and -failed the ones the last run failed; -root <dir> takes the tests from another folder. See The test suite.

How do I debug a program?

adam build <file> -d builds the program for debugging and runs it at a (dbg) prompt in the same console; adam dap serves an editor the same engine. Adam has a debugger for its host's programs where it has one: x86_64-windows-gnu today. See The debugger.

Is there an editor?

adam editor starts the Adam editor, which checks, builds, runs and debugs your code. Any other editor that speaks the Language Server Protocol gets Adam's checks from adam lsp. See The Adam editor and The language server.

Help

Something does not work. Is it known?

The Known issues page lists what does not work yet, where it shows and what to do meanwhile.

↑ ↓ moveEnter openEsc close