Standard library
September 4, 2024 ยท View on GitHub
An overview of the ML standard library.
Dependencies
| Dependency | Required by |
|---|---|
| tiny-regex-c | stdlib/re (Coming soon...) |
| sds | stdlib/string |
| gc | stdlib/builtin/alloc |
Motivation
Important
Ported functions from the c library are regarded as unsafe in terms of type and memory safety, unlike their ML counterparts. Using c bindings should be avoided where safer ML libraries are available.
The standard library permits the use of both unsafe c standard library functions (for embedded systems and nostalgic c programmers) and their safe ML counterparts, plus some other useful modern libraries, like string and convert.
Modules
Tip
Click on a module to display its documentation.
| Module | Parent dir. | Description |
|---|---|---|
| for | builtin | Convenient for-based constructs and looping utilities |
| alloc | builtin | Customizable memory allocation utilities |
| cdefs | c | Commonly used c type definitions |
| cstdlib | c | Bindings for ported functions of the c standard library |
| cstarg | c | Bindings for the stdarg.h c library |
| io | Extendable and safe frontend for printf/fprintf | |
| read | io | Extendable and safe frontend for scanf/fscanf |
| file | io | A frontend for c file-related functions |
| convert | - | Type conversion library |
| debug | - | Customizable rust-like assertables and panic macros |
| string | - | Functional-like string library |
| macro | - | Stand-alone convenience macros |
| backend | alloc | Bindings for the gc.h c library (Garbage collector) |
| backend | string | Bindings for the sds.h c library (Simple Dynamic Strings) |
| va_utils | legacy | Simplistic stdarg.h-like implementation for the assembly backend (deprecated) |