| Crates.io | jcl |
| lib.rs | jcl |
| version | 1.2.0 |
| created_at | 2025-11-19 04:44:16.733482+00 |
| updated_at | 2025-11-25 06:01:13.432158+00 |
| description | Jack-of-All Configuration Language - A general-purpose configuration language with powerful built-in functions |
| homepage | |
| repository | https://github.com/hemmer-io/jcl |
| max_upload_size | |
| id | 1939413 |
| size | 1,613,491 |
A modern, safe, and flexible general-purpose configuration language with powerful built-in functions, written in Rust.
JCL is a general-purpose configuration language designed to be human-readable, type-safe, and powerful. It provides a rich standard library of functions for data manipulation, encoding/decoding (YAML, JSON, Base64), templating, string operations, and more. Built in Rust for performance and safety, JCL can be embedded in other tools (like Hemmer for IaC) or used standalone for configuration management.
💡 Recommended: Use JCL as a library for best performance (50-100x faster than CLI).
pip install jcl-lang
import jcl
# Load and evaluate a JCL file (~0.05ms)
config = jcl.eval_file("config.jcf")
print(config["app_name"])
# Parse from string
result = jcl.eval('x = 42\ny = "hello"')
print(result) # {'x': 42, 'y': 'hello'}
# Format JCL code
formatted = jcl.format('x=42') # Returns: 'x = 42'
# Lint for issues
issues = jcl.lint(source_code)
npm install @hemmer-io/jcl
const jcl = require('@hemmer-io/jcl');
// Load and evaluate a JCL file (~0.05ms)
const config = jcl.evalFile('config.jcf');
console.log(config.app_name);
// Parse from string
const result = jcl.eval('x = 42\ny = "hello"');
console.log(result); // {x: 42, y: 'hello'}
// Format and lint
const formatted = jcl.format('x=42');
const issues = jcl.lint(sourceCode);
gem install jcl
require 'jcl'
# Load and evaluate a JCL file (~0.05ms)
config = JCL.eval_file('config.jcf')
puts config['app_name']
# Parse from string
result = JCL.eval('x = 42\ny = "hello"')
puts result # {'x' => 42, 'y' => 'hello'}
# Format and lint
formatted = JCL.format('x=42')
issues = JCL.lint(source_code)
# Install
cargo install jcl
# Evaluate a JCL file (~5ms with subprocess overhead)
jcl eval config.jcf
# Run the interactive REPL
jcl repl
# Format JCL files
jcl-fmt config.jcf
# Validate against a schema
jcl-validate --schema schema.jcf config.jcf
# Migrate from other formats
jcl-migrate config.json --from json
pip install jcl-lang - Docsnpm install @hemmer-io/jcl - Docsgem install jcl - Docs# Via Cargo (Rust)
cargo install jcl
# Via Binary Download (6 platforms available)
# Download from: https://github.com/hemmer-io/jcl/releases
# Supported: Linux (x86_64, ARM64, MUSL), macOS (Intel, Apple Silicon), Windows
# From Source
git clone https://github.com/hemmer-io/jcl.git
cd jcl
cargo build --release
🎯 General-Purpose Configuration
🔒 Type Safety
🚀 Powerful Built-in Functions
🏗️ Flexible Syntax
"Hello, ${name}!"# Simple, readable configuration
environments = ["prod", "dev", "staging"]
env_prod = (
region = "us-west-2",
vars = (
app_name = "myapp",
version = "1.2.3",
replicas = 3
),
tags = (
team = "platform",
cost_center = "engineering"
)
)
# String interpolation
greeting = "Hello, ${env_prod.vars.app_name}!"
# Built-in functions
uppercased = upper(env_prod.vars.app_name)
config_json = jsonencode(env_prod.vars)
config_yaml = yamlencode(env_prod.vars)
# Collections and data manipulation
regions = ["us-west-2", "us-east-1", "eu-west-1"]
region_count = length(regions)
merged_tags = merge(env_prod.tags, (environment = "prod", managed_by = "jcl"))
# List comprehensions
formatted_regions = [upper(r) for r in regions]
sorted_regions = sort(formatted_regions)
joined_regions = join(sorted_regions, ", ")
# Range syntax for generating sequences
numbers = [0..10] # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
evens = [0..10:2] # [0, 2, 4, 6, 8, 10]
countdown = [10..1:-1] # [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
squares = [x * x for x in [1..10]] # [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
# ⭐ NEW: Transparent lazy evaluation (automatic optimization!)
# Only processes first 10 elements, not all 1000 - completely transparent!
first_ten = [x * 2 for x in [0..1000]][0:10]
# [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
# Higher-order functions work with both lists and streams
doubled = map(x => x * 2, [1, 2, 3, 4, 5]) # [2, 4, 6, 8, 10]
evens_filtered = filter(x => x % 2 == 0, [1, 2, 3, 4, 5, 6]) # [2, 4, 6]
# Heredoc strings for embedding scripts/configs
startup_script = <<BASH
#!/bin/bash
echo "Starting ${env_prod.vars.app_name}..."
./run.sh --port 8080
BASH
[] and maps () with comprehensive manipulation functions[0..10], [0..<5], [0..10:2] for inclusive, exclusive, and stepped rangesusers[*].name as shorthand for comprehensions"Hello, ${name}!" syntax for dynamic strings<<EOF) with indentation stripping (<<-EOF) for embedding scripts, SQL, YAML, etc.?. optional chaining and ?? null coalescing operatorsx => x * 2) and named functions (fn double(x) = x * 2)[x * 2 for x in numbers if x > 0]map, filter, reduce, stream, take, collect[expr for x in list][slice] patternstry() for graceful error recoveryjcl-fmt): Automatic code formatting with configurable stylejcl-validate): Schema-based validationjcl-migrate): Convert from JSON, YAML, TOML to JCLjcl-watch): Auto-format on file changesjcl-bench): Performance measurement tools| Approach | Typical Latency | Use Case |
|---|---|---|
| Library (Python/Node/Ruby) | ~0.05ms | ✅ Production apps, web servers, CI/CD |
| CLI | ~5ms | ⚠️ Standalone scripts, one-off tasks |
Performance tip: The CLI includes subprocess overhead (~5ms). For applications that load config frequently, use library bindings for 50-100x better performance.
cargo install jcl for maximum performanceParser → Type Checker → Evaluator (with Functions) → Output
Built in Rust for:
JCL v1.0.0 is production-ready! ✅
See CHANGELOG.md for version history.
vs. HCL (HashiCorp Configuration Language):
vs. YAML:
vs. JSON:
vs. Full Programming Languages (Python, TypeScript):
We welcome contributions! Please see CONTRIBUTING.md for:
For bugs, feature requests, or questions:
Found a security vulnerability? Please see SECURITY.md for responsible disclosure guidelines.
Licensed under either of:
at your option.
Built with ❤️ in Rust