sun::support::Config

sun::support::Config

struct · Source (opens in a new tab)

struct sun::support::Config

Compile-time configuration for Sun language behavior.

Modify these settings to enable/disable experimental features.

Public Fields

AUTO_DEINIT_CLASSES

public · variable · static · Source (opens in a new tab)

bool sun::support::Config::AUTO_DEINIT_CLASSES = true

If true, class instances have deinit() called automatically at scope exit.

DUMP_IR_ON_JIT

public · variable · static · Source (opens in a new tab)

bool sun::support::Config::DUMP_IR_ON_JIT = true

If true, dump generated LLVM IR to stdout during JIT execution.

FORBID_REF_FIELDS_IN_CLASSES

public · variable · static · Source (opens in a new tab)

bool sun::support::Config::FORBID_REF_FIELDS_IN_CLASSES = false

If true, reference types (ref T) cannot be stored in class fields.

Sun allows them, with tracking: constructing a class that stores refs takes a loan on every by-ref constructor argument, and such a value cannot be returned from the function that built it.

FORBID_REF_RETURNS

public · variable · static · Source (opens in a new tab)

bool sun::support::Config::FORBID_REF_RETURNS = false

If true, functions cannot return reference types (ref T).

Returning references without lifetimes risks dangling references.

REQUIRE_REF_FOR_COMPOUND_PARAMS

public · variable · static · Source (opens in a new tab)

bool sun::support::Config::REQUIRE_REF_FOR_COMPOUND_PARAMS = false

If true, compound types (classes, interfaces) cannot be passed by value to functions - they must use ref T or pointer types.

If false, compound types are passed by value with move semantics.

STRICT_MUTATION_CHECKING

public · variable · static · Source (opens in a new tab)

bool sun::support::Config::STRICT_MUTATION_CHECKING = true

If true, disallow mutating a variable while it has active borrows (Rust-style strict checking).

Assigning to a borrowed compound value drops the storage every live borrow points into, so this must stay on.

TREAT_ALL_BORROWS_AS_MUTABLE

public · variable · static · Source (opens in a new tab)

bool sun::support::Config::TREAT_ALL_BORROWS_AS_MUTABLE = true

Simplification: treat all refs as mutable borrows.

When true, shared (immutable) borrows are not distinguished from mutable.