English reading edition. This manifesto states design principles and intended architectural commitments; it is not a feature acceptance report.
TCSL Manifesto
Fundamental principles, philosophy and commitments of the TextToCAD Scripting Language
A language should describe its intended domain precisely and make its commitments verifiable.
Why TCSL exists
This document records the fundamental principles, philosophy and commitments of TCSL. The manifesto explains why the specification takes its particular form. Decisions about grammar, the type system and parser architecture follow the principles described here. When possible solutions conflict or a requirement is ambiguous, the manifesto provides a basis for choosing between them.
A gap separates a designer's intention from a three-dimensional FreeCAD model. Traditionally, people bridge it through manual modelling with explicit engineering development, or through Python programming, which is powerful but requires software development skills. TCSL introduces a third participant: a language model that generates code from a textual description of a product.
TCSL is a contract between a person, a machine and a geometry kernel. The person specifies parameters. The machine calculates derived values and constructs geometry. The kernel performs geometric operations; the result still requires verification. The contract works when each participant can check its own part before passing it on. The parser serves as an independent checker before geometric execution, without starting FreeCAD.
inputlet and constructs geometryTen principles
A unit of measurement is part of the type
A number without a unit is not a length. The value 100 is a dimensionless scalar, whereas 100 mm is a length. TCSL rejects adding millimetres to degrees or producing an unsupported dimension such as L⁴ by multiplying volume by length. The type system covers L⁰–L³ and a separate angular dimension. These constraints are checked before any geometry is constructed.
This protects against errors that may be difficult to spot in a finished model. A part displaced by a bare value of 100 rather than 100 mm can appear plausible until it enters an assembly.
Four zones, four responsibilities
A TCSL program progresses from parameters to geometry and then to export. INPUT, LET, GEOMETRY and EXPORT occur in that order, with no return to an earlier zone. This architectural choice reflects the intended design workflow.
INPUT contains customer-controlled values. LET contains engineering calculations. GEOMETRY describes construction operations. EXPORT supplies data for downstream tools such as a cost calculator. Keeping these responsibilities separate supports independent automation of each stage.
Declared relationships are recalculated
When total_width changes, dependent values are recalculated. Derived parameters are formulas rather than fixed numbers, so the intended relationship remains explicit. The statement let inner_width = total_width - 2 * board records a dependency that can be evaluated again.
Separating externally overridable input literals from automatically calculated let formulas gives a GUI configurator a clear basis for deciding which values users should edit and which values are derived.
One statement per line
TCSL is a line-oriented language. Each instruction occupies exactly one line, and line continuation is unsupported. The |> pipeline expresses compound operations on that same line.
The language gives up some compactness to reduce ambiguity. The parser synchronises at line boundaries; a language model generates code line by line; a person reads it line by line. An error and its diagnostic can therefore be associated with a specific line.
Names matter beyond the source code
A TCSL variable name also describes a part. The name corpus_left_side helps a person understand it, while an exported name such as Bok_LDSP16mm_1 identifies the same part to the cost calculator. Both names can occur in one statement and are checked by the parser.
The export ... as construct connects readable engineering names with names used in production accounting through a single explicit syntactic relationship.
An explicit error beats a silent failure
TCSL defines 32 diagnostic codes so that different failures can receive specific explanations. TCSL_E015 identifies a result dimension outside L⁰–L³; TCSL_R008 identifies division by zero. Each code points to a place in the specification containing an explanation, an example and a possible correction.
The parser is required to detect everything it can check without running the geometry kernel. Two cases deliberately remain execution-dependent: R005, an empty selector result, and R006, a type mismatch in a runtime override. The remaining checks are assigned to static analysis in the methodology.
The grammar serves the generator
TCSL is designed for sequential generation by a language model. Its four zones correspond to four stages: extracting base parameters from a brief, calculating dependencies, building parts, and assigning export names for downstream costing.
User-defined functions, nested blocks, conditionals and general loops are deliberately excluded. Each would introduce additional states and decisions for the generator. TCSL aims to keep the state space small enough for its initial furniture-modelling domain.
The parser is the first line of checking
The parser stands between generated code and its execution. It runs before geometry, does not require FreeCAD, does not use model inference tokens, and need not create files. It reports whether the source passes its checks and explains failures.
Static checks cover lexing, syntax, zone order, dimensional algebra, pipeline type compatibility, operation arity, unique export names, positive constructor parameters, integer counts and division by zero. The methodology assigns 30 of the 32 diagnostics to static checking. This is a classification of diagnostics, not a measured test-coverage percentage.
The specification is the source of truth
Parser behaviour is defined by specification v1.5. A disagreement between an implementation and that specification is an implementation defect. The v1.5 EBNF grammar, with 62 productions and 25 semantic constraints, provides the formal contract for compatible alternative implementations.
The parser is a reference implementation. The specification text remains the normative definition; the parser is an executable implementation of it.
Simplicity must be protected
TCSL v1.5 defines 62 grammar rules, 23 functions, 5 enumerations, 17 units and 32 error codes. The intended scope is the description of cabinet furniture. Every language feature should justify its presence through a task that existing features cannot express.
A proposal for a new construct should explain which task cannot currently be solved, how it changes the difficulty of generation by a language model, and how it affects error diagnosis. An unsatisfactory answer to any of these questions is a reason to reject the proposal.
Architectural commitments
No additional runtime dependencies
The parser is intended to run on the Python 3.11+ standard library alone. This makes it usable in environments such as CI servers, Docker containers, developer workstations, notebooks and cloud functions. External dependencies introduce maintenance costs, version conflicts and additional reproducibility requirements.
Three phases with separate responsibilities
The lexer handles characters and tokens, the parser handles structure and grammar, and the analyser handles types and semantics. Each phase consumes the preceding phase's output without a reverse dependency. This supports isolated tests, replacement of individual implementations and debugging from the lowest relevant layer.
Continue checking after an error
The parser should collect as many useful diagnostics as possible in one pass. After an error on line 5, it synchronises at a line boundary and continues from line 6. Semantic analysis can operate on successfully parsed portions of the AST even when syntax errors remain elsewhere. This lets an agent receive a useful group of corrections together instead of discovering one error after each repair.
Precise source locations
Every token, AST node and diagnostic carries a Span identifying the file, line, starting column and ending column. These positions support editor highlighting, machine-readable CI reports and targeted corrections by an automated agent.
Determinism
The same input should produce the same AST, symbol table and diagnostics. Diagnostic order is determined by source position rather than traversal order. This supports snapshot tests and reproducible CI results.
Language boundaries
TCSL deliberately excludes the following constructs:
User-defined functions
TCSL functions are built in and have fixed signatures and semantics. User-defined functions would require rules for return types, scope and calls. That complexity falls outside the intended furniture DSL.
Conditionals and general loops
if/else and for/while introduce control flow that a generator must anticipate. Operations such as linear_pattern and circular_pattern provide repetition without a general looping mechanism.
Nested blocks and scopes
Identifiers live in one flat symbol table. Nested scopes and closures would complicate name resolution and make generated programs less predictable.
String literals
TCSL operates on numbers, units, identifiers and enumerations. Tags and as names use identifiers governed by the ordinary lexical rules, so the language does not require general string literals.
Imports and modules
Each .tcsl file is intended to be self-contained. Cross-file dependencies would introduce a graph requiring resolution, versioning and caching. This is considered unnecessary for describing one product.
These boundaries protect the intended simplicity of the language. Tasks that require a broader programming model can use a Python wrapper around the generated code.
Commitments to users
A TCSL program should read like a product specification, with meaningful names, explanatory comments and a consistent sequence. A colleague unfamiliar with the language should still be able to understand what it describes.
The language supports sequential generation with a predictable structure. Its four zones correspond to four prompt stages. Diagnostics provide positions and codes suitable for targeted correction.
Exported names encode the element, material, thickness and sequence number. The parser checks the naming format through warning W001 before downstream import.
The intended parser output includes a typed AST, a complete symbol table and completed static checks. This gives a transpiler a defined input contract for generating Python without duplicating the same validation logic.
The interface is intended to provide an unambiguous exit code, 0 for no errors and 1 for errors, together with text and JSON output. The manifesto describes lightweight validation suitable for a CI pipeline. Actual execution time must be measured in the target environment.
Language evolution
TCSL follows major.minor versioning. A minor release, such as 1.4 to 1.5, can add constructs or diagnostics and clarify semantics while aiming to preserve valid existing programs, apart from corrections to specification defects. A major release, such as 1.x to 2.0, can introduce incompatible changes, remove constructs or restructure zones.
Each proposed specification change should pass four tests:
Necessity: which real task cannot be solved with the current language?
Generatability: how does the change affect language-model generation and the likelihood of errors?
Diagnosability: can the construct be checked statically, and which diagnostics does it need?
Backward compatibility: will existing programs continue to work?
If a change fails one of these tests, it should be deferred or rejected.
Conclusion
TCSL is designed for a specific task: turning a textual furniture description into a parameterised 3D model whose part names can be used in production accounting. Dimensional typing, four-zone structure, built-in operations and explicit units are all intended to support that task.
Simplicity is a property to preserve throughout language evolution. A narrow, explicit domain makes it easier to define and verify the language's commitments. Broadening the domain must not obscure those commitments.
A universal language for manufacturing. Furniture is the first testing ground.
TCSL describes physical objects. Industry-specific rules can be connected modularly while the core remains shared.
TCSL Manifesto v1.0 · Adopted 18 March 2026 · CC BY-SA 4.0
Questions: texttocad@ya.ru
