Skip to content

Docs reference bool types (bool64, bool128, bool256, bool512) that the compiler does not implement #18

@davidfrogley

Description

@davidfrogley

Summary

Web/src/docs/types/bool.md introduces a "family of explicitly sized boolean types — bool8 through bool512" and lists seven distinct widths. The compiler implements only three: bool8, bool16, bool32, plus bool as an alias for bool8. Code copied from the docs that uses bool64/bool128/bool256/bool512 fails at name resolution.

Compiler reality (source of truth)

Rux/Include/Rux/Type.h:17-50TypeRef::Kind defines exactly:

Bool8, Bool16, Bool32,
...
Bool = Bool8,   // alias

No Bool64 / Bool128 / Bool256 / Bool512 exist anywhere in the compiler.

Type-name resolution accepts only "bool", "bool8", "bool16", "bool32":

  • Rux/Source/Hir.cpp:220-222, 687-689
  • Rux/Source/Sema.cpp:460-462, 1008-1010

For independent corroboration, the codebase already gets this right elsewhere: Web/src/blog/language-without-llvm.md:100 correctly lists "bool8, bool16, bool32" — only this docs page disagrees.

Repro

let a: bool64  = true;   // unknown type
let b: bool128 = true;   // unknown type
let c: bool256 = true;   // unknown type
let d: bool512 = true;   // unknown type

All four declarations should compile per the docs; none do.

Every doc/asset that needs editing

Web/src/docs/types/bool.md

  • L5 — overview: "Rux provides a family of explicitly sized boolean types — bool8 through bool512".
  • L13-21 — types table; rows for bool64, bool128, bool256, bool512.
  • L28 — example let c: bool64 = true;.
  • L41 — recommendation aside referencing wider types ("FFI requirements or SIMD vectorization") — wording can stay if bool32 covers it; remove the implication that wider widths exist.
  • L57 — example let z: bool128 = true;.
  • L129 — "Wider boolean types (bool32, bool64, etc.) also support bitwise operations." bool64 doesn't exist; fix the wording (e.g., "bool16 and bool32" or just "wider boolean types").
  • L166 — recommendation: "Reserve wider types for SIMD, FFI, and memory-layout-sensitive contexts." Same issue as L41; either point at bool16/bool32 specifically or scope the claim down.
  • L222 — note: "Wider boolean types (bool256, bool512) are primarily intended for SIMD vector masks and low-level bit manipulation. They may require aligned memory on certain platforms." Whole sentence is fictitious.

Web/src/examples/Bool.rux

  • L5-8 — bool64, bool128, bool256, bool512 declarations.

(L1-4 and L9 onward are correct and should stay.)

Web/.vitepress/grammars/rux.tmLanguage.json

  • L562 — bool type-name regex: \b(bool|bool8|bool16|bool32|bool64|bool128|bool256|bool512)\b — should be \b(bool|bool8|bool16|bool32)\b.

Doc that's already correct (don't touch)

  • Web/src/api/index.md:415-419bool8 Display extension entry is real and matches the stdlib.
  • Web/src/blog/language-without-llvm.md:100, 128 — already lists the right three widths and uses bool32 for FFI.
  • Web/src/docs/types/slices.md:63bool8[] example is correct.

Suggested fix

Trim docs/example/grammar to match the compiler — bool, bool8, bool16, bool32 only. If wider boolean types are on the roadmap, gate the relevant sections behind a "Planned" / "Not yet implemented" callout instead of presenting them as available.

The "Wider boolean types are primarily intended for SIMD vector masks" sentence at L222 is worth a closer look from a language-design perspective, not just a docs cleanup: the existing bool32 already covers Win32 BOOL interop and 4-byte SIMD lanes; if there's no concrete use case for bool128+, the cleanest fix is to drop those plans rather than promise them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions