Skip to content

SindarinSDK/sindarin-pkg-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

163 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sindarin SDK

A comprehensive standard library for the Sindarin programming language, providing modules for I/O, networking, cryptography, encoding, and more.

Installation

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: main

Then run sn --install to fetch the package.

Quick Start

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

Documentation

Full documentation is available in the docs folder.

Overview

Core

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

Crypto

Module Import Description
Crypto import "sdk/crypto/crypto" Hashing, encryption, HMAC, PBKDF2

Encoding

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

I/O

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

Net

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

OS

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

Time

Calendar dates and timestamps.

Module Import Description
Date import "sdk/time/date" Calendar date operations
Time import "sdk/time/time" Time and duration operations

Running Tests

To run the SDK test suite:

make test

This will compile and run all tests with parallel execution. Use make help to see all available targets.

Dependencies

The SDK depends on:

Dependencies are automatically managed via the sn.yaml package manifest.

License

MIT License - see LICENSE for details.

About

The SDK package for Sindarin

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages