plainscript-lang 1.1.1 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,79 @@
1
+ # PlainScript v1.1.5 Completeness Gap Analysis and Implementation Plan
2
+
3
+ ## Correct milestone thesis
4
+
5
+ PlainScript **v1.1.5 is the completeness milestone**. It is not merely a trustworthiness foundation with mainstream language capability deferred to v1.2.x. The release must contain the general-purpose capabilities needed to build serious multi-file software without requiring a new domain-specific compiler feature for every application category.
6
+
7
+ > PlainScript should provide powerful general-purpose language primitives, a broad standard library, and strong JavaScript/npm interoperability. Web backends, APIs, CLIs, bots, games, automation, libraries, and database applications should be built from those primitives rather than from an ever-growing collection of one-off syntax features.
8
+
9
+ The current `main` branch is a verified trustworthiness slice, not the finished completeness release. This document is the active contract for the remaining work.
10
+
11
+ ## Already implemented and retained
12
+
13
+ - Near-English declarations, functions, lambdas, records, collections, templates, control flow, errors, async syntax, modules, npm imports, CLI compilation, source maps, and an in-process LSP.
14
+ - Recursive contracts for named records, optional fields, unions, lists, dictionaries, typed returns, Promise tracking, indexes, assignments, and common expression results.
15
+ - Local dependency discovery, aliases, directory resolution, cycle diagnostics, named/aliased/namespace imports, barrel exports, SQLite/WASM, HTTP, filesystem, crypto, CLI, browser, Canvas/WebGL, WebSocket, bots, uploads, sessions, and broad runtime helpers.
16
+ - Verified regressions for collection soundness, destructuring, module export visibility, incremental LSP edits, retry failure propagation, release metadata, and the complete existing test suite.
17
+
18
+ ## Remaining completeness gaps
19
+
20
+ ### Language and type system
21
+
22
+ - Generic or otherwise expressive reusable types, including substitution and useful diagnostics.
23
+ - Named aliases and normalized recursive unions.
24
+ - Discriminated unions with flow-sensitive narrowing.
25
+ - Structural patterns with bindings, guards, alternatives, impossible-arm diagnostics, and useful exhaustiveness checking.
26
+ - A capable object/abstraction model: validated constructors, typed members/methods, predictable record/kind behavior, and interoperable class/object semantics.
27
+ - Typed tuple, Set, and Map contracts plus mutation checking and generic collection operations.
28
+
29
+ ### Runtime and standard library
30
+
31
+ - Portable JSON/value conversion for Map, Set, BigInt, undefined, circular values, and deterministic encoding. **Implemented in this milestone.**
32
+ - Correct calendar/timezone/UTC date semantics and complete formatting.
33
+ - Async/atomic filesystem operations, directory streams, and teaching errors.
34
+ - Cancellable and streaming subprocesses with cwd/env/timeout/signal/stdio options.
35
+ - Richer HTTP request/response/options/abort/retry/stream support.
36
+ - Precise browser/package target behavior and a truthful WebGPU/Three.js interoperability contract.
37
+
38
+ ### Async, errors, and resources
39
+
40
+ - Promise.any semantics, aggregate failures, loser/sibling cleanup, and structured task handles.
41
+ - Cancellation tokens/signals and timeout propagation for supported operations.
42
+ - Retry predicates, backoff/deadlines, normalized error causes, and source context.
43
+ - Background/scheduled task observation and shutdown ownership.
44
+ - Scope-based `defer`/`using`-style cleanup for streams, subprocesses, databases, caches, sockets, and schedules.
45
+
46
+ ### Modules and interoperability
47
+
48
+ - A real module linker with canonical module IDs, private scopes, isolated declarations, explicit exports, stable aliases, and collision diagnostics.
49
+ - Graph-aware build/check/type analysis rather than flattened synthetic AST checking.
50
+ - Config-driven `rootDir`/`baseUrl`/`paths` resolution and manifest/lockfile reconciliation.
51
+ - Robust CommonJS/ESM/default/named/subpath/exports-condition handling and explicit Node/browser targets.
52
+
53
+ ### Tooling and proof
54
+
55
+ - A real VS Code LSP client, semantic cross-file navigation, structured diagnostics, formatting integration, lifecycle/version/cancellation handling, and stable JSON output.
56
+ - Correct formatter behavior and source-map offsets through generated wrappers and bundled modules.
57
+ - Mandatory CI, packaged-consumer tests, recursive version validation, template/application matrices, real-browser proof, and clearly labelled service-backed or offline integration tests.
58
+
59
+ ## Implementation sequence
60
+
61
+ 1. **Shared semantic spine and module linker:** canonical graph/module IDs, per-module symbols and exports, config-rooted resolution, isolated generated module records, graph-wide diagnostics and type checking.
62
+ 2. **Expressive types and structural control flow:** aliases, closed unions, explicit generic parameters/instantiation, structural patterns, guards, narrowing, impossible/duplicate/unreachable arms, and exhaustiveness.
63
+ 3. **Object and collection completeness:** validated object abstractions, typed methods/members, tuple/Set/Map contracts, and mutation checking.
64
+ 4. **Runtime and error contract:** normalized diagnostics/errors, JSON/date/files/process/HTTP correctness, and compatibility-preserving richer options.
65
+ 5. **Structured async/resource semantics:** Promise.any, task handles, cancellation, timeout propagation, retries/backoff, structured background work, and disposal.
66
+ 6. **Production tooling:** compiler-backed symbols, cross-file LSP, VS Code client, formatter modes, stable diagnostics, and source-map correctness.
67
+ 7. **Executable proof and packaging:** CI, npm tarball consumer, application/template matrices, browser and service contract gates, and release integrity.
68
+
69
+ ## Release gates
70
+
71
+ - `npm test`, docs checks, release checks, formatter checks, LSP/extension smoke, source-map tests, and all type/module/runtime regressions pass in CI.
72
+ - The exact npm tarball installs into a clean consumer and builds/runs a typed multi-file application with isolated modules and source-mapped failures.
73
+ - Generic types/aliases, structural matching/narrowing/exhaustiveness, object abstractions, typed collections, Promise.any/cancellation/disposal, and JS/npm interop each have positive and negative tests.
74
+ - Every advertised example/template is either executable in a deterministic matrix or explicitly annotated with its external-service requirements; compile-only proof is not presented as runtime proof.
75
+ - Versions agree across root/lockfile/compiler/grammar/changelog/LSP/VS Code/templates, and publish uses the immutable artifact that passed the gates.
76
+
77
+ ## Compatibility rule
78
+
79
+ Preserve valid v1.0.363 and v1.1.x programs wherever practical. New completeness features should use unambiguous syntax and explicit diagnostics. Legacy untyped code remains permissive at dynamic boundaries, while new typed code must not silently escape through `any`.
package/package.json CHANGED
@@ -1,15 +1,28 @@
1
1
  {
2
2
  "name": "plainscript-lang",
3
- "version": "1.1.1",
3
+ "version": "1.1.5",
4
4
  "description": "PlainScript - an Intent-Oriented Programming Language. When even a simple sentence can be code.",
5
+ "author": {
6
+ "name": "Ayodele Ayokunle David",
7
+ "email": "davidayodele847@gmail.com"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/ayoistooslick/plainscript.git"
12
+ },
13
+ "homepage": "https://github.com/ayoistooslick/plainscript#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/ayoistooslick/plainscript/issues"
16
+ },
5
17
  "main": "compiler/cli.js",
6
18
  "bin": {
7
19
  "plainscript": "./compiler/cli.js",
8
20
  "plainscript-lsp": "./compiler/lsp.js"
9
21
  },
10
22
  "scripts": {
11
- "test": "node tests/compiler.test.js && node tests/build.test.js && node tests/telegram.test.js && node tests/ocr.test.js && node tests/nesting.test.js && node tests/backend.test.js && node tests/runtime.test.js && node tests/browser.test.js && node tests/acceptance.test.js && node tests/whatsapp.test.js && node tests/audit.test.js && node tests/sourcemap.test.js && node tests/modules.test.js && node tests/repeat.test.js && node tests/datastructures.test.js && node tests/kernel.test.js && node tests/assignment.test.js && node tests/primitives.test.js && node tests/concurrency.test.js && node tests/terminal.test.js && node tests/cli.test.js && node tests/docs.test.js && node tests/types.test.js && node tests/ir.test.js && node tests/lsp.test.js && node tests/parser-robustness.test.js && node tests/compat/browser-interop.test.js && node tests/compat/language.test.js && node tests/compat/node.test.js && node tests/compat/binary.test.js && node tests/compat/errors.test.js && node tests/compat/async.test.js && node tests/compat/modules.test.js && node tests/compat/npm.test.js && node tests/compat/web.test.js && node tests/compat/real-world.test.js && node tests/torture.test.js && node tests/packaging.test.js && node tools/verify-all-docs.js",
12
- "docs:check": "node tools/verify-all-docs.js"
23
+ "test": "node tests/compiler.test.js && node tests/build.test.js && node tests/telegram.test.js && node tests/ocr.test.js && node tests/nesting.test.js && node tests/backend.test.js && node tests/runtime.test.js && node tests/browser.test.js && node tests/acceptance.test.js && node tests/whatsapp.test.js && node tests/audit.test.js && node tests/sourcemap.test.js && node tests/modules.test.js && node tests/repeat.test.js && node tests/datastructures.test.js && node tests/kernel.test.js && node tests/assignment.test.js && node tests/primitives.test.js && node tests/concurrency.test.js && node tests/formatter.test.js && node tests/terminal.test.js && node tests/cli.test.js && node tests/docs.test.js && node tests/types.test.js && node tests/ir.test.js && node tests/json.test.js && node tests/completeness.test.js && node tests/lsp.test.js && node tests/parser-robustness.test.js && node tests/compat/browser-interop.test.js && node tests/compat/language.test.js && node tests/compat/node.test.js && node tests/compat/binary.test.js && node tests/compat/errors.test.js && node tests/compat/async.test.js && node tests/compat/modules.test.js && node tests/compat/npm.test.js && node tests/compat/web.test.js && node tests/compat/real-world.test.js && node tests/torture.test.js && node tests/packaging.test.js && node tools/verify-all-docs.js",
24
+ "docs:check": "node tools/verify-all-docs.js",
25
+ "release:check": "node tools/check-release-version.js"
13
26
  },
14
27
  "files": [
15
28
  "compiler",