Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Provisional API: This reference documents current compiler behavior. Compatibility is not yet promised.

src/meta-helper-client.x

The compiler’s side of the project meta helper.

Functions

FunctionSummary
Compiler.begin_meta_unitSelects the table of the unit at filename for the calls that follow, and resets the unit’s meta static values before the first one.
Compiler.loaded_helper_callCalls a loaded function with data values and helper-owned selections.
Compiler.meta_helper_callCalls the project meta function name in the helper with the values arguments, for the call at site, and returns its result.
Compiler.report_meta_errorReports a meta function’s error message with notes under category at the position recorded first in or around node, or at site when it has none.
Compiler.stop_meta_helperStops the helper this process runs, which a translation worker does when its units are done and every process does as it ends.
Compiler.use_meta_helperUses helper for ordinary translation, retaining its configuration through process shutdown.
MetaHelper.checkChecks that this helper built the provider table needed by name.
MetaHelper.closeStops this helper and releases its pipe buffer and configuration maps.
MetaHelper.newCreates an independent helper at path, with failures by table index and source paths mapped to their table indices.
MetaHelper.restartStops the process while retaining its executable and configuration.
MetaHelper.retain_executableRetains this helper’s executable independently of later cache rebuilds.

Compiler

Compiler.begin_meta_unit

void Compiler.begin_meta_unit(Compiler c, String filename)

Selects the table of the unit at filename for the calls that follow, and resets the unit’s meta static values before the first one.

Source: src/meta-helper-client.x:491

Compiler.loaded_helper_call

Var Compiler.loaded_helper_call( Compiler c, String name, Token site, List arguments, String provider)

Calls a loaded function with data values and helper-owned selections. Selectors resolve inside the helper. No address crosses its pipes.

Source: src/meta-helper-client.x:109

Compiler.meta_helper_call

Var Compiler.meta_helper_call( Compiler c, String name, Token site, List arguments, String provider)

Calls the project meta function name in the helper with the values arguments, for the call at site, and returns its result. A warning the body makes is reported at site and a failure it reports is the call’s failure. A body that crashes, exits, or passes the deadline ends the helper, which is reported at site and started again for the next call. The call runs in the table of the file that wrote it: an included file’s own, which runs the constants it computes as its own translation does, or else the unit’s.

Source: src/meta-helper-client.x:103

Compiler.report_meta_error

void Compiler.report_meta_error( Compiler c, Var node, Symbol category, String message, Token site, List notes, int fatal)

Reports a meta function’s error message with notes under category at the position recorded first in or around node, or at site when it has none. A fatal report does not return.

Source: src/meta-helper-client.x:47

Compiler.stop_meta_helper

void Compiler.stop_meta_helper(void)

Stops the helper this process runs, which a translation worker does when its units are done and every process does as it ends.

Source: src/meta-helper-client.x:509

Compiler.use_meta_helper

void Compiler.use_meta_helper(MetaHelper helper)

Uses helper for ordinary translation, retaining its configuration through process shutdown. Replaces and closes the preceding helper.

Source: src/meta-helper-client.x:466

MetaHelper

MetaHelper.check

void MetaHelper.check(MetaHelper m, Compiler c, String name, String provider)

Checks that this helper built the provider table needed by name. Does not invoke the function or reset native state.

Source: src/meta-helper-client.x:479

MetaHelper.close

void MetaHelper.close(MetaHelper helper)

Stops this helper and releases its pipe buffer and configuration maps. A later close is harmless.

Source: src/meta-helper-client.x:528

MetaHelper.new

MetaHelper MetaHelper.new(String path, Map failures, Map units)

Creates an independent helper at path, with failures by table index and source paths mapped to their table indices. No process starts until a call needs it. The caller keeps the canonical configuration values.

Source: src/meta-helper-client.x:443

MetaHelper.restart

void MetaHelper.restart(MetaHelper helper)

Stops the process while retaining its executable and configuration. Its next call starts with fresh native state.

Source: src/meta-helper-client.x:519

MetaHelper.retain_executable

void MetaHelper.retain_executable(MetaHelper helper)

Retains this helper’s executable independently of later cache rebuilds. The copy lasts until close, including across helper restarts.

Source: src/meta-helper-client.x:457

Public types

TypeKindSummary
MetaHelperstructOwns one compiled helper’s configuration and process.

MetaHelper

typedef struct MetaHelper { String path, snapshot; Map failures, units; Scope scope; pid_t pid, owner; int to, from, table, reset, status; Buffer input; } *MetaHelper

Owns one compiled helper’s configuration and process. Callers close it after its last call; closing again is harmless.

Source: src/meta-helper-client.x:71

Design notes

The project meta build (meta-project.x) compiles each unit’s meta group (meta-group.x) into one helper program. This file owns the compiler’s side of that helper: starting it, one request and its replies per call, answers to the queries a body asks, and reporting a body that fails, crashes, or runs too long.