Skip to content

an alpha aLib for Resript? #8192

@hyperpolymath

Description

@hyperpolymath

Hi ReScript team,

I am new on the developer side but I would like to propose a small, low-risk experiment that can make a real difference for library authors and application developers without pulling attention away from compiler priorities.
Summary

I am proposing an alpha “aLib-for-ReScript” repository that acts as a namespaced proving ground + adapter layer:

Common layer: utilities/patterns that work cleanly under both ReScript and Melange constraints.
Specific layer: ReScript-centric ergonomics that are intentionally not “common”.
Compat layer: explicit conversions / escape hatches to and from upstream stdlib types and runtime modules.
Optional Proven entrypoints: opt-in runtime validation at risky boundaries (FFI / JSON / untyped inputs), designed to be removable and dev-friendly.

This is not a replacement standard library. It is an incubator and a safety harness: experiments are namespaced, upstream-first, and deletable.
“No tears” contract (explicit non-goals)

Not “the new stdlib”
Not a fork of upstream stdlibs
Not a mandate for compiler direction or roadmap
Not a mass migration plan

Design constraints:

Namespacing only (e.g. Aggregate.* / Alib.*) — no shadowing Option, Result, Array, etc.
Per-file adoption — you can try one module in one file and stop anytime.
Upstream-first — upstream remains the source of truth.
Deletion-friendly — anything that lands upstream gets removed here; adapters remain only where needed.

Why now

A lot of pain points in real projects sit at the boundaries:

externals + defaults/optionals,
untyped JSON and runtime data,
small cross-target differences (ReScript vs Melange),
and “how should I publish a ReScript library safely?”

This repo would let us:

provide safe boundary patterns now,
gather evidence of what’s valuable,
and (only if wanted) propose narrow upstream improvements later.

Relationship to aggregate-library

I also maintain aggregate-library, which is explicitly a methods + stress-test repo showing the approach under extreme diversity. It’s not the ReScript implementation and not a dependency requirement.

The ReScript-facing repo is the practical application: Common + Specific split, adapters, tests, and optional validation at boundaries.
Graduation / retirement policy

Each module is either:

Experiment (fast iteration, namespaced)
Stable (semver + tests)
Propose upstream (only where it fits upstream goals)
Upstreamed (deprecated + removed here)
Retained (only for ecosystem glue: adapters/codemods/patterns)

What I am asking for

Is the framing acceptable (incubator + adapters, not stdlib replacement)?
Any naming preference for the namespace/repo (“Aggregate” vs “aLib” etc.)?
Any obvious “don’t step on this” areas I should avoid?

If the approach sounds reasonable, I can open an initial PR that is docs + scaffolding only (README, structure, policy), then follow with small modules that address concrete boundary pain points. I am not expecting others to work on this (unless it is of interest, then very happy to!) but just to see if this can give us a way to make development kinder to developers, and make amendments, additions, and deletions more friendly to users and developers.

NOTE: I am conscious that there are issues that might be more suitably addressed at compiler or AST level, but this approach could help with a number of items on the backlog/no status list, without impact upstream. And it might be a place to think about the piloting before messing with AST or compilers to see what the actual reception of ideas might be received by users and developers.

Again, this is a suggestion, not something I am wedded to. Happy if it just serves to spark thinking, but if you want, I am happy to progress it to see what it looks like in practice.

Thanks,
Jonathan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions