Panther Search Documentation Tutorials Devlogs Downloads Source Code

Documentation > Panther Documentation > Intrinsics > Builtin Module @pthr

Builtin Module @pthr

Panther
Documentation


Architecture

type Architecture = enum {
	X86_64,
}

Enum to specify the architecture compiling for / on. Use @config.architecture to access the current target architecture.

Platform

type Platform = enum {
	WINDOWS,
}

Enum to specify the platform compiling for / on. Use @config.platform to access the current target platform.

Mode

type Mode = enum {
	COMPILE,
	COMPILE_RUN,
	SCRIPT,
	BUILD,
}

Enum to specify the compiler mode. Use @config.mode to access the current mode.

WindowsSubsystem

type WindowsSubsystem = enum {
	COMPILE,
	COMPILE_RUN,
	SCRIPT,
	BUILD,
}

Enum to specify the target windows subsystem. Use @config.windowsSubsystem to access the current windows subsystem.

OptMode

type OptMode = enum {
	NONE,
	SPEED_MINOR,
	SPEED,
	SPEED_AGRESSIVE,
	SIZE,
	SIZE_AGRESSIVE,
}

Enum to specify the optimization mode. Use @config.optMode to access the current optimization mode.

CallingConvention

type CallingConvention = enum {
	FAST,
	COLD,
	C,
	WIN_API,
}

Enum to specify the different function calling conventions. For use in function attribute #callConv (not including attribute #callConv means the function has the FAST calling convention).





Symbols for Internal Internal Use

  These intrinsic types are helpers for intrinsic functions meant for internal use by the standard library.

AtomicOrdering

type AtomicOrdering = enum {
	MONOTONIC,
	ACQUIRE,
	RELEASE,
	ACQ_REL,
	SEQ_CST,
}

Enum to specify the different atomic orderings. All orderings guarantee atomicity. Use of any ordering other than SEQ_CST should only be done if the developer is 100% sure it is safe to do so.

MONOTONIC

  Has no synchronization or ordering constraints. Can be used on any atomic operation.

  This is equivalent to "relaxed" in C/C++.

ACQUIRE

  No memory operations in the current thread can be reordered to before this operation. Can be used on load atomic operations.

RELEASE

  No memory operations in the current thread can be reordered to after this operation. Can be used on store atomic operations.

ACQ_REL

  Acquire Release. Performs an acquire and a release operation. No memory operations in the current thread can be reordered to before acquire or to after the release. Can be used on read-modify-write atomic operation.

SEQ_CST

  Sequentially-consistent. Performs an acquire for a load, a release for a store, acquire-release for a read-modify-write operation. In addition, all threads observe all modifications in the same order. Can be used on any atomic operation.

AtomicRMWOp

type AtomicRMWOp = enum {
	XCHG,
	ADD,
	SUB,
	AND,
	NAND,
	OR,
	XOR,
	MIN,
	MAX,
}

  For use in @atomicRMW to denote the operation to use.

Iterable Interfaces

Iterable / IterableRT

interface Iterable = {
	func createIterator = (this) -> impl($$:@pthr.Iterator);
	func createIterator = (this mut) -> impl($$:@pthr.MutIterator);
}

interface IterableRT = {
	func createIterator = (this) #rt -> impl($$:@pthr.Iterator);
	func createIterator = (this mut) #rt -> impl($$:@pthr.MutIterator);
}

Interface to define iterable types. Should be used if the type uses the array iterable model.

IterableRef / IterableRefRT

interface IterableRef = {
	func createIterator = (this) -> impl($$:@pthr.Iterator);
}

interface IterableRefRT = {
	func createIterator = (this) #rt -> impl($$:@pthr.Iterator);
}

Interface to define iterable types. Should be used if the type uses the array reference iterable model.

IterableMutRef / IterableMutRefRT

interface IterableMutRef = {
	func createIterator = (this) -> impl($$:@pthr.MutIterator);
}

interface IterableMutRefRT = {
	func createIterator = (this) #rt -> impl($$:@pthr.MutIterator);
}

Interface to define iterable types. Should be used if the type uses the mutable array reference iterable model.

Iterator Interfaces

Iterator / IteratorRT

interface Iterator = {
	func next = (this mut) -> Void;
	func get = (this) -> $$*;
	func atEnd = (this) -> Bool;
}

interface IteratorRT = {
	func next = (this mut) #rt -> Void;
	func get = (this) #rt -> $$*;
	func atEnd = (this) #rt -> Bool;
}

Interface to define an iterator.

MutIterator / MutIteratorRT

interface MutIterator = {
	func next = (this mut) -> Void;
	func get = (this) -> $$*mut;
	func atEnd = (this) -> Bool;
}

interface MutIteratorRT = {
	func next = (this mut) #rt -> Void;
	func get = (this) #rt -> $$*mut;
	func atEnd = (this) #rt -> Bool;
}

Interface to define a mut iterator.