What is Rix?
Rix is the unified userland library layer for Vix.cpp applications.
It gives Vix C++ projects optional packages and one clean facade object:
#include <rix.hpp>
int main()
{
rix.debug.print("Hello", "Rix");
auto auth = rix.auth.memory();
return 0;
}Rix is not a runtime.
Rix is not a CLI.
Rix is not a package manager.
Rix does not replace Vix.cpp.
Vix.cpp provides the runtime, command-line workflow, build system integration, registry workflow, and core modules.
Rix provides optional application-level libraries that sit on top of Vix.cpp.
Vix.cpp
runtime
CLI
build workflow
registry integration
core modules
Rix
userland packages
application helpers
unified rix.* facadeWhy Rix exists
Vix.cpp gives C++ applications a modern workflow.
It helps developers create, build, run, test, format, package, and publish C++ projects with a consistent command surface.
But real applications often need higher-level libraries.
For example, an application may need:
- authentication
- CSV parsing
- debugging helpers
- PDF generation
- configuration helpers
- table utilities
- future application packages
These are useful application-level tools, but they should not all live inside the Vix.cpp core runtime.
Rix exists to keep that separation clean.
If it is a core primitive, it belongs in Vix.cpp.
If it is an application helper, it belongs in Rix.The basic idea
Rix packages can be used through one public facade:
#include <rix.hpp>
int main()
{
rix.debug.print("Hello", "Rix");
return 0;
}The global rix object groups the mounted Rix packages:
rix.auth
rix.debugIn this documentation, the public examples use the unified facade.
That means examples should prefer:
rix.auth.memory()instead of starting with lower-level package internals.
The lower-level rixlib::... namespaces are still available for advanced usage, independent package usage, and implementation-level code.
Rix and Vix.cpp
Rix depends on the Vix.cpp workflow.
You still use Vix commands to manage the project:
vix add @rix/rix
vix install
vix build
vix run
vix testsRix only gives you the C++ library APIs.
Vix.cpp still handles the project lifecycle.
You install Rix with Vix.
You build Rix projects with Vix.
You run Rix examples with Vix.
You test Rix packages with Vix.Rix packages
A Rix package follows a stable model:
Package : @rix/name
Header : <rix/name.hpp>
Namespace: rixlib::name
Facade : rix.nameExample for Auth:
Package : @rix/auth
Header : <rix/auth.hpp>
Namespace: rixlib::auth
Facade : rix.authWhen using the unified facade, include:
#include <rix.hpp>Then use:
rix.authThe unified facade
The unified facade is the easiest way to use Rix.
Install:
vix add @rix/rix
vix installUse:
#include <rix.hpp>
int main()
{
auto auth = rix.auth.memory();
return 0;
}The facade is useful when an application wants one clean object-style API.
It keeps public examples simple and consistent.
Independent packages
Rix packages can also be used independently.
This is useful when an application only needs one package and does not want the full facade.
Example model:
vix add @rix/auth
vix installThen the package can expose its own lower-level API.
However, this documentation starts with the unified facade because it is the recommended public path for Rix users.
Current focus
This documentation currently starts with rix/auth.
Rix Auth provides authentication helpers for Vix.cpp applications:
- user registration
- login
- password hashing
- server-side sessions
- short-lived tokens
- logout
- session validation
- explicit errors
Example:
#include <rix.hpp>
int main()
{
auto auth = rix.auth.memory();
auto registered = auth.register_user({"ada@example.com","correct-password"});
if (registered.failed())
{
const auto &error = registered.error();
rix.debug.eprint(
"auth error:",
rix.auth.error.to_string(error),
error.message()
);
return 1;
}
rix.debug.print("registered:", registered.value().email());
return 0;
}What Rix is not
Rix is not a replacement for Vix.cpp.
Rix is not a second standard library.
Rix is not a framework that owns your whole application.
Rix is not a new build system.
Rix is not a new language layer over C++.
Rix is a set of focused C++ packages for applications built with Vix.cpp.
How to think about Rix
A useful way to understand Rix is:
C++ -> language and native execution
Vix.cpp -> runtime, CLI, build workflow, registry, core modules
Rix -> optional userland libraries for application problemsFor example:
Need to build and run the project? Use Vix.cpp.
Need to add an authentication library? Use Rix Auth.
Need one clean API for installed Rix packages? Use the Rix facade.What you should remember
Rix is the userland library layer for Vix.cpp applications.
Use the unified facade in public code:
#include <rix.hpp>Use mounted modules through:
rix.auth
rix.debugUse Vix commands for the workflow:
vix add @rix/rix
vix install
vix build
vix runRix adds application-level libraries on top of Vix.cpp.
It does not replace Vix.cpp.
Next step
Install Rix in a Vix.cpp project.
Next: Installation