Chuks Language Data Types

Published: (May 1, 2026 at 02:08 PM EDT)
2 min read
Source: Dev.to

Source: Dev.to

Cover image for Chuks Language Data Types

Stop fighting your data. Let dataType win.

Overview

chuks dataType is a lightweight, fields‑only container. No constructor boilerplate. No class overhead. Initialize with a map literal and the compiler checks every field.

chuks dataType

Validation (@validate)

Attach validation rules directly to fields. Call validate(x) and get back every error—no third‑party library, no schema duplication. The rules live with your data.

Chuks dataType with validation

Custom Validators

Write a function, annotate it with @validator, and reuse it across any dataType, even in imported modules. Example: a strongPassword rule.

chuks dataType custom validation

Nullable Types + Type Narrowing

Append ? to any type to allow null. After a null guard, the compiler automatically narrows the type—no casts, no optional‑chaining syntax required.

Embedding

Embed one dataType inside another; its fields are promoted directly, mirroring Go’s embedding model without the verbosity. Ideal for patterns like Auditable, Identifiable, or any shared schema.

chuks dataType embedding

JSON Renaming (@json)

Keep internal field names clean while exposing a different wire format. A single annotation handles both serialization and parsing—no extra mapping layer needed.

chuks dataType JSON

Resources

  • Official site:
  • Follow on X:
  • Community forum:
0 views
Back to Blog

Related posts

Read more »

Cx Dev Log — 2026-05-01

Two sub‑packets landed on submain today, moving the IR backend closer to supporting structs properly. The first package upgrades the instruction set to handle m...