Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abscom logo

Abscom

A C11 library of reusable data structures and platform utilities, plus a Python-inspired dynamic runtime for scripting-style C programs.

Badges

Language: C11 Release Docs Container License: MIT Made by rkriad585

Overview

Abscom bundles low-level building blocks — dynamic arrays, growable strings, hash functions, an open-addressing hash map, timing helpers, and simple file I/O — under a single umbrella header. On top of that it ships a Python-inspired dynamic runtime that brings var values, lists, dictionaries, sets, JSON, random utilities, and a light object system to plain C, plus a scientific layer with matrices, statistics, general math (scalar utilities, number theory, geometry, complex numbers), CSV, path helpers, and basic threading. A data science layer adds NumPy-style reshaping and generators, Pandas-style numeric CSV, functional utils, and SciKit-Learn-style preprocessing (one-hot encoding, train/test split). An AI/ML layer adds activations, softmax, MSE loss, and numerical gradients for neural-network forward passes. An ultimate layer tops the scientific stack off with computational backend selection (CPU / AVX SIMD / GPU stub), a Micrograd-style scalar autograd engine, PPM image loading, saving, and convolution, ASCII and SVG plotting, and a mixed-type DataFrame. A spatial math layer adds modern type aliases (Rust/NumPy style), anonymous-union 2D/3D/4D vectors, fixed-size matrices, and quaternions. A macro-utilities suite adds min/max/clamp, interpolation and smoothstep curves, generic swap, array/struct introspection, bitwise and alignment helpers, and AI activation macros. A language-features layer adds exceptions (try/catch), context managers (with), regex, date/time, generators, base64/UUID, and environment variables. A framework layer tops it off with a micro web server, an event emitter, dynamic plugins, function objects with memoization and decorators, introspection, and itertools-style iterators. An algorithm suite rounds it out with twelve sorting algorithms, a swap-hook visualizer, timeit benchmarking, and binary search. A realtime-and-crypto layer adds RFC 6455 WebSockets (handshake and framing) plus from-scratch SHA-256 and HMAC-SHA-256. The library has no dependencies beyond the C standard library (plus Winsock on Windows) and is built and tested with Meson.

Screenshots

hello.c — the quick-start program

Quick start — the dynamic runtime in a few lines of C.

py_demo.c — dictionaries, JSON, sets, foreach, and classes
Dynamic runtime
core_demo.c — abs_string, abs_dynarray, abs_hashmap, abs_time, abs_fs
Core modules
v6_demo.c — foreach, list_comp, and http_get
Example program

More: View all screenshots

Table of Contents

Key Features

  • Zero-dependency C11 library — only the standard library, plus ws2_32 on Windows for http_get.
  • Data structures — dynamic array (abs_dynarray), growable string (abs_string), and an open-addressing, string-keyed hash map (abs_hashmap) with tombstone deletion and automatic resizing.
  • Hashing — FNV-1a 32/64-bit and djb2 hash functions (abs_hash).
  • Platform helpers — monotonic/wall-clock time (abs_time) and file existence/read/write/remove/rename (abs_fs).
  • Python-inspired runtimevar objects created with the v() literal macro, plus None / True / False.
  • Containers — lists, dictionaries, and deduplicating sets with union/difference/contains operations.
  • Strings — split/join, strip, case conversion, startswith/endswith, and count.
  • JSONjson_parse (objects, arrays, numbers, booleans, null, nested values) and json_dump with full escaping.
  • Functional helpersmap_func, filter_func, and list_comp (map + filter in one pass).
  • Random utilitiesrandint, random_float, uniform, choice, choices, sample, shuffle, and seeded/seed() sequences.
  • Aggregates & mathmin_val, max_val, sum_val, abs_val, pow_val, round_val.
  • Sequencessorted (ascending/descending), reversed_seq, zip_lists, slice, and range/range_step.
  • OOP-liteClass / New / set_attr / get_attr for lightweight class-and-instance objects.
  • System helperssleep_sec, time_now, exec_cmd, and an HTTP/1.0 http_get.
  • Matricesabs_matrix_* constructors, get/set, add/sub/scale, Hadamard (mul_element), deep copy, scalar add, broadcasting (add_row_vector), element-wise apply, multiplication, transpose, determinant, sum/mean/min/max reductions, argmax, and printing.
  • Statisticsmean, median, mode, population variance, and population stdev.
  • Advanced mathsin_val, cos_val, tan_val, log_val, log10_val, sqrt_val, deg2rad, and the ABS_PI / ABS_E / ABS_SQRT2 / ABS_PHI constants.
  • General math — scalar utilities (abs_sq, abs_cb, abs_clamp, abs_lerp, abs_eq), number theory (abs_gcd, abs_lcm, abs_factorial, abs_is_prime, abs_fibonacci), geometry (abs_rad2deg, abs_hypot, abs_dist_euclidean, abs_dist_manhattan), a Newton-Raphson abs_root_find, raw-array statistics (abs_stat_mean / median / variance / stddev), and complex numbers (abs_c_add / sub / mul, abs_c_mag, abs_c_conj, abs_c_print).
  • Data science — NumPy-style shapes (abs_matrix_reshape / flatten / slice / vstack / hstack), generators (abs_matrix_ones, arange, linspace, eye), Pandas-style numeric CSV (abs_matrix_read_csv / write_csv), functional utils (abs_matrix_map, abs_matrix_filter), SciKit-Learn-style preprocessing (abs_matrix_one_hot_encode, abs_matrix_train_test_split returning [X_train, X_test, Y_train, Y_test]), and the Pythonic print_mat / foreach_mat macros.
  • Ultimate layer — computational backends (abs_set_backend over ABS_CPU / ABS_CPU_AVX SIMD / ABS_GPU_CUDA stub) that abs_matrix_mul dispatches on, a Micrograd-style scalar autograd engine (abs_scalar_new / add / mul / relu / sigmoid with abs_scalar_backward), PPM image loading and saving with 2D convolution (abs_img_load_ppm / save_ppm / conv2d), ASCII and SVG plotting (abs_plot_ascii / abs_plot_svg), and a mixed-type DataFrame (abs_df_create, abs_df_add_col_double / _string, abs_df_print, abs_df_free).
  • Spatial math — modern type aliases (i8/i16/i32/i64/isize, u8/u16/u32/u64/usize, f32/f64, b8/b32, byte), anonymous-union vectors (vec2/vec3/vec4, ivec2/ivec3/ivec4, vec2d/vec3d/vec4d) with x/y/z and r/g/b/a aliases, column-major mat2/mat3/mat4, and quaternions — all plain value types (abs_v2_* / abs_v3_* / abs_v4_*, abs_quat_*, abs_mat4_*).
  • Macro utilitiesABS_MIN/MAX/MIN3/MAX3/MIN4/MAX4, ABS_ABS/SIGN/CLAMP/CLAMP01/IN_RANGE, ABS_SQR/CUBE/DIFF/APPROX_EQ, interpolation and shading (ABS_LERP/UNLERP/REMAP/STEP/SMOOTHSTEP), ABS_DEG2RAD_M/RAD2DEG_M, ABS_ARRAY_LEN/OFFSETOF/CONTAINER_OF, generic ABS_SWAP (+ ABS_SWAP_T fallback), bitwise (ABS_BIT, ABS_BIT_SET/CLEAR/TOGGLE/CHECK, ABS_IS_POW2, ABS_ALIGN_UP/DOWN), AI activations (ABS_RELU_M/LEAKY_RELU_M/HEAVISIDE_M), plus guard-checked unprefixed aliases (MIN, MAX, CLAMP, LERP, REMAP, SIGN, SQR, ARRAY_LEN, SWAP, DEG2RAD, RAD2DEG, BIT, IS_POW2).
  • AI/MLsigmoid / relu / tanh activations with backprop-ready derivatives (abs_diff_*), row-wise abs_matrix_softmax, abs_loss_mse, classification abs_accuracy, and a central-difference abs_grad for numerical gradients, plus abs_matrix_random weight initialization.
  • Combinatoricsfactorial, nCr, nPr (var) and abs_factorial, abs_nCr, abs_nPr (plain C ints).
  • Paths & OS helperspath_join, path_exists, getcwd_val.
  • CSVcsv_read and csv_write.
  • Threadingthread_start / thread_join with a lock-guarded object pool for safe allocation from worker threads.
  • Exceptionstry / catch / end_try + throw, with with(VAR, INIT) context managers and close_resource for automatic cleanup.
  • Regexre_match, re_findall, and re_sub with . / * / ^ / $ support.
  • Date & timedatetime_now, strftime_val, and timedelta.
  • Generators — lazy range_gen / next sequences.
  • Encoding & envbase64_encode, version-4 uuid4, and os_getenv / os_setenv.
  • Web serverServer / route / server_run micro HTTP server plus a socket-free server_handle dispatcher for testing.
  • EventsEventBus / on / emit publish-subscribe with per-event handler lists.
  • Pluginsload_library / call_lib_func dynamic library loading (LoadLibrary / dlopen).
  • Function objectsmake_func and named def(f, name), call_func dispatch, memoize / call_memoized caching, decorate body-swapping, and target-aware decorate_func(target, wrapper) decorators that wrap pre/post logic around the original (Python @decorator style) with func_meta / func_name introspection.
  • Introspectionid, repr, and dir for object identity, debugging, and key listing.
  • Itertools — lazy chain and cycle iterators with iter_next.
  • Sorting suite — twelve algorithms from O(n²) (bubble, selection, insertion) to O(n log n) (shell, heap, merge, quick, C qsort) and O(n) integer sorts (counting, radix, bucket), plus the joke sort_bogo.
  • Visualizersort_bubble_visual calls an AbsSortVis hook on every swap for logs or animations.
  • Benchmarkingtimeit times any sort on a deep-copied list without touching the original.
  • Searchbinary_search for sorted lists, plus is_sorted and list_copy helpers.
  • WebSockets — RFC 6455 ws_accept handshake (real SHA-1), ws_send / ws_recv text framing, and public ws_compute_accept / ws_encode_frame / ws_decode_frame helpers for testing the wire format socket-free.
  • Cryptography — from-scratch sha256 and hmac_sha256 (FIPS 180-4 / RFC 2104), pinned to known-answer test vectors.
  • More shufflingfisher_yates (the classic name for shuffle) and a card-deck riffle_shuffle that cuts and interleaves the list.
  • Iteratorschain, cycle, and repeat consumed via iter_next.
  • One umbrella headerabscom/abs.h exposes the core modules and the dynamic runtime.

Installation

One-line installer

The quickest way to install Abscom is the one-line installer. It downloads a prebuilt release asset for your platform (from the automatic release pipeline) and installs the headers, libraries, and pkg-config file to a prefix — no compiler needed. When no matching prebuilt asset is available it falls back to downloading the source and building it with Meson (or a direct cc/gcc compile). The same script uninstalls everything it placed.

Windows (PowerShell):

irm https://raw.githubusercontent.com/rkriad585/Abscom/main/installer.ps1 | iex

Linux and macOS:

curl -fsSL https://raw.githubusercontent.com/rkriad585/Abscom/main/installer.sh | sh

Uninstall with the same command plus the uninstall flag:

(Invoke-RestMethod https://raw.githubusercontent.com/rkriad585/Abscom/main/installer.ps1) + " -SelfUninstall" | iex
curl -fsSL https://raw.githubusercontent.com/rkriad585/Abscom/main/installer.sh | sh -s -- --selfuninstall

Pass -Prefix <dir> (PowerShell) or --prefix <dir> (Unix) to install to another location, and -ForceDirect / --force-direct to skip Meson. See docs/installation.md for options.

Build from source

Requires a C11 compiler, Meson, and Ninja.

git clone https://github.com/rkriad585/Abscom.git
cd Abscom
./build.sh                          # configure, build, and run the tests
./build.sh --install --prefix "$HOME/.local"

On Windows:

git clone https://github.com/rkriad585/Abscom.git
cd Abscom
.\build.ps1
.\build.ps1 -Install -Prefix "$HOME\abscom"

The raw Meson commands work too: meson setup build, meson compile -C build, meson test -C build, and meson install -C build. On Windows the build automatically links the Winsock library (ws2_32) that http_get needs; no manual steps are required.

Linking

Compile against the installed library, or let pkg-config supply the flags:

export PKG_CONFIG_PATH=<prefix>/lib/pkgconfig
cc -std=c11 hello.c $(pkg-config --cflags --libs abscom) -o hello

See docs/installation.md for platform notes.

Quick Start

Save the following as hello.c:

#include "abscom/abs.h"

int main(void) {
    abs_init();

    var nums = List();
    append(nums, v(10));
    append(nums, v(20));
    append(nums, v(30));
    print(v("Sum:"), sum_val(nums));

    var user = Dict();
    dset(user, "name", v("Alice"));
    print(v("Name:"), dget(user, "name"));

    abs_cleanup();
    return 0;
}

Build and run it against the static library:

cc -std=c11 hello.c -Iinclude build/libabscom.a -o hello
./hello

On Windows, add -lws2_32. If you installed Abscom with the installer instead of building it, use pkg-config (see Installation). Expected output:

Sum: 60
Name: Alice

See docs/getting-started.md for a longer walkthrough.

Usage Examples

Sets, foreach, and list comprehension

var s = Set();
set_add(s, v(3));
set_add(s, v(1));
set_add(s, v(3));          /* duplicate, ignored */
print(v("Set:"), s);       /* {3, 1} */

var item;
long total = 0;
foreach (item, range(0, 10)) total += item->val.i;
print(v("foreach sum:"), abs_new_int(total));   /* 45 */

/* square_it and is_odd_b are user callbacks (see examples/v6_demo.c) */
print(v("Squares:"), list_comp(range(0, 10), square_it, is_odd_b));

JSON round-trip

var data = json_parse("{\"id\": 101, \"scores\": [10, 20, 30]}");
print(v("ID:"), dget(data, "id"));

var out = json_dump(data);
print(out);                 /* {"id": 101, "scores": [10, 20, 30]} */

OOP-lite

var Dog = Class("Dog");
var rex = New(Dog);
set_attr(rex, "name", v("Rex"));
print(v("Name:"), get_attr(rex, "name"));   /* Rex */

HTTP/1.0 GET

var html = http_get("http://example.com/");
if (is_err(html)) {
    print(v("HTTP error:"), html);
} else {
    print(v("Body length:"), len(html));
}

Matrices and statistics

var A = abs_matrix_new(2, 2);
abs_matrix_set(A, 0, 0, 1.0); abs_matrix_set(A, 0, 1, 2.0);
abs_matrix_set(A, 1, 0, 3.0); abs_matrix_set(A, 1, 1, 4.0);
print(v("det(A):"), abs_matrix_det(A));   /* -2.00 */

var data = List();
append(data, v(10)); append(data, v(20));
append(data, v(20)); append(data, v(40));
print(v("mean:"), abs_stats_mean(data));  /* 22.50 */
print(v("stdev:"), abs_stats_stdev(data));/* 10.90 */

AI/ML: neural network forward pass

static var square(var x) {
    return abs_new_float(abs_num_val(x) * abs_num_val(x));
}

var X = abs_matrix_random(3, 2);          /* batch of 3 samples */
var W1 = abs_matrix_random(2, 4);         /* 2 -> 4 hidden neurons */
var W2 = abs_matrix_random(4, 1);

var Z1 = abs_matrix_mul(X, W1);
abs_matrix_apply(Z1, abs_act_sigmoid);    /* hidden activation */

var Z2 = abs_matrix_mul(Z1, W2);
abs_matrix_apply(Z2, abs_act_relu);       /* output predictions */

print(abs_loss_mse(Y_true, Z2));          /* mean squared error */
print(abs_grad(square, abs_new_float(3.0)));   /* 6.00 */

AI/ML: backpropagation step

var Z1 = abs_matrix_mul(X, W1);
abs_matrix_add_row_vector(Z1, b1);        /* broadcast the bias in */
var A1 = abs_matrix_copy(Z1);
abs_matrix_apply(A1, abs_act_sigmoid);

var Y_pred = ...;
var Error = abs_matrix_sub(Y_pred, Y_true);
var delta2 = abs_matrix_mul_element(Error,
              abs_matrix_apply_deriv(Y_pred, abs_diff_sigmoid));

var dW2 = abs_matrix_mul(abs_matrix_transpose(A1), delta2);
var W2_new = abs_matrix_sub(W2, abs_matrix_scale(dW2, 0.1));   /* SGD */

print(abs_accuracy(Y_true, Y_pred));      /* classification accuracy */

Exceptions, regex, and generators

var g = range_gen(0, 6, 2);
var n;
while ((n = next(g)) != NULL && !is_none(n)) print(n);   /* 0 2 4 */

print(re_sub(v("o"), v("0"), v("hello")));               /* hell0 */

var result = None;
try {
    if (1 < 0) throw("impossible");
    result = v(42);
}
catch (result) { print(v("Caught:"), result); }
end_try;
print(v("Result:"), result);                             /* 42 */

Web server, events, memoization, and iterators

static var api_home(var req) { (void)req; return v("<h1>Home</h1>"); }

var app = Server(0);                     /* ephemeral port */
route(app, "/", api_home);
print(server_handle(app, "GET / HTTP/1.1"));   /* <h1>Home</h1> */
/* server_run(app);                      /* blocking HTTP server */

var bus = EventBus();
on(bus, "login", my_login_handler);
emit(bus, "login", v("Alice"));

var f = memoize(heavy_calc);             /* cached calls */
print(call_memoized(f, v(5)));

static var timing(var target, var args) {     /* @decorator in C */
    var r = call_func(target, args);          /* run the original */
    return r;
}
var sq = def(slow_square, "square");          /* named function */
var timed = decorate_func(sq, timing);        /* wrap it */
print(call_func(timed, v(4)));                /* 16 */
print(func_name(timed));                      /* square */

var c = chain(List(), List());           /* itertools */
print(iter_next(c));                     /* None once exhausted */

Sorting, benchmarking, and binary search

static void on_swap(var list, int idx_a, int idx_b) {
    (void)idx_a; (void)idx_b;
    print(list);                         /* log every step */
}

var data = List();
for (int i = 0; i < 100; i++) append(data, v(rand() % 1000));

print(v("bubble took:"), v(timeit(sort_bubble, data)), v("sec"));

var small = List();
append(small, v(50)); append(small, v(10)); append(small, v(40));
sort_bubble_visual(small, on_swap);      /* [10, 40, 50] */

sort_quick(data);                        /* in place */
print(v("Found at index:"), v(binary_search(data, v(500))));

WebSockets, hashing, and iterators

var h = sha256("password");              /* 5e884898... */
print(h);
print(hmac_sha256("secret", "message"));

print(ws_compute_accept("dGhlIHNhbXBsZSBub25jZQ=="));   /* s3pPLMBiTxaQ9kYGzzhZRbK+xOo= */

char frame[32], out[32];
size_t n = ws_encode_frame(frame, sizeof(frame), "Hello"); /* 81 05 48 65 6c 6c 6f */
long len = ws_decode_frame(frame, n, out, sizeof(out));    /* 5 */

var deck = range(0, 13);
riffle_shuffle(deck);                    /* cut and interleave */
fisher_yates(deck);                      /* full randomization */

var rep = repeat(v("beep"), 3);          /* repeat() iterator */
print(iter_next(rep));                   /* beep */

More examples live in the examples/ directory (demo.c, py_demo.c, data_demo.c, v6_demo.c, sci_demo.c, lang_demo.c, framework_demo.c, sort_demo.c, crypto_demo.c, ml_demo.c, ml_train_demo.c, math_demo.c, ds_demo.c, ultra_demo.c, geom_demo.c, demo_macros.c) and are built as build/examples/<name>.

Documentation

Document Description
docs/getting-started.md First steps, prerequisites, and a walkthrough.
docs/installation.md Building, linking, and installing Abscom.
docs/architecture.md Module layout and how the pieces fit together.
docs/configuration.md Build-time options and the (empty) runtime config story.
docs/development.md Building, testing, and releasing.
docs/deployment.md Vendoring, installation layout, and distribution.
docs/screenshots.md Screenshot index.
docs/faq.md Frequently asked questions.
docs/troubleshooting.md Common build and runtime problems.

Core library

Document Description
common-macros.md ABS_API, C++ interop, and ABS_UNUSED.
macros.md Numeric, interpolation, bitwise, alignment, struct, and AI activation macros.
dynamic-arrays.md abs_dynarray — generic dynamic array.
strings.md abs_string — growable NUL-terminated string.
hashing.md abs_hash — FNV-1a and djb2.
hash-maps.md abs_hashmap — open-addressing string-keyed map.
time.md abs_time — monotonic and wall-clock timers.
file-io.md abs_fs — file existence, read/write, remove, rename.

Runtime

Document Description
lifecycle.md abs_init, abs_cleanup, del, and the memory pool.
literals-and-constructors.md v(), None/True/False, List/Dict/Set.
types-and-conversions.md AbsType, type(), is_*, to_str/to_int/to_float.
lists-and-ranges.md append, get, len, range, range_step, slice.
loops.md The foreach macro.
dictionaries.md dset/dget and keyed lookups.
sets.md set_add, set_contains, set_union, set_diff.
string-methods.md upper/lower, split/join, strip, startswith/endswith, count.
formatting.md print, print_end, fmt, input, and stringification.
json.md json_parse and json_dump.
functional-helpers.md map_func, filter_func, list_comp.
random-utilities.md seed, randint, choice, sample, shuffle, and more.
math-and-aggregates.md min_val/max_val/sum_val, abs_val, pow_val, round_val.
truthiness-and-logic.md is_true, not_, any, all, eq.
sequences-and-sorting.md sorted, reversed_seq, zip_lists.
oop-lite.md Class / New / set_attr / get_attr.
runtime-files.md fopen_safe, read_file, write_file, close_file.
system.md sleep_sec, time_now, exec_cmd, http_get.
error-handling.md abs_new_error, is_err, and failure behavior.

Scientific layer

Document Description
scientific.md Matrices, statistics, advanced math, combinatorics, paths, CSV, and threading.
ml.md Activations and derivatives, broadcasting, softmax, loss, accuracy, and numerical gradients for neural networks.
general-math.md Scalar math helpers, number theory, geometry, root finding, complex numbers, and raw-array statistics.
data-science.md NumPy-style reshaping and generators, Pandas-style CSV, functional utils, and SciKit-Learn-style preprocessing.
ultimate.md Computational backends (AVX/GPU), scalar autograd, PPM vision and convolution, plotting, and dataframes.
spatial-math.md Modern type aliases, 2D/3D/4D vectors, mat4, and quaternions.

Language features

Document Description
exceptions.md try/catch/end_try, throw, and with context managers.
regex.md re_match, re_findall, and re_sub.
datetime.md datetime_now, strftime_val, and timedelta.
generators.md range_gen and next.
encoding-and-env.md base64_encode, uuid4, os_getenv, and os_setenv.

Framework

Document Description
web-server.md Server, route, server_handle, and server_run.
events.md EventBus, on, and emit.
plugins.md load_library and call_lib_func.
functions.md make_func, def, call_func, memoize, decorate/decorate_func, func_meta, func_name.
introspection.md id, repr, and dir.
itertools.md chain, cycle, and iter_next.

Algorithm suite

Document Description
sorting.md Twelve sorting algorithms, sort_bubble_visual, timeit, and binary_search.

Realtime & crypto

Document Description
websockets.md RFC 6455 ws_accept, ws_send, ws_recv, and the framing helpers.
crypto.md sha256 and hmac_sha256 (FIPS 180-4 / RFC 2104).

Interface

  • Core library — include <abscom/abs.h> to get abs_dynarray, abs_string, abs_hash, abs_hashmap, abs_time, and abs_fs in one header.
  • Dynamic runtime — include <abscom/abs.h> for the Python-inspired var API.
  • ABI/export macrosABS_API controls __declspec(dllexport/dllimport) on Windows and default visibility on GCC/Clang (abs_common.h).
  • The library is built as both a static library and a shared library by default (both_libraries in Meson).

Architecture

graph TD
    subgraph core["abscom core (src/, include/abscom/)"]
        common[abs_common.h - API / ABI macros]
        dyn[abs_dynarray - dynamic array]
        str[abs_string - growable string]
        hash[abs_hash - FNV-1a / djb2]
        map[abs_hashmap - open-addressing map]
        time[abs_time - monotonic / wall clock]
        fs[abs_fs - file I/O]
        rt[abs - Python-like runtime]
        sci[abs_* - matrices, stats, math, CSV, paths, threads]
        ml[abs_ml - activations, loss, gradients]
        lang[abs_except, abs_regex, abs_datetime, abs_gen, abs_encode, abs_env - language features]
        fw[abs_server, abs_events, abs_plugins, abs_func, abs_introspect, abs_itertools - framework]
        algo[abs_sort - sorting, benchmarking, binary search]
        rt2[abs_crypto, abs_ws - SHA-256 / HMAC, WebSockets]
    end

    subgraph users["Consumers"]
        tests[tests/test_* - Meson test suite]
        examples[examples/* - demo programs]
    end

    dyn --> common
    str --> common
    hash --> common
    map --> hash
    time --> common
    fs --> common
    rt --> str
    sci --> rt
    ml --> sci
    lang --> rt
    fw --> rt
    algo --> rt
    rt2 --> rt
    tests --> core
    examples --> core
Loading

See docs/architecture.md for the full layout.

Requirements

  • A C11 compiler (GCC, Clang, or MSVC-compatible).
  • Meson (tested with 1.x) and Ninja for building from source.
  • Windows builds link ws2_32; POSIX builds use the standard socket and clock_gettime interfaces.
  • POSIX builds also link m and pthread for the scientific layer's math and threading.
  • Linux builds link dl for the plugin loader (dlopen/dlsym); macOS provides it through libSystem.
  • No third-party C library dependencies.

Prerequisites

  • Linux/macOS: a C toolchain plus Meson and Ninja.
  • Windows: a MinGW toolchain (e.g. LLVM MinGW) or MSVC, plus Meson and Ninja; the generated build handles ws2_32 automatically.

Development

git clone https://github.com/rkriad585/Abscom.git
cd Abscom
./build.sh            # or .\build.ps1 on Windows

build.sh / build.ps1 wrap meson setup, meson compile, and meson test, and accept --clean, --buildtype, --skip-tests, --install, and --prefix (-Clean, -BuildType, -SkipTests, -Install, -Prefix in PowerShell). The equivalent raw commands:

meson setup build
meson compile -C build
meson test -C build

Run the example programs:

./build/examples/demo
./build/examples/py_demo
./build/examples/data_demo
./build/examples/v6_demo
./build/examples/sci_demo
./build/examples/lang_demo
./build/examples/framework_demo
./build/examples/sort_demo
./build/examples/crypto_demo
./build/examples/ml_demo
./build/examples/ml_train_demo
./build/examples/math_demo
./build/examples/ds_demo
./build/examples/ultra_demo
./build/examples/geom_demo
./build/examples/demo_macros

See docs/development.md for details.

Contributing

Contributions are welcome. Please read CONTRIBUTING.md first, and note the Code of Conduct.

Security

Please report security issues responsibly. See SECURITY.md for the supported versions and reporting policy.

License

Abscom is released under the MIT License.

Acknowledgments

  • Built with Meson and Ninja.
  • The dynamic runtime is inspired by the ergonomics of the Python language.
  • Maintained by rkriad585.

About

A C11 library of reusable data structures and platform utilities, plus a Python-inspired dynamic runtime for scripting-style C programs.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages