Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,52 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
---

## [Unreleased]
## [v2.3.0]

### Features

- feat(run): ultra-fast direct C++ execution
Introduces a new execution mode that compiles and runs single C++ files instantly without CMake.

- feat(run): smart CMake fallback
Automatically falls back to CMake when the script requires complex dependencies or project structure.

- feat(run,check): add --local-cache for script mode
Enables local caching for faster repeated executions and unified cache behavior.

- feat(run,build): add SQLite/MySQL flags
Adds support for database flags directly in run/build workflows.

### Improvements

- improve(run): global cache for script builds
Script builds are now cached globally and keyed by absolute file path for better reuse.

- improve(run): better executable detection
Resolves executables from actual build directories (`bin/`, scanned targets) instead of assuming project names.

- improve(run): reorganized execution pipeline
Cleaner and more robust run flow with improved process handling.

- improve(config): enhance configuration system
Improved config structure and handling in core module.

### Fixes

- fix(run): detect Vix runtime scripts correctly in fallback mode
Prevents incorrect fallback behavior when running Vix-based scripts.

- fix(build): improve CMake error detection
Fixes misleading build errors and improves project root handling.

- fix(utils): clean up configuration template
Removes redundant content in `vix_utilsConfig.cmake`.

### Examples

- update(examples): improve run examples
Updated examples for blocking, background, and dynamic port usage.

## [v2.2.0]

### Features
Expand Down
152 changes: 76 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@
</a>
</p>

<p>
<b>A modern C++ runtime for real-world systems.</b>
</p>
<h3>Remove the friction from C++.</h3>

<p>
Build HTTP, WebSocket, and peer-to-peer applications with
<b>predictable performance</b> and <b>offline-first reliability</b>.
A modern runtime for building C++ applications.
</p>

<p>
🌍 <a href="https://vixcpp.com">Website</a> ·
📘 <a href="https://vixcpp.com/docs">Docs</a> ·
⬇️ <a href="https://github.com/vixcpp/vix/releases">Download</a>
<a href="https://vixcpp.com"><b>Website</b></a> ·
<a href="https://vixcpp.com/docs"><b>Docs</b></a> ·
<a href="https://vixcpp.com/install"><b>Install</b></a> ·
<a href="https://github.com/vixcpp/vix/releases"><b>Download</b></a>
</p>

</td>
Expand All @@ -44,23 +42,6 @@

## Install

#### Linux

```bash
sudo apt update
sudo apt install -y \
build-essential cmake ninja-build pkg-config git curl unzip zip \
libssl-dev libsqlite3-dev zlib1g-dev libbrotli-dev \
nlohmann-json3-dev \
libspdlog-dev libfmt-dev
```

## macOS Dependencies (example)

```bash
brew install cmake ninja pkg-config openssl@3 spdlog fmt nlohmann-json brotli
```

## <a href="https://vixcpp.com/install">Shell (Linux, macOS)</a>

```bash
Expand All @@ -73,91 +54,118 @@ curl -fsSL https://vixcpp.com/install.sh | bash
irm https://vixcpp.com/install.ps1 | iex
```

Verify installation:
## Run C++ instantly

```bash
vix --version
```cpp
#include <iostream>

int main(){
std::cout << "Hello, world!" << std::endl;
}
```

## Build from source
```bash
git clone --recurse-submodules https://github.com/vixcpp/vix.git
cd vix

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

# Install for current user (recommended)
cmake --install build --prefix "$HOME/.local"

# Ensure PATH contains ~/.local/bin then restart your terminal
vix --version
vix doctor
vix run main.cpp
```

## Your first Vix.cpp program
Done.

Create a file called `server.cpp`:
## Build a server

```cpp
#include <vix.hpp>

using namespace vix;

int main() {
int main(){
App app;

app.get("/", [](Request&, Response& res) {
app.get("/", [](Request&, Response& res){
res.send("Hello, world!");
});

app.run(8080);
}
```

Run it:

```bash
vix run server.cpp
```

Open http://localhost:8080
That’s it.
→ http://localhost:8080

## Script mode (no project setup)
---

Run C++ like a script:
## Install a framework in 1 command

```bash
vix run main.cpp
vix install -g cnerium/app
```

## Shell completion
```cpp
#include <cnerium/app/app.hpp>
using namespace cnerium::app;

int main(){
App app;

app.get("/", [](AppContext &ctx){
ctx.text("Hello from Cnerium");
});

Enable tab completion for Vix commands.
app.listen("127.0.0.1", 8080);
}
```

```bash
source <(vix completion bash)
vix run main.cpp
```

Make it permanent:
## WebSocket

```bash
vix completion bash > ~/.vix-completion.bash
echo 'source ~/.vix-completion.bash' >> ~/.bashrc
```cpp
#include <memory>
#include <vix/executor/RuntimeExecutor.hpp>
#include <vix/websocket.hpp>

int main(){
auto exec = std::make_shared<vix::executor::RuntimeExecutor>();

vix::websocket::App app{"config/config.json", exec};
auto &ws = app.server();

ws.on_typed_message([](auto &,
const std::string &type,
const vix::json::kvs &payload)
{
if (type == "chat.message")
return payload;
});

app.run_blocking();
}
```

Learn more: https://vixcpp.com/docs/modules/cli/completion
## What Vix.cpp gives you

- Run a single `.cpp` file instantly
- No CMake required for simple apps
- Native C++ performance
- HTTP, WebSocket, P2P ready
- Offline-first architecture support
- Deterministic execution

## Why Vix.cpp

Most systems assume perfect conditions.
Vix is built for when things are not.
## Why Vix exists

- predictable under load
- no GC pauses
- offline-first by design
- deterministic execution
- minimal setup
C++ is powerful.

But:
- too much setup
- too much friction
- too slow to start

Vix removes that.

## Performance

Expand All @@ -169,14 +177,6 @@ Stable under sustained load.
| Avg Latency | ~13–20 ms |
| P99 Latency | ~17–50 ms |

## Core principles

- Local-first execution
- Network is optional
- Deterministic behavior
- Failure-tolerant
- Built for unreliable environments

## Learn more

- Docs: https://vixcpp.com/docs
Expand Down
1 change: 0 additions & 1 deletion examples/01_run_blocking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ int main()
app.get("/", [](Request &, Response &res)
{ res.text("Hello Vix"); });

// Bloque le thread courant
app.run(8080);
}
4 changes: 1 addition & 3 deletions examples/02_listen_background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ int main()
app.get("/health", [](Request &, Response &res)
{ res.json({"ok", true}); });

// Lance le serveur en background
app.listen(8080, []()
{ std::cout << "Server is ready and accepting connections\n"; });
{ console.log("Server is ready and accepting connections"); });

// Attente propre
app.wait();
}
1 change: 0 additions & 1 deletion examples/03_listen_port_dynamic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ int main()
app.get("/", [](Request &, Response &res)
{ res.text("Dynamic port example"); });

// Port 0 → choisi par l’OS
app.listen_port(0, [](int port)
{ console.log("Listening on http://localhost:", port); });

Expand Down
2 changes: 1 addition & 1 deletion modules/core
2 changes: 1 addition & 1 deletion modules/utils
Loading