Skip to content

Commit 4f82f2a

Browse files
committed
Update public-release to v1.0.6 (7th Official Milestone)
1 parent 09feb6c commit 4f82f2a

689 files changed

Lines changed: 599790 additions & 104 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AUDIT.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# TechScript Repository Audit (2026-03-17)
2+
3+
This document is a **ground-truth audit** of the current TechScript repository implementation vs the promised behavior in docs/examples. It is intended to drive the stabilization/refactor work.
4+
5+
## Architecture snapshot
6+
7+
- **Workspace**: Rust workspace with `techscript-core`, `techscript-cli`, `techscript-lsp`.
8+
- `Cargo.toml`
9+
- `crates/techscript-core/Cargo.toml`
10+
- `crates/techscript-cli/Cargo.toml`
11+
- `crates/techscript-lsp/Cargo.toml`
12+
- **Pipeline**: `Lexer``Parser``Compiler` (bytecode) → `VM`.
13+
- `crates/techscript-core/src/lexer.rs`
14+
- `crates/techscript-core/src/parser.rs`
15+
- `crates/techscript-core/src/compiler.rs`
16+
- `crates/techscript-core/src/vm.rs`
17+
18+
## Feature × status matrix
19+
20+
Legend: **OK** (implemented and used), **PARTIAL** (implemented but incomplete/buggy), **DRIFT** (docs/examples disagree), **MISSING** (promised but absent).
21+
22+
### Language core (syntax / semantics)
23+
24+
- **Lexing**: **OK**
25+
- Supports numbers (incl `0x`/`0b`/`0o`), strings (single/double/triple), raw strings, f-strings token (`TokenType::FString`).
26+
- `crates/techscript-core/src/lexer.rs`
27+
- **Parsing**: **OK** (broad coverage), **DRIFT** (some keywords)
28+
- Statements: `say/make/keep/use/take/share/when/or when/else/each/repeat/until/build/model/attempt/rescue|catch/always/match/case/guard/with/defer/drop/stop/skip/pass/send/fail`
29+
- `crates/techscript-core/src/parser.rs`
30+
- **Formatting**: **PARTIAL / BUG**
31+
- Formatter prints `when ... } alt ... {` but parser/docs use `} or when ... {`.
32+
- `crates/techscript-core/src/formatter.rs` vs `crates/techscript-core/src/parser.rs`
33+
- **Compilation**: **OK** for implemented AST surface, **NOTE**
34+
- Compiler does **not** emit `OpCode::Invoke`; it emits `GetProperty` + `Call` for method-style calls.
35+
- `crates/techscript-core/src/compiler.rs`, `crates/techscript-core/src/opcode.rs`
36+
- **VM execution**: **PARTIAL**
37+
- `OpCode::Invoke` exists in opcode set but is unimplemented in VM (`/* TODO */`); currently **likely unused** by the compiler.
38+
- String method binding appears incorrect (`make_native_str` ignores receiver).
39+
- `crates/techscript-core/src/vm.rs`
40+
- **Error reporting**: **OK baseline**, can improve
41+
- Central error types + formatting used by CLI.
42+
- `crates/techscript-core/src/error.rs`
43+
- **Async/task**: **PARTIAL**
44+
- `spawn` queues tasks, `await` is a no-op; event loop runs tasks by calling them.
45+
- `crates/techscript-core/src/vm.rs`
46+
47+
### Builtins (globals)
48+
49+
- **I/O**: **OK** (`say/print/write`, plus `log/warn/error/debug/clear`)
50+
- `crates/techscript-core/src/builtins.rs`
51+
- **Core**: **OK** (`assert/sleep/time/time_ms/exit/callable`)
52+
- `crates/techscript-core/src/builtins.rs`
53+
- **String & list helpers**: **OK as globals**, **DRIFT as methods**
54+
- `split/join/replace/replace_all/contains/...` exist as **global functions**.
55+
- Docs claim these as **string methods** (e.g. `"hello".split()`), but VM only exposes a small set of string properties/methods and method-binding is buggy.
56+
- `crates/techscript-core/src/builtins.rs`, `crates/techscript-core/src/vm.rs`, `docs/REFERENCE.md`
57+
- **List methods**: **PARTIAL**
58+
- VM list property supports `append/remove/reverse` (and mentions `sort` but does not implement it).
59+
- Docs claim `map/filter/sort/reverse`.
60+
- `crates/techscript-core/src/vm.rs`, `docs/REFERENCE.md`
61+
62+
### Standard library modules (`use ...`)
63+
64+
Builtin module resolution list includes: `math/fs/os/random/json/crypto/date/api/web/gui/three_d/anime/debug` (plus `net` in stdlib).
65+
- `crates/techscript-core/src/module_resolver.rs`
66+
67+
- **math**: **OK**
68+
- `crates/techscript-core/src/stdlib/math.rs`
69+
- **fs**: **OK**
70+
- `crates/techscript-core/src/stdlib/fs.rs`
71+
- **os**: **OK** (but includes shell execution)
72+
- `crates/techscript-core/src/stdlib/os.rs`
73+
- **random**: **OK** (LCG-ish, not cryptographic)
74+
- `crates/techscript-core/src/stdlib/random.rs`
75+
- **json**: **OK** (custom JSON codec; limited types)
76+
- `crates/techscript-core/src/stdlib/json.rs`
77+
- **crypto**: **PARTIAL / SECURITY NOTE**
78+
- `sha256` and base64 are implemented; `md5` is a non-MD5 FNV-like hash despite the name.
79+
- `crates/techscript-core/src/stdlib/crypto.rs`
80+
- **date**: **OK**
81+
- `crates/techscript-core/src/stdlib/date.rs`
82+
- **debug**: **OK**
83+
- `crates/techscript-core/src/stdlib/debug.rs`
84+
- **net**: **PARTIAL / NON-PORTABLE**
85+
- Uses `curl` via shell-out for GET/POST.
86+
- `crates/techscript-core/src/stdlib/net.rs`
87+
- **web/gui/three_d/anime**: **OK baseline (browser-based hybrid)**, needs hardening
88+
- Generates HTML/JS and serves via a blocking localhost TCP server, auto-opens browser/app mode.
89+
- Implemented under `crates/techscript-core/src/stdlib/web.rs` (`web`, `gui`, `scene`, `anime` namespaces).
90+
- **api**: **MISSING**
91+
- Docs + examples reference `use api` + `api.listen(3000)` but there is no stdlib `api` module registration and VM import handler does not include `api`.
92+
- `docs/REFERENCE.md`, `examples/api_server.txs`, `crates/techscript-core/src/vm.rs`, `crates/techscript-core/src/stdlib/mod.rs`
93+
94+
### CLI tooling
95+
96+
- **Commands**: **OK baseline**
97+
- `run/build/check/fmt/lint/repl/test/init/doc/install/doctor`
98+
- `crates/techscript-cli/src/main.rs`
99+
- **Native build**: **PARTIAL**
100+
- `tech build --native` generates a temporary Cargo project and compiles a runner embedding bytecode.
101+
- `crates/techscript-cli/src/main.rs`
102+
- **Test runner**: **PARTIAL**
103+
- Executes `.txs` files but does not verify outputs beyond “no runtime error”.
104+
- `crates/techscript-cli/src/main.rs`
105+
- **Package install**: **OK baseline**
106+
- Clones git repos into `.techscript-modules/` and updates `tech.toml`.
107+
- `crates/techscript-cli/src/pkg.rs`
108+
109+
### LSP
110+
111+
- **Diagnostics**: **OK baseline**
112+
- Lex/parse/compile to produce diagnostics.
113+
- `crates/techscript-lsp/src/main.rs`
114+
- **Completions**: **DRIFT**
115+
- Includes keywords like `alt` even though parser uses `or when` form; also includes builtins that don’t exist as list methods.
116+
- `crates/techscript-lsp/src/main.rs`
117+
118+
## High-impact mismatches (action list)
119+
120+
1. **Implement `api` module** to make `examples/api_server.txs` and `docs/REFERENCE.md` real.
121+
2. **Fix formatter** to emit syntax the parser accepts (`or when`, and `take ... in` vs `take ... from` drift if needed).
122+
3. **Fix receiver-based methods** (strings/lists) or adjust docs to match “globals-only” API. For compatibility, methods are preferred.
123+
4. **Remove `curl` dependency** in `net` (replace with Rust HTTP client implementation) to support Windows and “zero external deps”.
124+
5. **Add headless / no-auto-open modes** for `web/gui/three_d/anime` to enable automated testing.
125+

CONTRIBUTOR_GUIDE.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing to TechScript
2+
3+
Thank you for your interest in TechScript!
4+
5+
TechScript is natively written in Rust. The project is structured as a standard Cargo Workspace.
6+
7+
## Project Structure
8+
9+
* `crates/techscript-core/`: The core library. Contains Lexer, Parser, AST, Compiler, VM, Builtins, and standard library (`stdlib/`).
10+
* `crates/techscript-cli/`: The `tech` binary. Includes runner, REPL, formatter, linter, package manager (`tech install`), and testing framework (`tech test`).
11+
* `crates/techscript-lsp/`: Language Server Protocol implementation for IDEs (like VSCode).
12+
* `vscode-extension/`: The official Visual Studio Code syntax highlighting and snippet extension.
13+
14+
## Building from Source
15+
16+
Prerequisites:
17+
- [Rust toolchain](https://rustup.rs/) (stable)
18+
19+
```bash
20+
git clone https://github.com/techscript/techscript.git
21+
cd techscript
22+
23+
# Build the workspace
24+
cargo build --release
25+
26+
# Run the test suite
27+
cargo test --workspace
28+
```
29+
30+
## Creating Pull Requests
31+
32+
1. Fork the repository
33+
2. Create a new feature branch (`git checkout -b feature/cool-idea`)
34+
3. Make your changes in the respective `.rs` files.
35+
4. Add tests to `crates/techscript-core/tests/` (we use snapshot testing).
36+
5. Run `cargo fmt` and `cargo clippy`.
37+
6. Submit your PR!
38+
39+
All PRs must pass the GitHub Actions CI pipeline which runs formatting, linting, and full tests across Linux, Windows, and macOS.

0 commit comments

Comments
 (0)