Pular para o conteúdo

Native compilation

Este conteúdo não está disponível em sua língua ainda.

pop build produces a native executable ahead of time:

Terminal window
pop build app.pop --output app

The compiler first parses the source and resolves names, visibility, and types into a high-level intermediate representation (HIR). It then lowers valid code to a smaller mid-level representation (MIR), verifies that representation, and sends it to the LLVM backend. LLVM emits an object file, and the driver links it with Pop’s Standard and native runtime archives.

The important user-facing consequence is that syntax, name, and type errors are reported before an executable is produced. A successful executable no longer needs the Pop compiler to parse its source when it starts.

Use pop check when you need diagnostics but not an executable:

Terminal window
pop check app.pop

This runs the front end and verification stages without completing native linking. It is useful for editor tasks and quick feedback.

pop run app.pop follows the build path and then starts the program. Arguments after -- are passed to main:

Terminal window
pop run app.pop -- first second

The release archives include the two native libraries needed by the linker. Keep libpop_standard.a and libpop_runtime_native.a beside the real Pop executable when moving an installation.

Pop 0.1.0-rc.2 targets Linux native executables in its release distribution. It is not a bytecode interpreter or a cross-platform virtual-machine package.