3p Pyrope standard library (hardware + comptime)
Create a Pyrope standard library for common hardware building blocks, covering
both pipelined and non-pipelined designs. The intended user-facing shape is a
stable import namespace, for example const x = import("prplib.ware")
followed by calls such as x.csa(...).
Also owns the software/comptime side (docs chapter 13):
LNAST-op wrappers (plus, minus, …),
tuple utilities (len, map, filter,
reduce), strings, math, reached via
const prp = import("prp"). No prp library exists in
the repo today. Where the files live and how the import resolves is one
decision shared by both halves (subtask A).
Failing example (comptime half)
const prp = import("prp")
cassert(prp.plus(1, 2, 3) == 6)
cassert(prp.len((1, 2, 23)) == 3)
comb inc(a) -> (r) { r = a + 1 }
cassert((1, 2, 3).map(inc) == (2, 3, 4))
Subtasks — pending
- A — decide the package location and resolver contract.
Specify where
prpliblives in the source tree, how it is installed or embedded, and howimport("prplib.ware")resolves in hermeticlhdruns. - B — define the public namespace layout. Start with
ware.adders,ware.multipliers,ware.shifters,ware.gcd, and a debug/experimental namespace such asdebug.foo. Decide which symbols are re-exported byprplib.warefor short calls likex.csa(...). - C — implement initial non-pipelined blocks. Add the first combinational adders, multipliers, shifters, and GCD examples with clear width/sign behavior and Pyrope tests.
- D — implement initial pipelined blocks. Add corresponding pipelined variants with explicit latency/valid-ready or documented timing semantics.
- E — document and test import examples. Add examples that
compile through
lhd, exerciseimport("prplib.ware"), and show how downstream projects should depend on the library. - F — comptime/software library
import("prp"). Implement the chapter-13 wish-list (op wrappers, tuplelen/map/filter/reduce, strings, math) until the chapter-13 examples cassert clean; then drop the 13-stdlib TBD admonition (also tracked in 15-tbd).
Subtasks — landed
None yet.