Skip to content
dfkupPublic

About

A collection of modules as standard library for dfkup

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stdkups

dfkup's standard library as a nimble package. Every std/<name> module (except system, which stays statically linked in the dfkup host binary) lives here as stdkups/lib<name> and ships to users as a libdfkup_<name> dylib shard loaded on first import "std/<name>".

Layout

  • src/stdkups/ — the 30 shard modules plus compileutils.nim (its own compileCode copy; dfkup carries an independent one in src/lang/compileutils.nim, so neither package depends on the other).
  • src/stdkups.nim — package root (documentation only).
  • tools/stdlib_plugin.tmpl — dylib wrapper template.
  • tools/build_shards.nim — dylib shard builder (workflow entry point).
  • tests/ — test_modules.nim compile check plus the shard test suite (moved from the dfkup repo; tests exercise shards against the host interpreter via lang/... imports, with dfkup's sources on --path from the dfkup package requirement).

Build Standard Library

Shards are built at workflow level (no nimble task). The build needs the dfkup sources (lang/transformers, lang/parser); build_shards finds them via --dfkup-src, a nearby checkout, or the dfkup package itself (clue install dfkup --build). Plain nim c -r, std-only imports:

nim c -r tools/build_shards.nim --dfkup-src ../dfkup --out ../dfkup/bin/stdlib

--lock points at a clue.lock with resolved dependency paths (the checkout's own lock when present). Without one, the builder resolves stdkups.nimble transitively through the clue store (~/.clue/develop, then ~/.clue/packages) — no lock file needed, but the packages must be installed (clue install --depsOnly).

Notes

  • Plain import stdkups/lib<name> needs no host sources, except libllm (via compileutils, which uses the host's lang/parser). tests/test_modules.nim therefore covers the 29 host-independent modules; libllm is compile-verified by the shard build itself.
  • Heap contract: shards and host share --threads:on --mm:arc (see tools/build_shards.nim); exceptions never cross the dylib boundary (in-image guard re-raises through the host sink).

License

MIT license. Made by Humans from OpenPeeps.

About

A collection of modules as standard library for dfkup

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

Generated from openpeeps/pistachio