A comprehensive standard library for the Sindarin programming language, providing modules for I/O, networking, cryptography, encoding, and more.
Add the SDK as a dependency in your sn.yaml:
dependencies:
- name: sindarin-pkg-sdk
git: git@github.com:SindarinSDK/sindarin-pkg-sdk.git
branch: mainThen run sn --install to fetch the package.
import "sdk/time/date"
import "sdk/time/time"
import "sdk/os/env"
import "sdk/core/random"
import "sdk/io/textfile"
fn main(): int =>
// Current date and time
var today: Date = Date.today()
var now: Time = Time.now()
print($"Today: {today.toIso()}\n")
print($"Now: {now.format("HH:mm:ss")}\n")
// Environment variables
var user: str = Environment.getOr("USER", "unknown")
print($"User: {user}\n")
// Random values
var dice: int = Random.randInt(1, 6)
print($"Dice roll: {dice}\n")
// File I/O
TextFile.writeAll("/tmp/hello.txt", "Hello, SDK!")
var content: str = TextFile.readAll("/tmp/hello.txt")
print($"File: {content}\n")
return 0
Full documentation is available in the docs folder.
- SDK Overview - Introduction and shared concepts
General-purpose utilities for math, randomness, identifiers, and versioning.
| Module | Import | Description |
|---|---|---|
| Math | import "sdk/core/math" |
Mathematical functions and constants |
| Random | import "sdk/core/random" |
Random number generation |
| UUID | import "sdk/core/uuid" |
UUID generation and parsing |
| Version | import "sdk/core/version" |
Semantic versioning and constraints |
| Module | Import | Description |
|---|---|---|
| Crypto | import "sdk/crypto/crypto" |
Hashing, encryption, HMAC, PBKDF2 |
Data serialization, parsing, and compression.
| Module | Import | Description |
|---|---|---|
| JSON | import "sdk/encoding/json" |
JSON parsing and serialization |
| XML | import "sdk/encoding/xml" |
XML parsing, XPath, DOM manipulation |
| YAML | import "sdk/encoding/yaml" |
YAML parsing and serialization |
| ZLib | import "sdk/encoding/zlib" |
Compression and decompression |
File operations, path utilities, directory management, and standard streams.
| Module | Import | Description |
|---|---|---|
| Overview | I/O module overview | |
| TextFile | import "sdk/io/textfile" |
Text file reading/writing |
| BinaryFile | import "sdk/io/binaryfile" |
Binary file operations |
| Path | import "sdk/io/path" |
Path manipulation utilities |
| Directory | import "sdk/io/directory" |
Directory operations |
| Bytes | import "sdk/io/bytes" |
Byte encoding/decoding (hex, base64) |
| Stdio | import "sdk/io/stdio" |
Standard input/output/error streams |
TCP, UDP, TLS, DTLS, SSH, QUIC, and Git networking.
| Module | Import | Description |
|---|---|---|
| Overview | Networking module overview | |
| TCP | import "sdk/net/tcp" |
TCP client and server |
| UDP | import "sdk/net/udp" |
UDP sockets |
| TLS | import "sdk/net/tls" |
TLS-encrypted connections |
| DTLS | import "sdk/net/dtls" |
DTLS-encrypted UDP |
| SSH | import "sdk/net/ssh" |
SSH client and server |
| QUIC | import "sdk/net/quic" |
QUIC protocol |
| Git | import "sdk/net/git" |
Git repository operations |
Operating system and process interaction.
| Module | Import | Description |
|---|---|---|
| OS | import "sdk/os/os" |
OS detection utilities |
| Environment | import "sdk/os/env" |
Environment variable access |
| Process | import "sdk/os/process" |
Process execution |
Calendar dates and timestamps.
| Module | Import | Description |
|---|---|---|
| Date | import "sdk/time/date" |
Calendar date operations |
| Time | import "sdk/time/time" |
Time and duration operations |
To run the SDK test suite:
make testThis will compile and run all tests with parallel execution. Use make help to see all available targets.
The SDK depends on:
- sindarin-pkg-libs — native library bindings (OpenSSL, zlib, etc.)
- sindarin-pkg-test — testing framework
Dependencies are automatically managed via the sn.yaml package manifest.
MIT License - see LICENSE for details.