Skip to content

Expand Standard Library Schemas #1

@Kinflou

Description

@Kinflou

Expand Standard Library Schemas

Priority

P1 (Medium-High) - Developers need standard types

Labels

  • stdlib
  • schemas
  • P1

Estimated Effort

2-3 weeks

Description

The standard library currently has minimal types. We need to add common types and protocols that developers expect in a modern schema system.

Current State

Location: core_stdlib/packages/std/

Only basic std package exists with minimal content.

Acceptance Criteria

  • Primitive types defined (int8-64, uint8-64, float32/64, bool, string, bytes)
  • Common data structures (List, Map, Set, Optional/Maybe, Result)
  • Date/time types (DateTime, Date, Time, Duration, Timestamp)
  • Standard validators (Email, URL, UUID, Regex patterns)
  • Common protocols/patterns:
    • HTTP request/response
    • WebSocket message patterns
    • Stream/async iterators
  • Stdlib documentation complete
  • Examples using stdlib types

Tasks

  • Define primitive type schemas
  • Create generic collection types (List, Map<K,V>, etc.)
  • Add date/time types
  • Implement standard validators
  • Create HTTP protocol definitions
  • Add WebSocket protocol definitions
  • Write stdlib API documentation
  • Create examples using stdlib
  • Add tests for stdlib schemas

Example Types Needed

Primitives

struct List<T> {
    items: T[]
}

struct Map<K, V> {
    entries: (K, V)[]
}

struct Optional<T> {
    value: T?
}

Date/Time

struct DateTime {
    timestamp: i64  // Unix timestamp
    timezone: str
}

HTTP

protocol HTTP {
    function request(method: str, path: str, headers: Map<str, str>, body: bytes?) -> Response
}

struct Response {
    status: u16
    headers: Map<str, str>
    body: bytes?
}

Dependencies

Blocks

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1 - HighschemasSchema definitionsstdlibStandard library

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions