Skip to content

Rewrite the stdlib entirely in GL3 #24

Description

@grian32

Goal

Rewrite the entire standard library in GL3. The intended end state is no C-backed stdlib modules; C should not be where stdlib behavior lives.

Current state

Most modules still live in builtins/*.c and are compiled/embedded as LLVM IR. builtins/strings.gl3 is the start of the GL3 stdlib direction.

Tasks

  • Define the GL3 stdlib module layout and import story.
  • Rewrite strings fully in GL3.
  • Rewrite arrays fully in GL3.
  • Rewrite io fully in GL3 or define the minimal compiler/runtime primitive it needs to target.
  • Rewrite dbg fully in GL3 or decide whether it remains a temporary compiler/dev-only facility until removed.
  • Remove C stdlib source usage from the normal stdlib build path.
  • Remove embedded generated .ll as the stdlib source of truth.
  • Update checker/emitter/builtin registration so stdlib modules are normal GL3 modules where possible.
  • Add stdlib smoke tests that compile and run through the normal build pipeline.
  • Update STDLIB.md to match the GL3 implementations.

Notes

Compiler intrinsics or backend primitives can still exist where genuinely needed, but stdlib behavior itself should be authored in GL3 rather than C.

Refs: builtins/strings.gl3, builtins/*.c, STDLIB.md, Makefile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestself-hostingSelf-hosting roadmap and blockersstdlibStandard library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions