Mnemosyne Artificial Intelligence: - In Greek mythology, Mnemosyne (/nɪˈmɒzɪni/; Ancient Greek: Μνημοσύνη) was one of the Titans, who are the children of Uranus (Sky) and Gaia (Earth). She was the goddess of memory and the mother of the nine Muses by Zeus. The name Mnemosyne is derived from the Greek word mnēmē ('remembrance, memory').
main()lives inside a static library, not in the executable.
The executable links the library and contains no entrypoint of its own.
At link time, the linker pulls the object file containing main() out of the static library,
so the program effectively runs the library.
This example uses standard C++23 modules with MSVC and stays close to the metal (batch build, VS projects, and CMake).
The static library contains both functionality and the process entrypoint.
Folders:
modules/— module interface units (.ixx)src/— module implementation units and normal translation units (.cpp)include/— headers used by non-module translation units
Modules and sources:
-
mylib.ixx
Module interface for the example library API -
mylib.cpp
Module implementation -
core.log.ixx/core.log.cpp
Logging system using C++23<print>with console, file, and debugger sinks -
core.time.ixx/core.time.cpp
Monotonic timing utilities and a simple frame clock -
core.assert.ixx/core.assert.cpp
Fail-fast assertions (always-on + debug-only) -
core.error.ixx/core.error.cpp
Minimal error / result helpers -
core.env.ixx/core.env.cpp
Environment variable helpers -
core.path.ixx/core.path.cpp
Executable path and path utilities -
core.string.ixx/core.string.cpp
Small string helpers (trim / split / join) -
core.format.ixx/core.format.cpp
Formatting helpers (wraps<format>) -
core.id.ixx/core.id.cpp
Strongly-typed IDs -
core.math.ixx/core.math.cpp
Small math helpers (clamp / lerp / align) -
core.memory.ixx/core.memory.cpp
In-process memory records, staging, and commit operations -
core.memory.store.ixx/core.memory.store.cpp
Persistent snapshot I/O for memory records -
core.memory.index.ixx/core.memory.index.cpp
Query indexing and scoring for memory search -
core.memory.stage.ixx/core.memory.stage.cpp
Staging journal (add/edit/commit) for memory records -
runtime.ixx/runtime.cpp
Runtime module that owns initialization, memory loading, and the main loop -
lib_main.cpp
Definesmain()and forwards execution toruntime::run() -
tests_main.cpp
Standalone test executable (only built when tests are enabled)
app.cpp
A translation unit with nomain()
The executable exists purely to link against the static library and host application-side callbacks (currently defined, but not yet invoked).
Shared headers:
include/app_api.h
C-compatible callbacks exposed by the app, consumable by the library
- All modules and
lib_main.cppare compiled intomylib.lib - The executable links against
mylib.lib - The linker resolves
main()from the library because the executable has none - When the program starts, execution begins inside the library runtime
This pattern is useful for:
- engine-style runtimes
- test harnesses
- tool and launcher architectures
- codebases where “the library is the program”
.\build.batThe script:
- compiles module interfaces (
.ixx) to.ifc - compiles module implementations with explicit
/reference - archives everything (including
main) intomylib.lib - links
app.exewithout defining an entrypoint
- Open
StaticLibEntryPoint.sln - Right-click App and select Set as Startup Project
- Build and run
Notes:
- The App project intentionally does not define
main() - Module dependency scanning is enabled
- No custom build steps are required
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config ReleaseOptional tests target:
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DMNEMOSYNE_BUILD_TESTS=ON
cmake --build build --config Release --target testsWhen run, the program:
- logs startup via
core.log - loads the memory store from
data/memory(relative to the executable) - calls
mylib::entry()and logs its return value - enters a loop driven by
core.time::frame_clock - prints one line per second
The loop is intentionally simple and exists only to prove:
- the runtime lives in the library
- systems initialize in a controlled order
- the process lifetime is owned by the library
- memory staging and query plumbing is working
Runs exactly 3 frames and exits cleanly.
.\build.bat smokeSmoke mode runs a short memory staging flow (stage → commit → query) and then exits after 3 frames.
Builds and runs a small tests.exe linked against the same library.
.\build.bat testsThis is not a framework and not a build system replacement. It is a minimal, correct, reproducible example of an internal-entrypoint architecture using pure C++23 modules, suitable as a foundation for adding additional systems.