Standard Library Guide

Hüma comes with a rich set of built-in libraries to speed up your development process. Everything from mathematics to the file system is optimized.

Use the 'yükle' directive to include a module in your project:

yükle "matematik.hb"
calculate

matematik.hb

Modern mathematical functions and constants.

CONSTANTS

PI
= 3.14159265…
Circle constant π
E
= 2.71828182…
Euler's number e

FUNCTIONS

karesi(n: Sayı) → Sayı
Returns n²
küpü(n: Sayı) → Sayı
Returns n³
mutlak(n: Sayı) → Sayı
Absolute value |n|
kuvvet(a: Sayı, b: Sayı) → Sayı
Returns aᵇ
yuvarla(n: Sayı) → Sayı
Rounds to nearest integer
faktöriyel(n: Sayı) → Sayı
Returns n! (factorial)
palette

renkler.hb

ANSI color outputs for current terminals.

CONSTANTS

KIRMIZI
= \x1b[31m
Red ANSI color code
YEŞİL
= \x1b[32m
Green ANSI color code
SARI
= \x1b[33m
Yellow ANSI color code
MAVI
= \x1b[34m
Blue ANSI color code

FUNCTIONS

renkli_yaz(metin: Yazı, renk: Yazı)
Prints text in the specified ANSI color
başarı_yaz(m: Yazı)
Prints text in green (success style)
hata_yaz(m: Yazı)
Prints text in red (error style)
uyarı_yaz(m: Yazı)
Prints text in yellow (warning style)
schedule

zaman.hb

Time measurement and delay tools.

FUNCTIONS

beklet(saniye: Sayı)
Pauses execution for given seconds
kronometre_başlat() → Sayı
Returns current timestamp (milliseconds)
kronometre_bitir(başlangıç: Sayı) → Sayı
Returns elapsed ms since başlangıç
filter_list

liste.hb

Advanced list operations (map, filter).

FUNCTIONS

eşle(liste: Liste, f: Fonksiyon) → Liste
Map — applies f to every element, returns new list
filtrele(liste: Liste, f: Fonksiyon) → Liste
Filter — keeps elements where f returns truthy
indirge(liste: Liste, f: Fonksiyon, baş: Değer) → Değer
Reduce — folds list into single value starting from baş
ters_cevir(liste: Liste) → Liste
Returns a reversed copy of the list
içeriyor_mu(liste: Liste, eleman: Değer) → Mantıksal
Returns 1 if element exists in the list
dilimle(liste: Liste, baş: Sayı, son: Sayı) → Liste
Returns a sub-list from start to end index
folder_open

dosya.hb

File read, write, and line splitting.

FUNCTIONS

güvenli_oku(yol: Yazı) → Yazı | hata
Reads file at yol; returns contents or raises an error on failure
satırlara_ayır(metin: Yazı) → Liste
Splits text into a list of lines
dosya_oku_bayt(yol: Yazı) → Bayt
Reads file as binary data — Rust built-in
settings

built-in

Environment variables and shell interaction.

FUNCTIONS

ortam_değişkeni(anahtar: Yazı) → Yazı | Boş
Returns the value of the environment variable
sistem(komut: Yazı) → Yazı
Executes a shell command and returns its output
analytics

istatistik.hb

Mean, variance, and standard deviation calculations.

FUNCTIONS

ortalama(liste: Liste) → Sayı
Calculates arithmetic mean
en_büyük(liste: Liste) → Sayı
Returns the maximum value in the list
en_küçük(liste: Liste) → Sayı
Returns the minimum value in the list
varyans(liste: Liste) → Sayı
Calculates population variance
standart_sapma(liste: Liste) → Sayı
Calculates standard deviation
text_fields

dizgi.hb

Character checks and string helpers.

FUNCTIONS

büyük_mü(karakter: Yazı) → Mantıksal
Checks if character is uppercase
küçük_mü(karakter: Yazı) → Mantıksal
Checks if character is lowercase
boşluk_mu(karakter: Yazı) → Mantıksal
Checks if character is whitespace
casino

rastgele.hb

Random number generation and list shuffling.

FUNCTIONS

r_tamsayı(min: Sayı, max: Sayı) → Sayı
Generates random integer in range [min, max]
r_seç(liste: Liste) → Değer
Picks a random element from the list
r_karıştır(liste: Liste) → Liste
Shuffles the list randomly
bug_report

birim_test.hb

Unit test framework: test_et, iddia_et, test_raporu.

FUNCTIONS

test_et(ad: Yazı, f: Fonksiyon) → Boş
Runs test function and reports result
iddia_et(beklenen: Değer, gelen: Değer, mesaj: Yazı) → Mantıksal
Asserts two values are equal, returns 1 if true
test_raporu() → Boş
Prints summary of all test results