Skip to main content

Module stdlib

Module stdlib 

Source
Expand description

Sigil Standard Library

A comprehensive collection of built-in functions that leverage Sigil’s polysynthetic syntax and evidentiality type system.

§Modules

  • core: Essential functions (print, assert, panic)
  • math: Mathematical operations including poly-cultural math
  • collections: Array, map, set operations
  • string: String manipulation
  • evidence: Evidentiality markers and operations
  • iter: Iterator-style operations for pipes
  • io: File and console I/O
  • time: Date, time, and measurement
  • random: Random number generation
  • convert: Type conversions
  • json: JSON parsing and serialization
  • fs: File system operations
  • crypto: Hashing and encoding (SHA256, MD5, base64)
  • regex: Regular expression matching
  • uuid: UUID generation
  • system: Environment, args, process control
  • stats: Statistical functions
  • matrix: Matrix operations
  • polycultural_text: World-class text handling for all scripts
    • Script detection (Latin, Arabic, CJK, Cyrillic, etc.)
    • Bidirectional text (RTL/LTR)
    • Locale-aware case mapping (Turkish İ, German ß)
    • Locale-aware collation (Swedish ä vs German ä)
    • ICU-based segmentation (Thai, CJK word boundaries)
    • Transliteration to ASCII
    • Emoji handling
    • Diacritic manipulation
  • text_intelligence: AI-native text analysis
    • String similarity (Levenshtein, Jaro-Winkler, Sørensen-Dice)
    • Phonetic encoding (Soundex, Metaphone, Cologne)
    • Language detection with confidence scores
    • LLM token counting (OpenAI, Claude-compatible)
    • Stemming (Porter, Snowball for 15+ languages)
    • Stopword filtering
    • N-grams and shingles for similarity
    • Fuzzy matching utilities

Structs§

QuantumState
Quantum state: 2^n complex amplitudes for n qubits State |ψ⟩ = Σ αᵢ|i⟩ where i is binary representation

Constants§

FAKE_PTR_MAP

Statics§

FAKE_PTR_COUNTER

Functions§

create_qregister_value
Create a QRegister value with the given state ID and qubit count
get_bufreader_registry
get_listener_registry
get_quantum_state
get_stream_registry
get_tcp_stream
invalidate_qubit
Invalidate a qubit (mark as consumed for linear type checking)
merge_qubit_states
Merge two qubits from different states into a single joint state Returns (new_state_id, control_idx, target_idx)
register_stdlib
Register all standard library functions
store_bufreader
store_quantum_state
store_tcp_stream