A high-performance C library providing mathematical tools, data structures, and utilities for game development and systems programming. Part of the MIDAS Toolchain.
Daedalus is a collection of well-tested data structures and math utilities designed for real-time applications. It includes dynamic/static arrays, hash tables, string builders, vector/matrix math, and a comprehensive logging system.
git clone https://github.com/your-repo/daedalus.git
cd daedalus
make shared # Build shared library
sudo make install # Install to /usr/lib/ and /usr/include/Then, in your C projects:
#include <Daedalus.h> // System-wide header
// Link with: gcc your_code.c -lDaedalusmake EM # Creates bin/libDaedalus.a static libraryCopy these files to your Emscripten project:
bin/libDaedalus.a → your lib/ directory
include/Daedalus.h → your include/ directory
Then compile with:
emcc your_code.c lib/libDaedalus.a -I include/ -o output.htmlmake clean # Remove all build artifacts
sudo make uninstall # Remove system installationBefore Daedalus (Dangerous C)
char* name = malloc(256); // No error checking
strcpy(name, "Player"); // Buffer overflow risk
strcat(name, " Character"); // More overflow risk
printf("Created: %s\n", name); // No structured logging
free(name); // Manual cleanup requiredAfter Daedalus (Master-Crafted)
dString_t* name = d_StringInit();
d_StringAppend(name, "Player", 0);
d_StringAppend(name, " Character", 0);
d_LogInfoF("Created: %s", d_StringPeek(name));
d_StringDestroy(name); // Automatic, safe cleanupThe Result: Safer, cleaner code with automatic memory management.
Comprehensive usage guides are available for all major components:
- Dynamic Strings - Python-like string operations, formatting, slicing, and templates
- Dynamic Arrays - Resizable arrays with automatic growth and flexible operations
- Static Arrays - Fixed-capacity arrays with predictable memory and file persistence
- Dynamic Hash Tables - Resizable hash tables with automatic rehashing
- Static Hash Tables - Fixed-key hash tables optimized for known key sets
- Logging System - Professional-grade logging with filtering, structured output, and rate limiting
Each guide includes quick-start examples, complete API reference, best practices, and real-world usage patterns.
dString_t* path = d_StringInit();
const char* parts[] = {"usr", "local", "bin"};
d_JoinStrings(path, parts, 3, "/");
printf("%s\n", d_StringPeek(path)); // Output: usr/local/bin
d_StringDestroy(path);dArray_t* enemies = d_ArrayInit(10, sizeof(Enemy));
Enemy goblin = {.health = 50, .type = GOBLIN};
d_ArrayAppend(enemies, &goblin);
d_ArrayRemove(enemies, 0); // Remove first enemy
d_ArrayDestroy(enemies);// String-keyed configuration
dTable_t* config = d_TableInit(sizeof(char*), sizeof(int),
d_HashString, d_CompareString, 16);
char* key = "max_health";
int value = 100;
d_TableSet(config, &key, &value);
d_TableDestroy(&config);d_LogInfoF("Player %s joined at position (%.2f, %.2f)", name, x, y);
d_LogErrorF("Connection failed: code %d", error_code);
// Structured logging with JSON output
dLogStructured_t* log = d_LogStructured(D_LOG_LEVEL_INFO);
d_LogStructured_Field(log, "event", "user_login");
d_LogStructured_FieldInt(log, "user_id", 12345);
d_LogStructured_Commit(log);For comprehensive examples and complete API documentation, see the wiki documentation.
- Performance: Optimized algorithms and memory layouts for real-time use
- Type Safety: Generic data structures with consistent APIs
- Web Ready: Full Emscripten/WebAssembly support
- Easy to Use: Comprehensive documentation and built-in utilities
Daedalus is part of the MIDAS development toolchain:
- Metis: C linter
- Ixion: Memory safety tools
- Daedalus: Core library (math, data structures, utilities)
- Archimedes: UI framework
- Sisyphus: Testing framework