Compiling
In AEL, the Agent Engineering Language, ael compile (command names may change before launch) will check a project and turn every component into compiled AEL: the form a build, a package or another machine can use without your source.
Status
Planned for AEL Beta 0.0.1. AEL is not available yet.
Most of the time you will not need it: ael build and ael run will compile as they go. Compile on its own when you want to keep the compiled form, for example to build on another machine without sending it your source.
Usage
ael compile --target <target> -o build/compiled
ael compile <path> --target <target> -o <dir>
| Argument or option | Meaning |
|---|---|
[path] | The project folder. Without a path, the project in the current folder. |
--target <target> | The target to compile for, as for ael check. Compiled AEL will be checked against its target again when it is built. |
-o <dir> | The folder to write compiled AEL into. |
--json | A machine-readable report, with any diagnostics. |
What it produces
- Every component. Each component file will get its compiled files, including components that
maindoes not reach. Compiling will keep everything; only a build will leave out what the program does not use. - Your folder layout. Compiled files will sit at the same relative paths as their source, so the output mirrors your project.
- Extension files inside their component. An extension file's helpers will be compiled into the component they belong to; they will get no compiled files of their own.
- The root files.
main.ael,pack.aelandmetadata.aelwill be compiled too, so the output carries the entry point, the package declarations and the project's settings that a build needs.
Compiled AEL will hold no source text and no comments. Each compiled component will carry a description of its public interface: its inputs and outputs, what it references and the permissions it needs. That will let a build, or a project that uses your package, check calls to it without the source.
What happens first
ael compile will run the same checks as ael check, and will write nothing if the project fails them. It will use only the packages already installed and pinned by your lock files, and it will run none of your code and no package code.
The output folder will never be read back as source.
Building from compiled AEL
ael build will build a native program straight from compiled AEL, with no .ael files present:
ael compile --target <target> -o build/compiled
ael build build/compiled --target <target> -o build/support
The build will not take compiled files on trust. It will check each one against its description, reject files built for another target or changed since they were compiled, and rebuild the reference map from the compiled files themselves. The program will still start at the project's main: compiled files will not be able to name a different entry point.
Related
- Building a program: from source or from compiled AEL to a native program.
- Building a package: compiled AEL packed into a single package file.
- How it works: the four steps from source to a running program.