Skip to content

Latest commit

History

151 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation


TechScript Logo

TechScript 2.0

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

Author: Tcode-Motion

Status: Pre-release / Under Development. Architecture modules are currently being built and tested.

Build StatusLicense: MITLatest ReleaseDownloadsBuilt with RustVS Code ExtensionOpen VSXPyPIDocumentation


📌 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 LanguagesTechScript's AnswerBenefit
Syntax clutter ({}, (), ;)Plain-English block keywords (do/end, when)Fewer syntax errors and high readability
Bloated build dependency chainsSingle toolchain executable (tsc)Instant setups with formatting & testing
Heavy memory overheadLightweight custom NaN-boxed stack VMHigh performance and small footprint

✒️ Syntax at a Glance

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

FeatureTechScriptJavaScriptPython
Variablex = 10let x = 10;x = 10
Constantconst PI = 3.14159const PI = 3.14159;PI = 3.14159(convention)
Functiondo greet(name)
send "Hi " + name
end
function greet(name) {
return "Hi " + name;
}
def greet(name):
return "Hi " + name
Conditionwhen 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 Loopfor x in list
say x
end
for (let x of list) {
console.log(x);
}
for x in list:
print(x)
Try / Catchtry
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:

ModuleDescriptionGuide Link
mathSquare root, trigonometry, and basic math operationsStdlib Reference
collectionsOperations for pushing to lists or reading map keysStdlib Reference
fileFile writing, reading, and removal utilitiesStdlib Reference
jsonEncoding maps/lists to JSON strings and decoding themStdlib Reference
httpHTTP client GET and POST utilitiesStdlib Reference
sqliteLocal relational database connectorStdlib Reference
canvas2D vector viewport shapes and text drawingCanvas Guide
timeClock, scheduling, and thread sleep functionsStdlib Reference
threadNative OS thread spawner and thread join interfacesStdlib Reference
aiSeamless Gemini prompt and text generation functionsStdlib Reference
testingAssertion macros for unit testing suiteStdlib Reference

🛠️ CLI Commands

Run these subcommands via the unified tsc compiler driver:

SubcommandDescription
runCompiles and executes a single .txs script
buildBuilds the workspace project matching package.toml
checkChecks the workspace for compile-time errors
fmtStandardizes codebase layouts using tsfmt
lintEvaluates safety traps and warns on deprecated patterns
migrateTranslates legacy v1.x scripts to v2.0 keywords
cleanDeletes compiled target caches and logs
newScaffolds a new workspace project
testLocates and executes all #[test] unit tests
replLaunches the interactive shell REPL
publishSubmits the module package to the package registry
installInstalls a library dependency
uninstallRemoves an installed package
updateUpdates workspace packages to their latest versions
doctorScans workspace paths and toolchain installations
dump-astOutputs the AST representation in JSON/text format
dump-irOutputs the Intermediate Representation
dump-bytecodeOutputs the compiled virtual machine bytecode
emit-llvmGenerates LLVM IR representation
emit-asmGenerates assembly representation
benchmarkExecutes automated platform runtime benchmarks

🚀 Examples

Find runnable examples in the examples/ folder:

DirectoryScriptDescriptionRun Command
aiprompt.txsPrompting Gemini AI model natively via the standard librarytsc run examples/ai/prompt.txs
asyncasync.txsConcurrent event loop with async subroutines and awaittsc run examples/async/async.txs
calculatorcalculator.txsStandard math functions and basic error throwingtsc run examples/calculator/calculator.txs
canvasdraw.txsDrawing rects, circles, text inside a viewporttsc run examples/canvas/draw.txs
collectionscollections.txsManipulating and iterating over lists and mapstsc run examples/collections/collections.txs
databasedb.txsDynamic SQL schema setup and querying with SQLitetsc run examples/database/db.txs
enumsenums.txsDeclaring and pattern matching enum typestsc run examples/enums/enums.txs
error_handlingerrors.txsException handlers using try, catch, and throwtsc run examples/error_handling/errors.txs
file_readerreader.txsWriting, reading, and deleting files using the file moduletsc run examples/file_reader/reader.txs
genericsgenerics.txsDynamic functions and dynamically-typed structs/boxestsc run examples/generics/generics.txs
guess_numberguess.txsSimulates a guess-the-number game looptsc run examples/guess_number/guess.txs
hello_worldhello.txsClassic Hello World script printing texttsc run examples/hello_world/hello.txs
http_serverserver.txsSimulated HTTP Server endpoints mocktsc run examples/http_server/server.txs
json_parserparser.txsParsing JSON string to map structure and vice-versatsc run examples/json_parser/parser.txs
modulesmain.txsStandard library imports and custom module scopetsc run examples/modules/main.txs
oopoop.txsStructural Object-Oriented programming using mapping definitionstsc run examples/oop/oop.txs
testingunit_test.txsDeclaring assertions using the built-in testing harnesstsc run examples/testing/unit_test.txs
threadsthreads.txsSpawning and joining OS threads via thread moduletsc run examples/threads/threads.txs
todo_clitodo.txsComprehensive lists/maps workflow for taskstsc run examples/todo_cli/todo.txs
web_apiweb_api.txsStandard HTTP client request and response retrievaltsc 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:

DocumentDescription
API ReferenceIn-depth compiler API design specifications
Best PracticesGuidelines for coding layout and memory conventions
Canvas GuideMethods and viewport parameters for shapes drawing
Compiler ArchitecturePipeline description from Lexer to optimization phases
DSL GuideDesigning Domain-Specific layout submodules
Examples GuideStandard running process for bundled projects
FAQCommon troubleshooting and engine setup questions
Installation GuideComplete environment configuration guidelines
Language GuideSyntax specifications for statements and variables
Migration GuideMoving codebase parameters from legacy v1.x configurations
Performance ReferenceVM execution benchmarks and compile flag details
Release NotesHistorical logs of compiled target stable versions
RoadmapMilestones and future compiler targets
Stdlib ReferenceComprehensive standard library module interface list
Syntax GuideCheatsheet for variables, loops, control blocks
Web GuideNative 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
├── 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
├── 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
└── 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

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages