Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


TechScript Logo

TechScript 2.0

The plain-English programming language. Zero symbols. Zero overhead.

Build Status License: MIT Latest Release Downloads Built with Rust VS Code Extension Open VSX PyPI Documentation


πŸ“Œ Table of Contents

  1. What is TechScript?
  2. Why Choose It?
  3. Key Differentiators
  4. Syntax at a Glance
  5. Architecture Design
  6. Installation
  7. Quick Start
  8. Language Guide
  9. Standard Library & Modules
  10. CLI Commands
  11. Examples
  12. Editor & IDE Support
  13. Documentation Portal
  14. Roadmap
  15. Repo Structure
  16. Contributing
  17. Links & Social Media
  18. License

πŸ“– What is TechScript?

TechScript is a general-purpose, human-first programming language designed to eliminate the syntax clutter of traditional coding. Instead of curly braces, semicolons, and cryptic operator symbols, TechScript uses a clean, keyword-based English grammar.

Under the hood, TechScript is built in Rust for safety and speed. It compiles source files into highly optimized bytecode executed on a custom stack-based Virtual Machine (VM) with NaN-boxed values and a tracing garbage collector, or can generate native code via an LLVM backend.


⚑ Why Choose It?

  • Zero Clutter: Replace symbols like {, }, (, ), ;, &&, and || with clear keywords like do, end, when, else, and, and or.
  • Ecosystem Ready: Runs everywhere (Windows, Linux, macOS, Android/Termux) and comes with full LSP support, linting, formatting, and packaging.
  • Top Performance: Powered by a custom stack-based VM written in Rust. Features compile-time constant folding and AST simplifications.

πŸ“¦ Key Differentiators

Traditional Languages TechScript's Answer Benefit
Syntax clutter ({}, (), ;) Plain-English block keywords (do/end, when) Fewer syntax errors and high readability
Bloated build dependency chains Single toolchain executable (tsc) Instant setups with formatting & testing
Heavy memory overhead Lightweight custom NaN-boxed stack VM High performance and small footprint

βœ’οΈ Syntax at a Glance

Here is a side-by-side comparison of TechScript 2.0 with JavaScript and Python:

Feature TechScript JavaScript Python
Variable x = 10 let x = 10; x = 10
Constant const PI = 3.14159 const PI = 3.14159; PI = 3.14159 (convention)
Function do greet(name)
Β Β Β Β send "Hi " + name
end
function greet(name) {
Β Β Β Β return "Hi " + name;
}
def greet(name):
Β Β Β Β return "Hi " + name
Condition when x > 5
Β Β Β Β say "Big"
else
Β Β Β Β say "Small"
end
if (x > 5) {
Β Β Β Β console.log("Big");
} else {
Β Β Β Β console.log("Small");
}
if x > 5:
Β Β Β Β print("Big")
else:
Β Β Β Β print("Small")
For Loop for x in list
Β Β Β Β say x
end
for (let x of list) {
Β Β Β Β console.log(x);
}
for x in list:
Β Β Β Β print(x)
Try / Catch try
Β Β Β Β res = divide(10, 0)
catch error
Β Β Β Β say error
end
try {
Β Β Β Β let res = divide(10, 0);
} catch (error) {
Β Β Β Β console.error(error);
}
try:
Β Β Β Β res = divide(10, 0)
except Exception as error:
Β Β Β Β print(error)

πŸ“ Architecture Design

The TechScript compiler driver (tsc) processes source files through a strict pipeline:

graph TD
    A[Source Code .txs] --> B[Logos-based Lexer]
    B --> C[Pratt expression Parser]
    C --> D[Abstract Syntax Tree AST]
    D --> E[Semantic Analysis & Scope Audit]
    E --> F[AST Optimizer & Constant Folder]
    F --> G[IR Crate Generation]
    G --> H{Execution Target}
    H -->|VM Target| I[Bytecode Compiler]
    H -->|Native Target| J[LLVM Backend Crate]
    I --> K[Bytecode Format .txc]
    K --> L[Stack VM & Tracing GC]
    J --> M[Standalone Native Executable]
Loading

The tsc driver tokenizes the program, builds an AST, checks lexical scopes and types, runs constant folding, and compiles the result into bytecode for the VM or leverages LLVM to emit native machine code.


πŸ“¦ Installation

1. πŸͺŸ Windows Setup

  1. Go to the Releases page on GitHub.
  2. Download TechScript_Setup.exe (or TechScript_Portable.zip for a zero-install portable version).
  3. Run the installer to configure your environment:
    • Installs the native compiler (tsc) and VM.
    • Automatically adds tsc to your system environment PATH.
    • Configures file associations for .txs scripts.

2. 🐧 Linux / 🍎 macOS Setup (Shell Script)

curl -fsSL https://raw.githubusercontent.com/Tcode-Motion/techscript/main/scripts/install.sh | bash

3. πŸ€– Android (Termux) Setup

Recommended Method (Shell script):

pkg update
pkg install curl
curl -fsSL https://raw.githubusercontent.com/Tcode-Motion/techscript/main/scripts/install.sh | bash

Alternative Method (pip β€” Not Recommended):

pkg update
pkg install python
pip install techscript
techscript install

(Note: Python installations in Termux may require the --break-system-packages flag under PEP 668).

4. 🐍 Via pip (All Platforms - Not Recommended)

pip install techscript       # or: pip install techscript-lang
techscript install

The PyPI package auto-detects your OS/architecture and downloads the correct native binary from GitHub Releases.

Homebrew (brew install techscript), Winget, and Scoop support coming soon!


πŸš€ Quick Start

Once TechScript is installed, you can write and execute your first script in under 10 seconds:

  1. Create and Enter a Project Directory:
    mkdir hello_world
    cd hello_world
  2. Create a Script File: Create a new file named hello.txs and add:
    say "Hello, World! 🌍"
    
  3. Compile and Run: Run the file using the tsc compiler driver:
    tsc run hello.txs

πŸ“˜ Language Guide

TechScript's syntax builds from simple assignments to full structured programs:

  1. Variables: Assigned dynamically. No variable keywords required.
    message = "Hello TechScript"
    
  2. Conditionals: Expressed via when/else blocks.
    when status == "active"
        say "Running"
    end
    
  3. Loops: Multi-form for ranges or collection iterators.
    for i in 0..5
        say i
    end
    
  4. Functions: Declared with do block and returns with send.
    do square(n)
        send n * n
    end
    

For detailed guides, see the Language Guide and the Syntax Guide.


πŸ“š Standard Library & Modules

TechScript features a self-contained, native standard library:

Module Description Guide Link
math Square root, trigonometry, and basic math operations Stdlib Reference
collections Operations for pushing to lists or reading map keys Stdlib Reference
file File writing, reading, and removal utilities Stdlib Reference
json Encoding maps/lists to JSON strings and decoding them Stdlib Reference
http HTTP client GET and POST utilities Stdlib Reference
sqlite Local relational database connector Stdlib Reference
canvas 2D vector viewport shapes and text drawing Canvas Guide
time Clock, scheduling, and thread sleep functions Stdlib Reference
thread Native OS thread spawner and thread join interfaces Stdlib Reference
ai Seamless Gemini prompt and text generation functions Stdlib Reference
testing Assertion macros for unit testing suite Stdlib Reference

πŸ› οΈ CLI Commands

Run these subcommands via the unified tsc compiler driver:

Subcommand Description
run Compiles and executes a single .txs script
build Builds the workspace project matching package.toml
check Checks the workspace for compile-time errors
fmt Standardizes codebase layouts using tsfmt
lint Evaluates safety traps and warns on deprecated patterns
migrate Translates legacy v1.x scripts to v2.0 keywords
clean Deletes compiled target caches and logs
new Scaffolds a new workspace project
test Locates and executes all #[test] unit tests
repl Launches the interactive shell REPL
publish Submits the module package to the package registry
install Installs a library dependency
uninstall Removes an installed package
update Updates workspace packages to their latest versions
doctor Scans workspace paths and toolchain installations
dump-ast Outputs the AST representation in JSON/text format
dump-ir Outputs the Intermediate Representation
dump-bytecode Outputs the compiled virtual machine bytecode
emit-llvm Generates LLVM IR representation
emit-asm Generates assembly representation
benchmark Executes automated platform runtime benchmarks

πŸš€ Examples

Find runnable examples in the examples/ folder:

Directory Script Description Run Command
ai prompt.txs Prompting Gemini AI model natively via the standard library tsc run examples/ai/prompt.txs
async async.txs Concurrent event loop with async subroutines and await tsc run examples/async/async.txs
calculator calculator.txs Standard math functions and basic error throwing tsc run examples/calculator/calculator.txs
canvas draw.txs Drawing rects, circles, text inside a viewport tsc run examples/canvas/draw.txs
collections collections.txs Manipulating and iterating over lists and maps tsc run examples/collections/collections.txs
database db.txs Dynamic SQL schema setup and querying with SQLite tsc run examples/database/db.txs
enums enums.txs Declaring and pattern matching enum types tsc run examples/enums/enums.txs
error_handling errors.txs Exception handlers using try, catch, and throw tsc run examples/error_handling/errors.txs
file_reader reader.txs Writing, reading, and deleting files using the file module tsc run examples/file_reader/reader.txs
generics generics.txs Dynamic functions and dynamically-typed structs/boxes tsc run examples/generics/generics.txs
guess_number guess.txs Simulates a guess-the-number game loop tsc run examples/guess_number/guess.txs
hello_world hello.txs Classic Hello World script printing text tsc run examples/hello_world/hello.txs
http_server server.txs Simulated HTTP Server endpoints mock tsc run examples/http_server/server.txs
json_parser parser.txs Parsing JSON string to map structure and vice-versa tsc run examples/json_parser/parser.txs
modules main.txs Standard library imports and custom module scope tsc run examples/modules/main.txs
oop oop.txs Structural Object-Oriented programming using mapping definitions tsc run examples/oop/oop.txs
testing unit_test.txs Declaring assertions using the built-in testing harness tsc run examples/testing/unit_test.txs
threads threads.txs Spawning and joining OS threads via thread module tsc run examples/threads/threads.txs
todo_cli todo.txs Comprehensive lists/maps workflow for tasks tsc run examples/todo_cli/todo.txs
web_api web_api.txs Standard HTTP client request and response retrieval tsc run examples/web_api/web_api.txs

πŸ’» Editor & IDE Support

Official support is available for Visual Studio Code:

  1. Open the VS Code Extensions pane (Ctrl+Shift+X).
  2. Search for "TechScript 2.0" (published by tanmoy).
  3. Click Install.
  4. (Optional) Select Preferences β†’ File Icon Theme β†’ TechScript Icon Theme to enable custom project file icons.

Install links:


πŸ“– Documentation Portal

Browse detailed guides in the docs/ folder:

Document Description
API Reference In-depth compiler API design specifications
Best Practices Guidelines for coding layout and memory conventions
Canvas Guide Methods and viewport parameters for shapes drawing
Compiler Architecture Pipeline description from Lexer to optimization phases
DSL Guide Designing Domain-Specific layout submodules
Examples Guide Standard running process for bundled projects
FAQ Common troubleshooting and engine setup questions
Installation Guide Complete environment configuration guidelines
Language Guide Syntax specifications for statements and variables
Migration Guide Moving codebase parameters from legacy v1.x configurations
Performance Reference VM execution benchmarks and compile flag details
Release Notes Historical logs of compiled target stable versions
Roadmap Milestones and future compiler targets
Stdlib Reference Comprehensive standard library module interface list
Syntax Guide Cheatsheet for variables, loops, control blocks
Web Guide Native website compile-generation parameters

πŸ—ΊοΈ Roadmap

  • Pratt parser for expressions.
  • Custom event loop with async and await.
  • Bundled compiler tools (fmt, lint, test).
  • Complete LLVM code generation backend for static binaries.
  • Add debugger and tracing memory profiler in standard tools.
  • Formally verify core standard libraries.

πŸ“‚ Repo Structure

An overview of the TechScript workspace directories:

techscript/
β”œβ”€β”€ .devcontainer/       # Dev Container definitions
β”œβ”€β”€ .github/             # GitHub templates and workflows
β”œβ”€β”€ .vscode/             # Editor settings
β”œβ”€β”€ assets/              # Logos and graphics
β”œβ”€β”€ benchmarks/          # Performance benchmarks
β”œβ”€β”€ cli/                 # Crate for the `tsc` compiler driver CLI
β”œβ”€β”€ compiler/            # Crate subfolders for language compiler phases
β”‚   β”œβ”€β”€ ast/             # Abstract Syntax Tree representation
β”‚   β”œβ”€β”€ bytecode/        # Bytecode generation definitions
β”‚   β”œβ”€β”€ common/          # Shared utilities and spans
β”‚   β”œβ”€β”€ errors/          # Custom diagnostic engine and error codes
β”‚   β”œβ”€β”€ ir/              # Intermediate Representation (IR) generation
β”‚   β”œβ”€β”€ lexer/           # Logos-based lexer
β”‚   β”œβ”€β”€ llvm_backend/    # LLVM native compilation module
β”‚   β”œβ”€β”€ module_resolver/ # Module imports resolver
β”‚   β”œβ”€β”€ optimizer/       # Constant folding and AST simplifications
β”‚   β”œβ”€β”€ parser/          # Pratt expression and statement parser
β”‚   β”œβ”€β”€ semantic/        # Symbol table, scopes, and semantic checks
β”‚   └── syntax/          # Token kind and keyword definitions
β”œβ”€β”€ docs/                # Language documentation and guides
β”œβ”€β”€ editors/             # VS Code extension source and VSIX packages
β”œβ”€β”€ examples/            # Sample projects and code snippets
β”œβ”€β”€ installer/           # Script files for compiling installer executables
β”œβ”€β”€ licenses/            # Licenses of standard library dependencies
β”œβ”€β”€ runtime/             # Crate subfolders for program execution
β”‚   β”œβ”€β”€ builtins/        # Standard library module implementations
β”‚   β”œβ”€β”€ gc/              # NaN-boxed VM Garbage Collector
β”‚   β”œβ”€β”€ interpreter/     # Tree-walk AST execution engine
β”‚   β”œβ”€β”€ native_runtime/  # Runtime libraries for LLVM executables
β”‚   β”œβ”€β”€ runtime/         # VM execution context and states
β”‚   └── vm/              # Stack-based Bytecode Virtual Machine (VM)
β”œβ”€β”€ scripts/             # Utility and platform installation scripts
β”œβ”€β”€ stdlib/              # Standard library header definitions
β”œβ”€β”€ templates/           # New project templates
β”œβ”€β”€ third_party/         # Extracted third-party sources
└── tools/               # Ecosystem tools
    β”œβ”€β”€ formatter/       # Formatter engine (`tsfmt`)
    β”œβ”€β”€ linter/          # Linter analyzer (`tslint`)
    β”œβ”€β”€ lsp/             # Language Server (`techscript-lsp`)
    β”œβ”€β”€ package-manager/ # Package manager client (`tspm`)
    └── packager/        # Source code packager

🀝 Contributing

Contributions are welcome! Please read the Contributing Guidelines to set up your local development environment and run tests:

cargo build
cargo test

πŸ”— Links & Social Media


πŸ“„ License

TechScript is released under the MIT License. See LICENSE for details.

About

TechScript is an open-source programming language built with Rust, featuring a native compiler, virtual machine, package manager, and modern tooling. Build CLI, web, GUI, automation, AI, and full-stack applications using clean, readable syntax.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages