Files
IACore/README.md
2025-12-15 23:51:06 +05:30

6.5 KiB

IACore (Independent Architecture Core)

IACore Logo
License C++ Standard Platform

The Battery-Included Foundation for High-Performance C++ Applications.

📖 Description

IACore is a high-performance, battery-included C++20 foundation library designed to eliminate "dependency hell." It bundles essential systems—IPC, Logging, Networking, Compression, and Async Scheduling—into a single, coherent API.

Originally developed as the internal core for IASoft (PVT) LTD., it is now open-source to provide a standardized bedrock for C++ applications.

Features

  • 🚀 High-Performance IPC: Shared-Memory Ring Buffers with wait-free SPSC synchronization.
  • 🌐 Networking: Integrated HTTP/HTTPS client (wrapper around cpp-httplib with automatic Zlib/Gzip handling).
  • 🧵 Async Scheduler: A job system with high/normal priority queues and work stealing.
  • 💾 File I/O: Memory-mapped file operations and optimized binary stream readers/writers.
  • 📦 Compression: Unified API for Zlib, Gzip, and Zstd.
  • 📜 Logging: Thread-safe, colored console and disk logging.
  • Modern C++: Heavily uses C++20 concepts, std::span, and tl::expected for error handling.

🛠️ Integration

IACore is built with CMake. You can include it in your project via FetchContent or by adding it as a subdirectory.

Note: On Windows, you must have VCPKG installed and the VCPKG_ROOT environment variable set, for OpenSSL support.

CMake Example

add_subdirectory(IACore)

add_executable(MyApp Main.cpp)
target_link_libraries(MyApp PRIVATE IACore)

📦 Dependencies

IACore manages its own dependencies via CMake's FetchContent. You do not need to install these manually:

  • JSON: nlohmann_json, glaze, & simdjson
  • Networking: cpp-httplib
  • Compression: zlib-ng & zstd
  • Utilities: tl-expected & unordered_dense

💡 Usage Examples

1. IPC (Manager & Node)

IACore provides a manager/node architecture using shared memory.

Manager:

#include <IACore/IPC.hpp>

// Spawns a child process and connects via Shared Memory
auto nodeID = manager.SpawnNode("MyChildNodeExe");
manager.WaitTillNodeIsOnline(*nodeID);

// Send data with zero-copy overhead
String msg = "Hello Node";
manager.SendPacket(*nodeID, 100, {(PCUINT8)msg.data(), msg.size()});

Node:

#include <IACore/IPC.hpp>

class Node : public IACore::IPC_Node {
public:
    void OnSignal(uint8_t signal) override {
        // Handle signals
    }

    void OnPacket(uint16_t packetID, std::span<const uint8_t> payload) override {
        // Handle packets
    }
};

int main(int argc, char* argv[]) {
    // The connection string is passed as the first argument by the Manager
    if (argc < 2) return -1;
    
    Node node;
    // Connect back to the manager via Shared Memory
    if (!node.Connect(argv[1])) return -1;
    
    while(true) {
        node.Update();
    }
    return 0;
}

2. Async Jobs


#include <IACore/AsyncOps.hpp>

// Initialize worker threads (hardware_concurrency - 2)
IACore::AsyncOps::InitializeScheduler();

// Schedule a task
IACore::AsyncOps::Schedule *mySchedule = new IACore::AsyncOps::Schedule();

IACore::AsyncOps::ScheduleTask([](auto workerID) {
    printf("Running on worker %d\n", workerID);
}, 0, mySchedule);

// Wait for completion
IACore::AsyncOps::WaitForScheduleCompletion(mySchedule);

3. HTTP Request

#include <IACore/HttpClient.hpp>

IACore::HttpClient client("https://api.example.com");
auto res = client.JsonGet<MyResponseStruct>("/data", {});

if (res) {
    std::cout << "Data: " << res->value << "\n";
} else {
    std::cerr << "Error: " << res.error() << "\n";
}

🤝 Contributing

We welcome contributions from the community! However, to maintain the architectural integrity and licensing flexibility of the project, we have specific guidelines for Pull Requests.

What we accept immediately:

  • 📚 Documentation: Improvements to comments, the README, or external docs.
  • 🧪 Tests: New unit tests (in Tests/) to improve coverage or reproduce bugs.
  • 💡 Examples: New usage examples or sample projects.
  • 🐛 Bug Reports: detailed issues describing reproduction steps are highly valued.

Core Library Policy (Src/ Directory)

Currently, we are not accepting Pull Requests that modify the core source code (Src/).

Why? IACore is a dual-licensed product. To offer commercial licenses to proprietary software vendors in the future, IASoft (PVT) LTD. must retain 100% copyright ownership of the core library.

We are currently establishing a Contributor License Agreement (CLA) process. Once that is in place, we will open the core library for contributions, provided the contributor signs the CLA to assign copyright or grant an unlimited license to the project maintainers.

If you find a critical bug in Src/, please open an Issue rather than a PR, and the core team will implement the fix to ensure legal compliance.

🤝 Credits & Acknowledgements

IACore is an architectural effort by IASoft (PVT) LTD., designed and maintained by its lead developers.

While the core architecture, API design, and final logic verification were strictly human-led, this project leveraged Google Gemini 3 as an advanced AI thought partner to accelerate development.

AI contributions include:

  • Boilerplate Generation: Rapid prototyping of standard C++20 structures and repetitive implementations.

  • Research & Selection: Analyzing and comparing open-source libraries (e.g., glaze vs. nlohmann, zstd vs. lz4) to select the best-in-class dependencies.

  • Design Analysis: Researching and contrasting design patterns (e.g., SPSC Ring Buffers vs. Mutex Queues) for optimal performance.

  • Documentation: Drafting comprehensive documentation and this README.

  • Code Review: Automated logic checking and static analysis support.

Methodology: Every line of code, whether written by hand or generated by AI, has been manually reviewed, tested, and verified by human engineers to ensure zero hallucinations and maximum reliability. Trust, but verify.

⚖️ License

This project is licensed under the GNU General Public License v3 (GPLv3).