Telar
A declarative programming language for the web with Spanish syntax. It compiles into HTML, CSS and JS from human-readable code, with state, dynamic routes and automatic SEO — no configuration required.
🧠 The Idea
Telar was born out of frustration with modern web development.
To build a simple app today, you need to choose from dozens of frameworks, configure webpack, write JSX, manage dependencies… all before you’ve solved the real problem.
The hypothesis: what if you could describe what you want in Spanish, and the compiler made all the technical decisions for you?
🚀 What It Does
aplicación MiTienda
dominio "https://mitienda.com"
diseño principal
navbar
título "MiTienda"
página inicio en "/"
título "Bienvenido"
mostrar Producto recientes
máximo 8
ordenados por precio
si falla
mostrar "Sin conexión"
reintentar en 5 segundos
página producto en "/producto/(id)"
diseño principal
mostrar Producto filtrados por id = parametro.id
variable cantidad = 1
texto cantidad
botón "+" hacer sumar cantidad
botón "Añadir al carrito" hacer añadirAlCarrito
It automatically compiles into semantic HTML, responsive CSS and optimised JavaScript. The quantity selector on the second page is interactive — it increments right in the browser on click — without writing a single line of JS.
- Declarative syntax in structured Spanish
- Reusable layouts and components shared across pages
- Dynamic routes (
/producto/(id)) resolved in real time, not as static files - Variables and local state — real interactivity with zero JavaScript
- Forms with native HTML5 validation (
requerido,mínimo,máximo) - Dark/light themes, toggleable live and persisted between visits
- Automatic SEO:
og:tags,sitemap.xmlandrobots.txtwith no configuration - Mobile optimisation, caching and ARIA accessibility by default
- Error messages in Spanish with visual context
- Full CLI:
compile,serve,check,new - Package manager with official packages
- Live reload on the development server
- Official extension for VS Code
- Automated releases: a single
git tagtriggers tests, build, npm publish and a GitHub release — nothing done by hand
🏗️ Compiler Architecture
Telar implements a full three-phase compiler:
- Lexer — tokenises the
.telarfile, recognising Spanish text with accents and the letter ‘ñ’ - Parser — constructs the abstract syntax tree (AST) from the tokens
- Generator — traverses the AST and produces semantic HTML + responsive CSS, plus its own JS runtime for state, validation and dynamic routes
Each phase has its own error system with messages in Spanish and specific suggestions on how to resolve them, including visual context from the lines in the file.
📦 Ecosystem
Telar has its own package manager based on GitHub:
telar nuevo mi-proyecto
telar añadir navbar
telar añadir formulario
telar añadir lista
telar servir app.telar
Packages are GitHub repositories prefixed with telar-.
Anyone can create and publish packages for the community.
📊 What’s Interesting About the Project
The most challenging part wasn’t generating the HTML, but rather:
- Designing a grammar that reads like natural Spanish but is deterministic
- Handling the ambiguity of human language without losing precision
- Building useful error messages with visual context of line and column
- Implementing a significant indentation system compatible with the parser
- Creating a package manager without its own infrastructure using GitHub as a registry
- Adding state and reactivity in the browser without introducing a framework — a button that increments a variable and updates the screen, generated from a single declarative line
The main challenge was finding the balance between human readability and compiler precision — too free and the compiler is ambiguous, too strict and it loses the naturalness of Spanish.
An equally important part has been testing discipline: every new feature gets actually compiled and verified before it’s considered done, which has surfaced several real bugs that had been sitting silently unnoticed for a while.
🎯 Current Status
Telar is at v0.15, with a complete compiler, CLI, package manager,
VS Code extension, reusable layouts and components, dynamic routes,
variables and local state, form validation, visual themes, automatic
SEO, and a fully automated release pipeline — a single git tag
triggers tests, build, npm publish and a GitHub release. 181 automated
tests cover the compiler and the CLI.
v1.0 will be the public launch, with the syntax already stable.
📦 Installation
npm install -g @davidbc01/telar
telar nuevo mi-proyecto
cd mi-proyecto
telar servir app.telar