https://github.com/inochi2d/nulib
Alternate standard library for D.
https://github.com/inochi2d/nulib
dlang stdlib-replacement
Last synced: 7 months ago
JSON representation
Alternate standard library for D.
- Host: GitHub
- URL: https://github.com/inochi2d/nulib
- Owner: Inochi2D
- License: bsl-1.0
- Created: 2025-02-18T02:45:16.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-17T21:58:19.000Z (7 months ago)
- Last Synced: 2025-06-17T22:37:48.529Z (7 months ago)
- Topics: dlang, stdlib-replacement
- Language: D
- Homepage:
- Size: 1.08 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NuLib
NuLib is an alternative standard library for the D Programming Language, this standard library focuses
on allowing use of high level D constructs without a garbage collector. Additionally these constructs try
but are not guaranteed to work with phobos constructs to some extent.
In practice this allows you to write mixed GC and no-gc code depending on your needs at any given time,
with nulib building ontop of `numem` for portability. Additionally nulib can be used with `nurt` to go
fully no-gc; with the alternate runtime providing the core required hooks for many D language features.
## Why NuLib?
D is an amazing language which bridges both high and low level programming, however with how D's runtime
is constructed, it can be difficult to use DLang outside of its own ecosystem; namely because its runtime
and garbage collector makes cross-language interopability difficult.
The Nu series of libraries aim to fill this gap by both providing tools for users of libphobos and the D
ecosystem, and also providing tools for developers who wish to write libraries used from outside of D.
# Project Structure
NuLib, as a standard library is a bit on the complex side; however to make it as usable as possible
even on platforms without direct support, many parts of the standard library utilizes weak symbols
implemented by seperate support packages.
In practice this means that a subset of nulib should work everywhere, even where there's no OS support.
While third party or builtin support packages can provide more parts of functionality, such as shared library
loading support, threads, etc.
Currently the structure is split up as follows:
| Directory | Description |
| ---------- | -------------------------------------------------------------- |
| `source/` | The main interface of the library |
| `modules/` | Secondary modules and extensions to nulib |
| `os/` | OS specific implementations for higher level nulib constructs. |
## Adding new OS support modules.
You can incrementally add OS-specific functionality by creating a seperate dub package.
Every file that has a higher level wrapper over low level concepts, will have hooks defined
in a section denoted with "`FOR IMPLEMENTORS`", implement the hooks as **non-weak** symbols
in your library to add the given functionality.