OxL Reference

II.3 Summary of built-in attributes

AttributeApplies toSection
@derive(I, …)data, enum, distinct§4.6
@sealeddata§4.3
@explicitinterface§4.6
@openenum§4.4
@errordata, enum§6.5
@reflecttype§15.2
@v(n), @since(n), @removed(n), @tag(n), @renamed(from)type, field§9.2
@repr(W), @codec(…), @zigzag, @preserve_unknowntype, field§9.3–9.5
@grpc_status(code)error type§10.1
@table, @pk, @auto, @index, @sharddata, field§12.8
@isolation(level)function with atomic(db)§11.2
@owner, @visible, @encrypted, @audittable, field, rpc§13
@public, @allow(…)rpc§13.4
@timeout, @retry, @idempotent, @readonly, @cache, @ratelimit, @resumable, @window, @tracerpc§10.2
@retaintopic§10.5
@parallel(n)pipeline§10.6
@idle(d), @transientactor, actor field§12.5
@near(expr), @pinned, @nonblockingfunction, actor, extern function§8.1, §12.6
@tag(…), @skip, @flaky, @test_onlytest, declaration§18
@deprecated(msg), @inline, @coldany declarationII.3

@tag(n) with an integer argument on a field is the field number; @tag(labels…) on a test is selection labels.

Also: @internal (rpc, inaccessible to external principals, §13.4), @c_layout (data for FFI, §16.1), @flaky(retries: n) and @skip(reason) (test, §18.1), @must_close(by: method?) (type, §4.3).

Implementation-defined. Optimiser hints (D-8063; D-7690, D-7691). @inline and @cold on a fn and the functions std.opt.likely(c), unlikely(c) are hints: they do not change the results of a program, and an implementation MAY ignore them. This implementation: @inline sets the LLVM attribute alwaysinline, @cold sets cold (attribute arguments are ignored without a diagnostic); likely(c) and unlikely(c) return c and pass the expectation to the code generator (llvm.expect). @arena (a request arena, §7.4) is not implemented: placement in an arena remains an optimisation that must not be relied upon.

Source: docs/spec/oxl-standard.en.md