Introduction to Tezz
Tezz (तेज़) is a blazing fast programming language designed specifically for building backend servers and serverless APIs.
Created by Abhinav, Tezz focuses on extreme simplicity and developer experience. It compiles down to highly optimized JavaScript that can run anywhere: on Node.js or directly on the edge with Cloudflare Workers.
Why Tezz?
Traditional backend languages have complex setups, bloated package managers, and steep learning curves. Tezz cuts through the noise.
- Zero Configuration: No Webpack, no Babel, no TSConfig. Just write and run.
- Native Hinglish Support: The world's first language that natively parses Hinglish keywords (like
kaam,rakho,agar) alongside standard English. - Declarative Routing: Building APIs is a first-class citizen in Tezz. Use
serviceandrouteblocks to spin up a backend instantly. - Blazing Fast Compilation: Compiles source code to JS in milliseconds with hot-reloading built into the CLI.
Next Steps
Ready to jump in? Head over to the Installation Guide to set up Tezz on your machine.
Installation & CLI
Everything you need to install Tezz and manage your projects from the terminal.
Installation
Tezz is distributed via the npm registry. Install it globally on your machine using npm:
npm install -g tezz-lang
Verify the installation by checking the version:
tezz --version
CLI Commands
The tezz CLI is your all-in-one tool for development and production.
| Command | Description |
|---|---|
tezz init |
Scaffolds a new app.tezz file with a starter template. |
tezz dev <file> |
Starts the development server with hot-reloading enabled. Saving your file instantly restarts the server. |
tezz run <file> |
Compiles and runs a Tezz file directly in Node.js. |
tezz build <file> |
Compiles your Tezz code into raw JavaScript. Use --target worker to compile for Cloudflare Workers. |
tezz repl |
Starts an interactive Read-Eval-Print Loop for testing snippets on the fly. |
Hot-Reloading in Action
When running tezz dev app.tezz, the CLI watches your file for changes. When a change is detected, it intercepts the signal, kills the current server, recompiles the AST, and spawns a new server instance—all in less than 300ms.
Language Syntax
Tezz syntax is designed to be highly readable, borrowing the best parts of modern JavaScript, Swift, and Rust.
Variables
Declare mutable variables with let and immutable variables with const.
let age = 21
const name = "Abhinav"
// Reassignment
age = 22
Functions
Functions are declared using the fn keyword. For asynchronous operations, prefix the function with async.
fn calculateTotal(price, tax) {
return price + (price * tax)
}
async fn fetchUserData(id) {
let response = await fetch("https://api.example.com/users/" + id)
return await response.json()
}
Control Flow
Standard branching and looping constructs are fully supported.
// If / Else
if age >= 18 {
print("Adult")
} else {
print("Minor")
}
// While Loop
let count = 0
while count < 5 {
print(count)
count += 1
}
// For Loop
let numbers = [1, 2, 3]
for n in numbers {
print(n)
}
Error Handling
Use try and catch to gracefully handle exceptions.
try {
let data = parseJSON(invalidString)
} catch err {
print("Failed to parse data!")
}
Hinglish Support 🇮🇳
Tezz is the world's first backend language that natively supports Hinglish (Hindi + English) keywords interchangeably.
Whether you are learning to code or want to express logic in a more culturally familiar way, Tezz maps Hinglish keywords directly to their English counterparts at the AST level. There is zero performance penalty.
Keyword Mapping
| English | Hinglish | Meaning |
|---|---|---|
let | rakho | Keep / Store |
const | pakka | Permanent / Fixed |
fn | kaam | Work / Task |
service | seva | Service |
route | rasta | Path / Route |
respond | jawab | Answer / Respond |
if | agar | If |
else | warna | Otherwise |
while | jabtak | As long as |
try | koshish | Attempt |
catch | pakad | Grab / Catch |
return | vapas | Return / Back |
print | dikha | Show |
async | baadmein | Later (Asynchronous) |
await | ruko | Wait |
true | sahi | Correct / True |
false | galat | Wrong / False |
Example: A Pure Hinglish API
You can write an entire backend service using only Hinglish keywords.
pakka version = "0.2.0"
kaam generateGreeting(name) {
agar name == "Abhinav" {
vapas "Namaste Creator! 🙏"
} warna {
vapas "Namaste, {name}! ⚡"
}
}
seva HinglishAPI on 3000 {
rasta GET "/" {
rakho user = request.query.name || "Duniya"
dikha("Request from: " + user)
jawab 200 {
message: generateGreeting(user),
status: sahi
}
}
}
Services & Routes
Tezz abstracts away HTTP server boilerplate, allowing you to focus purely on business logic.
The Service Block
A service block declares an HTTP server and binds it to a specific port.
service UserAPI on 8080 {
// Routes go here
}
Routing
Inside a service, you define endpoints using the route block. You specify the HTTP method (GET, POST, PUT, DELETE) and the path.
route GET "/users" {
// ...
}
route POST "/users" {
// ...
}
Dynamic Path Parameters
You can capture variables from the URL path using a colon (:). The captured values are available in the implicitly provided params object.
route GET "/users/:id" {
let userId = params.id
print("Fetching user: " + userId)
}
The Request Object
Every route automatically injects a request object containing the incoming HTTP data.
request.method- The HTTP method (e.g., "GET").request.url- The request URL path.request.query- An object containing parsed query parameters.request.json()- Parses and returns the JSON body payload.
Sending Responses
Use the respond keyword to instantly send a JSON response to the client. You provide an HTTP status code followed by an object.
route POST "/login" {
let body = request.json()
if body.username == "admin" && body.password == "123" {
respond 200 { success: true, token: "abc-123" }
} else {
respond 401 { success: false, error: "Invalid credentials" }
}
}
Deployment Guide
Take your Tezz applications to production seamlessly.
Tezz compiles directly to highly optimized JavaScript. Because it handles the server abstraction at the compilation phase, you can compile for different target environments using a simple flag.
Deploying to Node.js (Default)
By default, Tezz compiles to a standard Node.js HTTP server. This is perfect for deploying on VPS (DigitalOcean, Linode), AWS EC2, Heroku, or Render.
- Compile your code:
tezz build app.tezz --target node --output dist/server.js - Run it in production:
node dist/server.js
Deploying to Cloudflare Workers
Tezz has first-class support for Cloudflare Workers, allowing you to run your backend on the edge with 0ms cold starts globally.
- Compile targeting the Worker runtime (this generates an ES Module with a
fetchhandler instead of a Node HTTP server):tezz build app.tezz --target worker --output dist/worker.js - Use Wrangler to deploy the compiled file:
npx wrangler deploy dist/worker.js --name tezz-api --compatibility-date 2024-01-01
Why Target-Based Compilation?
When you write a service block in Tezz, the language doesn't just evaluate it—it fundamentally transforms it. If you target node, the codegen outputs http.createServer. If you target worker, it outputs an export default { fetch() } object. Your source code never changes.