Repository: C:\Users\Tanmoy\OneDrive\Documents\techscript
Branch/HEAD: 740736df (Merge pull request #289)
Date of audit: 2026-10-20
Auditor: Agent (read-only inspection)
This report is based on direct inspection of source files, not just docs. Where uncertain, status is marked UNKNOWN and evidence cited.
Verified: TechScript is a human-readable, English-like programming language implemented in Rust with a multi-crate workspace. Key observations:
- Workspace layout (Cargo.toml): 30 workspace members split across
compiler/*(lexer/parser/ast/semantic/ir/optimizer/bytecode/llvm_backend/module_resolver),runtime/*(vm/interpreter/runtime/builtins/gc/native_runtime),stdlib/,cli/,tools/*(linter/formatter/package-manager/packager/lsp), etc. (VERIFIED) - Language line: 2.0.x (README). Files use
.txs. (VERIFIED) - Frontend: Logos-based lexer (
compiler/lexer/src/lib.rs) with manual handling for strings/f-strings, comments (#,//, nested/* */), keywords viacompiler/syntax. Parser is recursive-descent + Pratt (compiler/parser). AST defined incompiler/ast. (VERIFIED) - Syntax/keywords: Canonical 2.0 keywords include
do,send,when,loop,repeat,for,in,match,case,try,catch,throw,use,class,struct,enum,trait,interface,const,null,say,ask,break,continue,else,async,await,parallel,end,export,new,self,true/false,typeof,with. Many 1.x aliases exist (build/return/model/if/elif/while/import/from/let/var/fun/function/attempt/none/keep/give/stop/skip/each/switch/be/equals/then) and are recognized as deprecated aliases (lexer/parser emit warnings via diagnostics). (VERIFIED fromcompiler/syntax/src/token_kind.rs) - Execution model: README diagram shows source → lexer/parser/AST → semantic/resolver/optimizer → IR → (bytecode to VM) or (LLVM to native) with runtime/builtins/GC. Both tree-walking interpreter and bytecode VM + LLVM backend are present. (VERIFIED)
- CLI:
tscbinary (clap) with many subcommands (run/build/check/fmt/lint/migrate/test/repl/new/init/doc/publish/install/uninstall/update/doctor/clean/version/dump-/emit-/benchmark/completion/examples/docs/config/self). (VERIFIED fromcli/src/main.rs,cli/Cargo.toml)
| Feature | Status | Evidence | Notes |
|---|---|---|---|
| Lexer with Logos + f-strings + nested block comments | VERIFIED | compiler/lexer/src/lib.rs |
Handles f"/$", nested /* */, line comments #/// |
| Keyword system (canonical + aliases + warnings) | VERIFIED | compiler/syntax/src/token_kind.rs, compiler/syntax/src/lib.rs |
Large token set with deprecation mapping |
| Parser (recursive descent + Pratt) | VERIFIED | compiler/parser/src/lib.rs, compiler/parser/src/*.rs |
Builds AST, has recovery mode |
| AST (rich) | VERIFIED | compiler/ast/src/lib.rs |
Includes functions/methods/struct/enum/model/class-like, try/catch, loops, async/parallel hints, DSL blocks, etc. |
| Semantic analysis | VERIFIED (crate present) | compiler/semantic/ exists in workspace |
Implementation present; behavior needs deeper trace (see limits) |
| IR/optimizer/bytecode/VM | VERIFIED (crates present) | compiler/ir/, compiler/optimizer/, compiler/bytecode/, runtime/vm/ |
Pipeline exists as designed |
| LLVM backend | VERIFIED (crate present, optional feature) | compiler/llvm_backend/, cli/Cargo.toml has llvm feature |
Feature-gated |
| Interpreter/tree-walk | VERIFIED | runtime/interpreter/ |
Mentioned as dev/compat path |
| Runtime/builtins/GC/native_runtime | VERIFIED | runtime/* crates |
Present |
| Stdlib modules (broad set) | VERIFIED (crate + modules listed) | stdlib/ crate, README lists many modules (collections, json, http, sqlite, etc.) |
Extent of implementations varies |
| CLI commands (extensive) | VERIFIED | cli/src/main.rs, cli/src/commands/* (many files) |
run/build/check/fmt/lint/migrate/test/repl/new/init/doctor/... exist |
Project scaffolding via tsc new |
VERIFIED | cli/src/commands/new_cmd.rs |
Interactive wizard + templates (console/library/package/workspace/empty) |
| Formatter/Linter/LSP/Package manager/Packager | VERIFIED (crates/tools) | tools/* present |
Integrated into CLI |
| Tests/benchmarks/examples | VERIFIED | tests/? (workspace has tests implied), examples/, benchmarks/ exist |
Many examples present |
| VS Code extension | VERIFIED (mentioned) | editors/vscode/ exists |
README points to marketplace/OpenVSX |
| Item | Status | Evidence | Notes |
|---|---|---|---|
| LLVM backend end-to-end | PARTIALLY IMPLEMENTED | compiler/llvm_backend/ exists, CLI has emit-llvm/emit-asm/emit-obj |
Feature-gated; "Completing and expanding LLVM native code generation" is in roadmap (README). Needs real build/test verification. |
| Native execution path completeness | PARTIALLY IMPLEMENTED | runtime/native_runtime/, backends exist |
Depends on LLVM/toolchains; may not work out of box everywhere. |
| Web/Android build support | NOT IMPLEMENTED (no direct evidence found) | Searched for android, web in repo files (core code/cli/docs) — only hits in node_modules in editors/vscode, python installers mention Termux/platform support, research docs mention platforms. No cli commands for new website/android, no Android/Gradle/web bundler integration in core CLI/src. |
This is a major gap vs vision. |
| DSL blocks in AST | PARTIALLY IMPLEMENTED | AST::DSL(DSLBlock) exists |
Parser support exists structurally; how it's used/evaluated unclear without tracing. |
| Async/Parallel constructs | PARTIALLY IMPLEMENTED | Keywords/tokens/AST present | Runtime/VM support needs verification. |
| Package registry/publishing flow | PARTIALLY IMPLEMENTED | tsc publish/install/update, tools/package-manager exist |
Depends on registry availability; needs testing. |
| Hot reload/dev server | NOT IMPLEMENTED / UNKNOWN | No obvious dev server code in cli/src/commands inspected |
README doesn't list dev as core command like some proposals; current CLI has run/build/check etc. |
Verified from codebase patterns:
- Variables/assignment:
count = 10style common (README). Canonical usesconst/assignment forms; aliaseslet/var/make/beexist as deprecated. - Functions: canonical
do name(params) ... send ... end(README). Aliasesbuild/fun/function/return/givedeprecated. - Conditionals:
when condition ... else ... end(canonical). Aliasesif/elifdeprecated. - Loops:
loop N ... end(counted),repeat condition ... end(while-style),for item in items ... end. Aliaseswhile/eachdeprecated. - Error handling:
try ... catch error ... end(canonical). Aliasattemptdeprecated. - I/O:
sayprints,askreads (implicit calls). - Null:
nullcanonical (aliasnonedeprecated). - F-strings:
$"..."orf"..."supported by lexer.
Actual behavior: Syntax is English-like keywords with end blocks. Parser/lexer enforce canonical forms with warnings on aliases. No evidence of the "natural language DSL" like make a website called ... in current parser/grammar — those appear to be the desired vision, not current implementation.
Capabilities (VERIFIED):
- Full pipeline crates exist (lexer→parser→AST→semantic→IR→optimizer→bytecode/VM or LLVM)
- Rich language features in grammar (OOP-like via class/model/struct/enum/trait/interface, modules via use/export, async/await/parallel keywords, pattern matching via match/case)
- Tooling integrated (fmt/lint/lsp/test/repl/migrate)
- Cross-platform installer scripts and Python installers exist
Limitations (VERIFIED/INFERRED):
- Web/Android app generation not present as first-class CLI targets
- LLVM path is optional/feature-gated and may require toolchain setup
- No obvious built-in dev server/hot reload/web bundler
- Android build integration (Gradle/Kotlin/Android SDK) not found in codebase
- The "beginner DSL" shown in vision is not implemented
- Some features may be partially wired (need tests to confirm end-to-end)
Verified commands from main.rs: run, build, check, fmt, lint, migrate, clean, init, new, doc, test, repl, publish, install, uninstall, update, doctor, version, dump-ast, dump-ir, dump-bytecode, emit-ir, emit-llvm, emit-asm, emit-obj, benchmark, completion, examples, docs, config, self.
New/init scaffolding: confirmed in new_cmd.rs with templates (console/library/package/workspace/empty).
Doctor: exists.
Work status: Implementation exists for these command handlers; "which ones work" cannot be confirmed without building/running tests in this environment - mark as VERIFIED (handlers exist), runtime correctness UNKNOWN without execution.
Website: No evidence of built-in website framework, dev server, bundler, or tsc build web/dev in CLI. Stdlib has web module listed (README) but implementation details not inspected deeply - needs verification.
Android: No evidence of Android project generation, Gradle integration, APK/AAB building in CLI or codebase. Only platform mentions in installers/docs/research.
Status: NOT IMPLEMENTED for the envisioned end-to-end flows.
Workspace deps (Cargo.toml): logos 0.16, clap 4, serde/serde_json 1, anyhow 1, thiserror 2, tower-lsp 0.20, rustyline 18, colored 3, toml 1.1, indexmap 2, clap_complete 4. CLI adds dirs 7, ureq 3.4, rayon 1.12, bincode 3, winres 0.1 (build).
Third-party: third_party/ dir exists, THIRD_PARTY_LICENSES.md present, ATTRIBUTIONS.md/NOTICE/COPYRIGHT present.
Licenses: Project Apache-2.0 (LICENSE). Third-party components under their own licenses.
Maintenance: Most deps are common/stable; specific maintenance status not fully assessed from manifests alone - PARTIALLY KNOWN (need to check upstream activity if integrating further).
Potential issues (from inspection):
- Large CLI with many features increases complexity
- LLVM path optional/complex to set up
- Legacy alias support adds parser/lexer complexity
- No visible web/android tooling increases gap to vision
- Error messages exist but "plain-English actionable" beginner experience not yet realized
- Windows-first considerations mentioned; cross-platform needs validation
- Security: No obvious secret handling issues in inspected code; must be careful not to touch credentials. Stdlib may have network/crypto modules - need review if used.
- Stability: Core compiler pipeline appears structured, but end-to-end beginner flows unimplemented.
Critical gaps:
- Beginner DSL/grammar layer for natural-language style (
make a website...,page Home: ... show ...) - not present - Website framework + dev server + bundler - not present
- Android project generation + Gradle/Kotlin integration + APK/AAB + signing - not present
- CLI commands for
new website/android,dev,build web,build android ...- not present - UI/component model, routing, styling system for web/apps - not present
- Device/emulator integration, keystore management - not present
- Beginner-friendly error messages/doctor enhancements - partially exists but needs extension
- Templates for web/android projects - not present
Approach: Implement as a DSL/frontend layer that lowers to the existing stable core language (AST/VM/runtime). Keep advanced features accessible. Avoid adding hundreds of hidden rules.
- English-like verbs:
make,show,when ... is clicked,start,build - Minimal punctuation,
endblocks consistent with existing style - Indentation-sensitive where natural, but unambiguous
- Lower to existing constructs (functions, events) where possible
- Backward compatible
make a website called MySite
page Home:
show heading "Welcome to My Website"
show text "I built this with TechScript"
show button "Click Me" as btnClick
when button btnClick is clicked:
show message "Hello!"
start website
make an app called MyFirstApp
screen Home:
show heading "My First App"
show text "Made with TechScript"
show button "Say Hello" as btnHello
when button btnHello is clicked:
show message "Hello, World!"
build android app
make a variable called name with value "Alex"
make a list called todos with ["learn", "build", "share"]
when page loads:
show text "Hello, " + name
end
make a component called Card with title and body:
show box:
show heading title
show text body
end
end
use component Card with title="Hi", body="Welcome"
when button "Get Data" is clicked:
make a request to "https://api.example.com/data" and get result
show text result.message
end
- Lexer: Recognize new keywords/patterns (
make a website/app,page,screen,show,component) - can extend existing lexer or pre-process - Parser: Add grammar rules for DSL constructs; produce either new AST nodes or lower directly to existing AST (e.g.,
page Home:becomes a function/route definition) - Lowering: DSL → core AST → existing compiler pipeline
- Validation: Provide plain-English errors with suggestions
Feasibility with existing architecture: PARTIALLY - AST has DSLBlock (line ~618 in AST) which suggests DSL support was anticipated. Lexer/parser would need extension. Lowering layer needed. Can be done incrementally without replacing core compiler.
Recommendation: Extend existing pipeline with a DSL frontend + lowering layer (not a second full compiler).
[Beginner DSL (.txs with DSL syntax)]
↓ (DSL Lexer/Parser or preprocessor)
[DSL AST]
↓ (Lowering/Desugaring)
[Core TechScript AST] (existing)
↓ (existing: Semantic → IR → Optimizer → Bytecode/LLVM)
[Runtime/VM or Native]
↓ (Framework generators)
[Web (HTML/CSS/JS) or Android (Kotlin/Gradle project)]
Rationale:
- Reuse existing lexer/parser/semantic/IR/VM/stdlib - huge investment
- AST already has
DSLBlocksuggesting this direction - Lowering keeps core language stable
- Can transpile to web (HTML/JS/TS) or generate Android projects (Kotlin) while leveraging existing runtime where appropriate
- Avoids maintaining two compilers
Trade-offs: Transpilation to web/Android gives maximum compatibility and leverages existing tooling (browsers, Gradle, Android SDK). Using VM for everything is harder for native mobile/web distribution.
- Inspect stdlib web module - understand current capabilities
- Design TechScript Web DSL - map
page/show/button/when clickedto routes/components - Transpilation target - generate HTML/CSS/JS (or use Vite/webpack). Consider Preact/Vanilla JS for simplicity
- Dev server - implement
tsc devwith hot reload (can use existing tools likelive-serveror Rust-based server) - Build -
tsc build webproduces static files - 3D/WebGL - integrate Three.js via stdlib or generated imports
- SEO/a11y/security - add sensible defaults and checks
- Project template generation - create Android project structure (Gradle, AndroidManifest, etc.) similar to how
tsc newworks - Transpile TechScript screens/logic to Kotlin - generate Activities/Fragments/Composables based on DSL
- Bridge/runtime - minimal runtime for common operations or direct Kotlin stdlib
- Build integration - call Gradle via CLI, detect Android SDK
- Debug/release -
tsc build android --debug,--release-apk,--aabwith signing support - Device install -
adb installintegration
Key tools to leverage: Vite/esbuild for web, Android Gradle Plugin, Kotlin compiler, adb. All FOSS.
- Deep inspection of codebase
- Create audit report
- Get approval
- Document core language grammar/semantics formally
- Add/fix tests for lexer/parser/VM basics
- Extend CLI doctor for web/android toolchain detection
- Create DSL parsing scaffolding
- Implement lexer/parser extensions for DSL
- Create lowering to core AST
- Test with vision examples
- Add beginner-friendly error messages
- Web DSL lowering to HTML/CSS/JS
- Basic components/pages/routing
-
tsc new website,tsc dev,tsc build web - Simple dev server with hot reload
- Android project template
- DSL → Kotlin transpilation for basic screens/buttons/events
-
tsc new android,tsc build android --debug - Gradle integration and APK generation
- Release builds/signing
- 3D/WebGL support basics
- API calls/networking
- Documentation and examples
- Testing
Reordering notes: Focus on DSL + lowering first (unlocks both web and android), then parallelize web/android implementations.
| File | Reason | Priority |
|---|---|---|
compiler/lexer/src/lib.rs |
Add DSL keywords/tokens (make, page, screen, show, component etc.) |
P0 |
compiler/syntax/src/token_kind.rs |
Register new keywords (canonical/deprecated as appropriate) | P0 |
compiler/parser/src/*.rs |
Add parsing rules for DSL constructs; integrate with AST | P0 |
compiler/ast/src/lib.rs |
May need new node types for DSL/web/android constructs (or use existing DSLBlock) | P0 |
cli/src/main.rs |
Add new subcommands (dev?) and route new commands; may need new website/android support |
P0 |
cli/src/commands/new_cmd.rs |
Extend project templates for web/android | P0 |
cli/src/lib.rs / CLI structure |
Add command modules for web/android build/dev if needed | P1 |
docs/ |
Update docs as features added (preserve existing) | P2 |
Note: Start with minimal changes, add tests, keep backward compatibility. No files deleted. Major architectural changes require approval per rules.