TechScript is a human-readable programming language with a Rust compiler, a bytecode virtual machine, native compilation support, and an integrated developer toolchain.
The language uses explicit English-like keywords for blocks and control flow. The toolchain includes a compiler driver, formatter, linter, language server, package manager, testing support, and standard-library modules for common application tasks.
Current line: TechScript 2.0.x License: Apache License 2.0 Maintainer: Tcode-Motion
Releases | Documentation | Issue tracker | Discussions
- Overview
- Language at a glance
- Why TechScript
- Syntax comparison
- How the toolchain works
- Installation
- First program
- CLI
- Standard library
- Examples
- Editor support
- Documentation
- Roadmap
- Repository layout
- Development
- Project policies
- License
TechScript is designed for readable scripts and structured applications. Its source files use the .txs extension and are processed by the tsc command-line driver.
The 2.0 language line provides:
- English-like block keywords such as
do,when,loop,repeat,try,catch, andend. - Functions, classes, structs, enums, traits, interfaces, modules, pattern matching, and generics.
- Synchronous, asynchronous, and parallel execution constructs.
- A standard library for files, JSON, HTTP, databases, collections, cryptography, graphics, web workflows, and more.
- A formatter, linter, migration tool, REPL, package manager, language server, and test runner.
TechScript is intended for developers who want source code to read like a structured description of the work it performs. It replaces punctuation-heavy block syntax with explicit keywords while keeping familiar programming concepts: functions, modules, data structures, error handling, concurrency, and native execution.
| Design goal | TechScript approach |
|---|---|
| Readable control flow | do and end delimit blocks; when, else, loop, and repeat describe control flow directly. |
| Small toolchain surface | The tsc executable provides compilation, execution, formatting, linting, testing, project creation, and package operations. |
| Native performance | Rust compiler components, an optimized bytecode VM, and an LLVM backend provide multiple execution targets. |
| Practical ecosystem | The repository includes a standard library, language server, VS Code extension, examples, package tooling, and platform installers. |
| Safe evolution | Deprecated 1.x aliases remain migratable during the 2.x line, while the canonical 2.0 syntax is documented separately. |
The following examples show the same basic constructs in TechScript, JavaScript, and Python.
| Construct | TechScript | JavaScript | Python |
|---|---|---|---|
| Variable | count = 10 |
let count = 10; |
count = 10 |
| Constant | const limit = 10 |
const limit = 10; |
LIMIT = 10 by convention |
| Function | do greet(name) send "Hi " + nameend |
function greet(name) { return "Hi " + name;} |
def greet(name): return "Hi " + name |
| Condition | when count > 5 say "large"else say "small"end |
if (count > 5) { ... } else { ... } |
if count > 5: print("large") |
| Collection loop | for item in items say itemend |
for (const item of items) { ... } |
for item in items: print(item) |
| Error handling | try work()catch error say errorend |
try { work(); } catch (error) { ... } |
try: work()except Exception as error: |
TechScript 2.0 also provides class, struct, enum, trait, interface, match, async, await, parallel, use, export, and generics. See the language overview and syntax guide for the complete grammar.
const limit = 5
do classify(value)
when value > limit
send "large"
else
send "small"
end
end
for value in [1, 3, 8]
say classify(value)
end
Canonical 2.0 syntax uses null, $"..." interpolation, loop for counted loops, and repeat for condition-controlled loops. Legacy aliases remain available during the 2.x line and can be migrated with tsc migrate.
The following diagram describes the complete path from a .txs source file to execution or a native executable. Each stage has a defined responsibility: source text is tokenized, parsed into an AST, validated semantically, optimized, lowered to IR, and then sent to the selected backend.
flowchart TB
subgraph INPUT[1. Source and command layer]
source["TechScript source<br/>.txs files"]
project["Project manifest<br/>package.toml"]
cli["tsc compiler driver<br/>run, build, check, test"]
source --> cli
project --> cli
end
subgraph FRONTEND[2. Frontend]
lexer["Lexer<br/>tokens, keywords, spans"]
parser["Parser<br/>expressions and statements"]
ast["Abstract syntax tree<br/>structured program model"]
diagnostics["Diagnostics<br/>source locations and error codes"]
lexer --> parser --> ast
parser -. syntax errors .-> diagnostics
end
subgraph ANALYSIS[3. Analysis and optimization]
semantic["Semantic analysis<br/>names, scopes, types, capabilities"]
resolver["Module resolver<br/>imports, exports, dependencies"]
optimizer["Optimizer<br/>constant folding and simplification"]
semantic --> resolver --> optimizer
semantic -. semantic errors .-> diagnostics
end
subgraph LOWERING[4. Lowering]
ir["Intermediate representation<br/>control flow and instructions"]
bytecode["Bytecode compiler<br/>portable VM instructions"]
llvm["LLVM backend<br/>native code generation"]
optimizer --> ir
ir --> bytecode
ir --> llvm
end
subgraph EXECUTION[5. Execution]
artifact["Bytecode artifact<br/>.txc"]
vm["Stack virtual machine<br/>frames, values, instructions"]
runtime["Runtime services<br/>builtins, GC, standard library"]
native["Native executable<br/>platform binary"]
output["Program output<br/>files, services, or console"]
bytecode --> artifact --> vm --> runtime --> output
llvm --> native --> runtime
end
subgraph TOOLS[Developer tools]
fmt["Formatter"]
lint["Linter and migration"]
lsp["Language server"]
repl["REPL and test runner"]
packages["Package manager"]
end
cli --> lexer
ast -. diagnostics .-> diagnostics
cli -.-> fmt
cli -.-> lint
cli -.-> lsp
cli -.-> repl
cli -.-> packages
The repository also contains a tree-walking interpreter for development and compatibility workflows. The VM and native backend are the primary execution targets exposed by the compiler architecture.
Download the latest Windows package from the GitHub Releases page. For detailed setup steps, see the installation guide.
The Windows installer configures the tsc executable, PATH integration, .txs file associations, and optional editor integration. Portable archives are available when an installer is not appropriate.
Use the installer script:
curl -fsSL https://raw.githubusercontent.com/Tcode-Motion/techscript/main/scripts/install.sh | bashOr build from source:
git clone https://github.com/Tcode-Motion/techscript.git
cd techscript
cargo build --releaseThe optional Python wrapper downloads the matching native release package:
pip install techscript-lang
techscript installThe packages techscript and techscript-lang are lightweight bootstrap installers; they download the native compiler rather than embedding compiler binaries. They support Python 3.8 and newer.
pkg update
pkg install curl
curl -fsSL https://raw.githubusercontent.com/Tcode-Motion/techscript/main/scripts/install.sh | bashThe Python installer is also available in Termux when Python is installed. Package-management restrictions may require the environment-specific --break-system-packages option.
After installation, verify the CLI:
tsc versionCreate hello.txs:
say "Hello, TechScript"
Run it with:
tsc run hello.txsFor a guided introduction, read Getting Started and the language overview.
Run tsc --help for the complete command list. The main commands are:
| Command | Purpose |
|---|---|
tsc run |
Compile and execute a source file. |
tsc build |
Build a project or package. |
tsc check |
Validate source without executing it. |
tsc fmt |
Format TechScript source. |
tsc lint |
Report lint and compatibility issues. |
tsc lint --fix |
Apply safe automated lint fixes. |
tsc migrate |
Migrate legacy 1.x syntax to the 2.0 form. |
tsc test |
Run project tests. |
tsc repl |
Start the interactive REPL. |
tsc new |
Create a new project. |
tsc install |
Install a package dependency. |
tsc publish |
Publish a package. |
tsc doctor |
Inspect the local toolchain and project environment. |
tsc clean |
Remove compiled target caches and logs. |
tsc uninstall |
Remove an installed package dependency. |
tsc update |
Update workspace packages within their constraints. |
tsc dump-ast |
Inspect the parsed AST. |
tsc dump-ir |
Inspect lowered intermediate representation. |
tsc dump-bytecode |
Inspect generated VM bytecode. |
tsc emit-llvm |
Emit LLVM intermediate representation. |
tsc emit-asm |
Emit assembly output through the native backend. |
tsc benchmark |
Run runtime and compiler benchmarks. |
The standard library is implemented in the stdlib/ workspace crate and exposed through modules including:
| Area | Modules |
|---|---|
| Core | collections, math, random, datetime, path, env |
| Data | json, csv, xml, yaml, ini, encoding, compress |
| Files and systems | file, os, process, io, logging, config |
| Network and services | http, net, dns, ftp, oauth, email |
| Databases | sqlite, database, mysql, postgres, mongodb, redis |
| Applications | canvas, graphics, charts, pdf, excel, word, web |
| Development | testing, debug, benchmark, profiler, mock |
See the standard library reference, web guide, and canvas guide for module details.
Runnable examples are organized under examples/. Useful starting points include:
| Example | Purpose |
|---|---|
| AI | Use the AI standard-library integration. |
| Async | Work with asynchronous functions and await. |
| Canvas | Draw shapes and text in a canvas. |
| Enums | Declare and match enum values. |
| File reader | Read, write, and remove files. |
| Generics | Use generic and structured data examples. |
| Guess number | Follow a complete interactive loop. |
| HTTP server | Explore web service structure. |
| Modules | Import standard and project modules. |
| Object-oriented examples | Explore classes and object structure. |
| Threads | Spawn and join operating-system threads. |
| Todo CLI | Build a multi-command collection workflow. |
| Web API | Make an HTTP request from TechScript. |
The repository includes additional examples for AI integrations, asynchronous code, canvas drawing, enums, file access, generics, HTTP services, modules, object-oriented patterns, threads, and package management. Browse the complete examples directory or read the examples guide.
Run an example from the repository root:
tsc run examples/hello_world/hello.txsThe examples guide explains how examples are structured and verified.
The official TechScript Virtian VS Code extension provides canonical 2.0 syntax highlighting, language-server integration, debugger support, configurable save-time formatting and linting, and editor commands. The extension is also available through Open VSX.
The language server is implemented in tools/lsp/. Formatter and linter implementation is in tools/formatter/ and tools/linter/.
- Documentation portal
- Installation guide
- Getting Started guide
- Language overview
- Syntax guide
- Compiler architecture
- Virtual machine specification
- CLI reference
- Formatter reference
- Package manager reference
- Standard library reference
- Migration guide
- Release notes
- Roadmap
- Supported versions
Additional references include FAQ, best practices, DSL guide, performance reference, Web guide, API reference, memory model, and FFI specification.
The engineering specifications are also available in docs/engineering/, including the language freeze, grammar, AST, semantic analysis, runtime, CLI, testing, and coding standards documents.
Completed foundations include the Pratt parser, canonical 2.0 syntax, the bytecode pipeline, formatter, linter, test runner, asynchronous constructs, and standard-library modules. Planned work is tracked in the roadmap and includes:
- Completing and expanding LLVM native code generation.
- Adding debugger and memory-tracing workflows to the standard tools.
- Expanding package registry and cross-platform distribution support.
- Strengthening standard-library verification and documentation.
compiler/ Lexer, parser, AST, semantic analysis, IR, optimizer, and backends
runtime/ Interpreter, VM, runtime services, garbage collection, and builtins
stdlib/ Standard-library modules
cli/ The tsc compiler driver
tools/ Formatter, linter, LSP, package manager, and packager
docs/ User guides, specifications, and project documentation
examples/ Runnable TechScript programs
editors/ Editor integrations
installer/ Installer configuration
scripts/ Installation and maintenance scripts
benchmarks/ Performance benchmarks and benchmark reports
assets/ Branding and editor assets
templates/ New project templates
third_party/ Vendored or extracted third-party source material
Prerequisites are Rust stable, Git, and the platform dependencies required by optional LLVM features. Build and test the workspace with:
cargo fmt --all -- --check
cargo build --workspace
cargo test --workspaceBefore opening a pull request, read the contribution guide, follow the code of conduct, and review the security policy.
- Contributing: development setup, branch rules, testing, commits, and pull requests.
- Code of Conduct: community standards and reporting process.
- Security Policy: supported versions and private vulnerability reporting.
- License: Apache License 2.0 terms.
- Issue tracker: bug reports and actionable tasks.
- Feature requests: proposals for new functionality.
- Bug reports: reproducible defects.
- Questions: usage and documentation questions.
- Discussions: design and community conversations.
TechScript is distributed under the Apache License 2.0. Third-party components remain under their own licenses and are listed in THIRD_PARTY_LICENSES.md.