VIBE (Values In Bracket Expression) is a hierarchical configuration file format designed for human readability and fast machine parsing. It combines the visual clarity of structured formats with the simplicity of minimal syntax.
Like its namesake, VIBE aims to create good vibes in your development workflow by eliminating the frustration of complex configuration formats. No more YAML indentation nightmares or JSON comma catastrophes - just smooth, readable config that flows naturally.
- 🎯 Simple Syntax - Only 5 token types, minimal punctuation
- 👀 Visual Hierarchy - Structure is immediately apparent
- ⚡ Fast Parsing - Single-pass O(n) with no backtracking
- 🔒 Unambiguous - One canonical way to represent data
- 💬 Comments - Built-in support with
# - 🌍 Unicode Support - UTF-8 strings with proper escaping
- 🎨 Flexible Whitespace - No significant indentation rules
- 🔧 Type Inference - Automatic detection of integers, floats, booleans, strings
- 🛡️ Stability by Design - Arrays of objects are forbidden, forcing stable named entities (see Philosophy)
# Application configuration
application {
name "My Awesome App"
version 2.1.0
debug false
}
server {
host localhost
port 8080
ssl {
enabled true
cert_path /etc/ssl/cert.pem
}
}
# Server pool
servers [
prod1.example.com
prod2.example.com
prod3.example.com
]
# Feature flags
features {
new_ui true
beta_api false
analytics true
}
git clone https://github.com/1ay1/vibe.git
cd vibe
makeVIBE includes a powerful interactive parsing tool with a beautiful TUI (Terminal User Interface) that visualizes the parsing process step-by-step:
make parser_tool
./vibe_parser_tool examples/simple.vibeFeatures:
- 📊 Real-time visualization of parsing steps
- 🎯 Current line highlighting with yellow background
- 🔍 Token stream analysis with color-coded types
- 📚 Interactive VIBE spec tutorial that teaches as you parse
- 🔄 API call tracing with detailed parameters and results
- 💾 Memory and performance statistics
- ⏮️ Step forward/backward navigation
- 🎨 Modern card-based UI with ASCII art
Keyboard Controls:
SPACE/N- Step forwardB- Step backwardShift+B- Fast backward (rewind to start)F- Fast forward (jump to end)P- Play/Pause auto-play modeR- Reset to beginningQ- Quit
Perfect for learning VIBE syntax, debugging configs, and understanding how the parser works!
Step 1: Create a VIBE config file (config.vibe):
# My application config
application {
name "My Awesome App"
version 1.0
debug false
}
server {
host localhost
port 8080
ssl {
enabled true
cert /etc/ssl/cert.pem
}
}
servers [
prod1.example.com
prod2.example.com
prod3.example.com
]
Step 2: Parse and use it in C (myapp.c):
#include "vibe.h"
#include <stdio.h>
int main() {
// 1. Create parser
VibeParser* parser = vibe_parser_new();
// 2. Parse the config file
VibeValue* config = vibe_parse_file(parser, "config.vibe");
if (!config) {
VibeError error = vibe_get_last_error(parser);
fprintf(stderr, "Error at line %d: %s\n", error.line, error.message);
vibe_parser_free(parser);
return 1;
}
// 3. Access values using dot notation paths
// Format: "object.nested_object.key"
const char* name = vibe_get_string(config, "application.name");
int64_t port = vibe_get_int(config, "server.port");
bool debug = vibe_get_bool(config, "application.debug");
bool ssl = vibe_get_bool(config, "server.ssl.enabled");
printf("Application: %s\n", name ? name : "Unknown");
printf("Port: %lld\n", (long long)port);
printf("Debug mode: %s\n", debug ? "ON" : "OFF");
printf("SSL: %s\n", ssl ? "enabled" : "disabled");
// 4. Access arrays
VibeArray* servers = vibe_get_array(config, "servers");
if (servers) {
printf("\nServers (%zu total):\n", servers->count);
for (size_t i = 0; i < servers->count; i++) {
VibeValue* server = servers->values[i];
if (server->type == VIBE_TYPE_STRING) {
printf(" %zu. %s\n", i + 1, server->as_string);
}
}
}
// 5. Clean up (frees entire config tree)
vibe_value_free(config);
vibe_parser_free(parser);
return 0;
}Step 3: Compile and run:
gcc -o myapp myapp.c vibe.c -std=c11
./myappOutput:
Application: My Awesome App
Port: 8080
Debug mode: OFF
SSL: enabled
Servers (3 total):
1. prod1.example.com
2. prod2.example.com
3. prod3.example.com
For complete API documentation with detailed examples, see docs/API.md
Quick Links:
- Parser Management - Creating and managing parsers
- Parsing Functions - Parse strings and files
- Value Access - Access values with dot notation
- Object Operations - Working with objects
- Array Operations - Working with arrays
- Memory Management - Cleanup and freeing
- Error Handling - Handling parse errors
- Complete Examples - Full working examples
key value
database {
host localhost
port 5432
}
ports [8080 8081 8082]
servers [
server1.com
server2.com
server3.com
]
- Integers:
42,-17 - Floats:
3.14,-0.5 - Booleans:
true,false - Strings:
"quoted"orunquoted(for simple values)
# Full line comment
key value # Inline comment
message "Hello \"World\""
path "C:\\Users\\Name"
unicode "Hello 世界"
VibeParser* vibe_parser_new(void);
void vibe_parser_free(VibeParser* parser);VibeValue* vibe_parse_string(VibeParser* parser, const char* input);
VibeValue* vibe_parse_file(VibeParser* parser, const char* filename);VibeValue* vibe_get(VibeValue* root, const char* path);
const char* vibe_get_string(VibeValue* value, const char* path);
int64_t vibe_get_int(VibeValue* value, const char* path);
double vibe_get_float(VibeValue* value, const char* path);
bool vibe_get_bool(VibeValue* value, const char* path);
VibeArray* vibe_get_array(VibeValue* value, const char* path);
VibeObject* vibe_get_object(VibeValue* value, const char* path);void vibe_object_set(VibeObject* obj, const char* key, VibeValue* value);
VibeValue* vibe_object_get(VibeObject* obj, const char* key);
void vibe_array_push(VibeArray* arr, VibeValue* value);
VibeValue* vibe_array_get(VibeArray* arr, size_t index);void vibe_value_free(VibeValue* value);VibeError vibe_get_last_error(VibeParser* parser);
void vibe_error_free(VibeError* error);For the complete format specification, see SPECIFICATION.md.
| Feature | VIBE | JSON | YAML | TOML |
|---|---|---|---|---|
| Human Readable | ✅ | ❌ | ✅ | ✅ |
| Minimal Syntax | ✅ | ❌ | ✅ | ✅ |
| Visual Hierarchy | ✅ | ✅ | ❌ | ❌ |
| Fast Parsing | ✅ | ✅ | ❌ | ✅ |
| No Indentation Rules | ✅ | ✅ | ❌ | ✅ |
| Comments | ✅ | ❌ | ✅ | ✅ |
| Single Pass Parse | ✅ | ✅ | ❌ | ✅ |
| No Reserved Words | ✅ | ❌ | ❌ | ❌ |
Choose VIBE when:
- Configuration files need to be human-readable and editable
- Fast parsing is important
- Visual structure clarity is valued
- Simple syntax is preferred
- You want to avoid indentation sensitivity (YAML) or verbosity (JSON/XML)
make # Build everything
make clean # Clean build artifactsmake demo # Quick demo
make test # Run all tests
./vibe_example simple.vibe
./vibe_example config.vibeTo use VIBE in your C project:
- Copy
vibe.handvibe.cto your project - Add
vibe.cto your build system - Include
vibe.hin your source files - Link and compile with C11 support
gcc -std=c11 -c vibe.c
gcc -std=c11 -o myapp myapp.c vibe.oCheck out the examples/ directory for more usage examples:
simple.vibe- Basic configuration with simple arraysconfig.vibe- Complex nested structure using named objectsweb_server.vibe- Web server configuration exampledatabase.vibe- Database configuration with replicasexample.c- Complete C usage example
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Additional language implementations (Python, Rust, Go, JavaScript)
- Schema validation tools
- Editor plugins (VS Code, Vim, Emacs)
- Conversion tools (JSON↔VIBE, YAML↔VIBE, TOML↔VIBE)
- Performance optimizations
- More comprehensive test suite
This project is licensed under the MIT License - see the LICENSE file for details.
- Core parser implementation (C)
- Complete specification
- Python bindings
- Rust implementation
- JavaScript/Node.js implementation
- Go implementation
- VS Code syntax highlighting extension
- Schema validation support
- Format converter tools
- Benchmark suite
- 📖 Read the Specification
- 💬 Open an Issue
- 🌟 Star the project if you find it useful!
Inspired by the need for a configuration format that's:
- Simpler than YAML
- More readable than JSON
- Faster to parse than both
- More flexible than TOML
Keep calm and VIBE on! 🌊
Configuration doesn't have to be complicated. Sometimes the best solution is the one that just feels right.