Releases: ZtaMDev/DeltaScript
DeltaScript 1.0.5
DeltaScript 1.0.5 and VS Code Extension 1.0.8 – Release Notes
Highlights
- Language: Stronger type inference and class support. Ternaries and
mboolfixed. Class method::ReturnTypeenforced. - CLI: New
--minifyflag and configminifyoption. Single-file runs bundle.dsand.jswhen possible. - Extension: Improved diagnostics around method returns and class parsing. Stable experience aligned with the language changes.
- Docs: Updated for new flags, config, return types in classes, and inference behavior.
Language (1.0.5)
-
Class methods
::ReturnTypeenforcement- Member calls on class instances (including
new Class(...).method()) now use the declared method::ReturnType. - Avoids confusing class methods named like native methods (e.g.,
toString) with JS built-ins.
- Member calls on class instances (including
-
Deep expression analysis improvements
- Ternary analysis infers from branches (not from the condition):
typeof res === "string" ? res : String(res?.code || "")→str.Array.isArray(x) ? x : []→arr.
- Handles optional chaining and recognizes nullish/optional patterns when splitting ternaries.
- Better string inference on concatenations involving literals and
.toString().
- Ternary analysis infers from branches (not from the condition):
-
mbool stability
maybe,true,false→ inferred asmbool.- Top-level comparisons (
===, !==, ==, !=, >=, <=, <, >) and!→mbool. &&and||no longer misclassified as boolean by default; avoids false “mbool to num/str” errors in expressions likeerr || {}.
-
Native/global function return types recognized
parseFloat,parseInt,Number→num.String,JSON.stringify→str.Boolean,Array.isArray→mbool.Math.*(...)→num.- Common methods:
.includes(...)→mbool,.join(...)→str.
-
Typed arrays and ternaries
- Assignments like
const arrExt::arr<str> = Array.isArray(exts) ? exts : [exts]now pass. - For non-literal RHS arrays with unknown inner types, the checker avoids incorrectly flagging “mixed array” errors.
- Assignments like
-
Parsing
- Preprocessing preserves class method headers with
::ReturnTypeso methods and constructors parse cleanly.
- Preprocessing preserves class method headers with
-
Compatibility
.dsimports are still rewritten to.js..jsimports are preserved and allowed.- No breaking changes to existing syntax or rules.
CLI
-
New: Minification
dsc build --minifyminifies emitted JS (best-effort with esbuild).- Config support:
minify: false(default). Settrueto enable by default. - Requires
esbuilddependency. Falls back gracefully if not installed.
-
Single-file runs: bundling
dsc <entry.ds>compiles to a temp workspace and now bundles the entry (and imported.ds/.js) into a single module via esbuild when available.- To prevent runtime crashes in bundled ESM (e.g., dynamic require), single-file runs force a logging shim instead of importing SpectralLogs packages/CDN. Project builds are unaffected.
-
Flags recap
--no-builtins,--spectral-cdn,--minify.
VS Code Extension (1.0.8)
-
Diagnostics
- Return type checking improved:
- Mismatched
returnexpressions. - Missing
returnfor declared non-void methods/functions.
- Mismatched
- Class method
::ReturnTypesupport integrated with LSP diagnostics.
- Return type checking improved:
-
Language support
- Syntax/hover/completions reflect
::ReturnTypefor class methods. - Inline errors align with updated compiler inference (ternaries,
mbool, array checks).
- Syntax/hover/completions reflect
Documentation
-
Readme
- Updated CLI flags (including
--minify), configminify, single-file bundling, and class method::ReturnTypeexample.
- Updated CLI flags (including
-
/docs (VitePress)
- cli.md:
--minifyflag, bundling behavior in single-file runs, updated examples. - config.md:
minify: falsedefault and field documentation. - index.md: Highlights return type enforcement and bundling; adds
--minifyto useful flags. - language.md: Method
::ReturnTypesection and examples, ternary inference rules, recognized native functions.
- cli.md:
Migration Notes
- No code changes required for existing projects.
- Optional:
- Add
"esbuild"to your project for minify/bundling features. - Flip
minify: truein dsk.config.ds to default minification on builds.
- Add
- If you rely on SpectralLogs in single-file runs, note that a shim is used during bundling for compatibility; project builds still use package/CDN if configured.
How to Update
- Language:
npm i -g deltascriptornpm i deltascript(1.0.5) - Extension: Update to v1.0.8 in VS Code Marketplace/Open VSX
Summary: Language 1.0.5 strengthens type inference, mbool, ternaries, and class returns. CLI gains minify and single-file bundling with robust logging. Extension 1.0.8 aligns diagnostics and language features.
DeltaScript 1.0.4
Release notes: Deltascript v1.0.4
- Tag: v1.0.4
- Published docs: https://ztamdev.github.io/DeltaScript/
- Compatible VS Code extension: v1.0.6
Highlights
-
Function return type annotations
- New syntax: annotate after the parameter list with
::ReturnType. - Type-checked against each
return. Missingreturnis reported at the annotation position. - Works with single-line functions and inline declarations.
- Example:
func Sum(a::num, b::num)::num { return a + b } func Wrong()::num { return "x" } // error: Return type mismatch (expects num) func NoReturn()::str { let x = 1 } // error: declares return type str but has no return
- Docs: https://ztamdev.github.io/DeltaScript/language#function-return-types
- New syntax: annotate after the parameter list with
-
Interface type checking (shallow) with optional fields
- Validate object-literal assignments and returns against interface fields.
- Optional fields via
?are supported. - String literal and union types allowed in fields (e.g.
"esm" | "cjs" | str). - Example:
interface Person { name::str; age::num } func Make()::Person { return { name: "A" } // error: expects Person (missing required: age) }
- Docs:
Editor and DX
- The VS Code extension v1.0.6 surfaces:
- Return type mismatches at
returnsites. - Missing
returnwhen a function declares::ReturnType. - Multiple diagnostics per file.
- Return type mismatches at
- Extension: https://marketplace.visualstudio.com/items?itemName=ZtaMDev.deltascript-vscode
- Docs entry: https://ztamdev.github.io/DeltaScript/getting-started
Fixes and robustness
- Robust stripping of
::ReturnTypein the transpiler for both same-line and next-line{. - Accurate handling of single-line functions with inline variable declarations prior to
return. - Interface-aware error messages for missing required fields in object literal returns.
- Cleaner diagnostics without JS false positives.
Docs
- Updated guides with return types and enhanced interface rules:
Upgrade
- Install/update:
- Global:
npm i -g deltascript - Local:
npm i deltascript
- Global:
- Quick start: https://ztamdev.github.io/DeltaScript/getting-started
Notes
- Emitted JS remains ESM. Single-file runs execute a temporary
.mjsvia Node.
DeltaScript 1.0.3
DeltaScript v1.0.3 – Release Notes
- Date: 2025-11-01
- Scope: CLI, Transpiler Core, VS Code Extension (Language Server), Config UX
Highlights
- Robust multi-error reporting across CLI and VS Code, no more “stop at first error.”
- Accurate scope handling for class methods and control blocks, eliminating false “Redeclaration” errors.
- Config quality-of-life:
dsk.config.dssupports both plain objects andexport default {}. - VS Code stability & hot-reload for the transpiler with ESM cache-busting.
Transpiler Core (src/transpiler.ts)
- Multi-error diagnostics:
- transpileSpark now returns
{ code, diagnostics }with all collected errors. - Syntax errors are mapped back to original lines even when interfaces are stripped.
- transpileSpark now returns
- Scope system correctness:
- Detects methods with
async/static/get/set/constructor. - Supports multi-line headers (brace
{on the next line). - Conservative scope closing: only count
}that start a line (ignores object/array closures like},or}:). - Parameters are registered in the correct function/method scope.
- Detects methods with
- Typed arrays and interfaces:
- Precise inference for array literals, including interface-compatible
arr<obj>. - Shallow interface validation on object literals at declaration/assignment.
- Precise inference for array literals, including interface-compatible
- Object-only files auto-wrap:
- A file that is a single top-level object literal is auto-wrapped as
export default { … }.
- A file that is a single top-level object literal is auto-wrapped as
- Emitted JS validation:
- Final pass parse with comment-stripping fallback; records any emitted JS syntax errors as diagnostics.
CLI (src/cli.ts)
- New transpiler contract supported:
- Properly consumes
{ code, diagnostics }from transpileSpark. - Prints code-frames for all errors per file.
- Properly consumes
- Build/dev experience:
dsc initcreatesdsk.config.dsusingexport default { … }.dsk.config.dsis excluded from compilation/watch to avoid false syntax errors.
- Spec helpers:
- Optional injection of SpectralLogs and console→spec rewrite preserved, now applied safely with the new output flow.
Config Loader (src/config.ts)
- Flexible formats:
- Accepts both plain object and
export default { … }. - Strips comments, quotes keys, and parses as JSON internally.
- Defaults
builtins: truewhen unspecified.
- Accepts both plain object and
VS Code Extension (extension/server)
- Language Server stability:
- ESM cache-busting (
?t=timestamp) ensures the latest transpiler loads. - Added a request handler to hot-reload the transpiler and revalidate open docs.
- ESM cache-busting (
- Multi-error surfaced in editor:
- The server now consumes and forwards all diagnostics from the transpiler.
- Fewer false positives:
- Scope fixes and conservative closing rules ported to the bundled transpiler.
- Temporary filter suppresses noisy “Redeclaration … in the same scope” messages.
- Config auto-wrap in editor:
- A file that is just
{ … }is treated asexport default { … }to avoid syntax errors in the editor.
- A file that is just
Bug Fixes
- Fixed false “Redeclaration of variable 'scope' in the same scope” in methods and blocks.
- Fixed incorrect scope closure on lines that contained object/array trailing braces.
- Fixed extension loading stale transpiler due to ESM caching.
- Fixed CLI crashes when transpiler returns structured diagnostics.
- Fixed config parsing errors for plain object
dsk.config.ds.
Developer Notes
- Scope handling now includes:
- Class method detection with
async/static/get/set/constructor. - Multi-line header handling with pending-open tracking.
- Per-line transactional error handling with conservative scope rollback (extension).
- Class method detection with
DeltaScript 1.0.2
DeltaScript v1.0.2 — Release Notes
Date: 2025-11-01
Highlights
- Native .ds module imports end-to-end:
import ... from "./file.ds"andexport ... from "./file.ds"now work across the transpiler and CLI. - Accurate diagnostics after interfaces: syntax errors now map precisely to the original source lines even when
interfaceblocks are stripped. - Single-file CLI runner is module-aware: recursively compiles
.dsdependencies and executes as ESM with clean output (no Node warnings).
Added
- .ds import support in transpiler
- Rewrites all
.dsspecifiers to.js:- Static:
import ... from "x.ds",export ... from "x.ds". - Bare/dynamic:
import "x.ds",import("x.ds").
- Static:
- Adds
./to specifiers lacking a relative prefix so Node treats them as relative modules (avoids “Cannot find package …” errors in ESM).
- Rewrites all
- CLI single-file dependency graph
dsc <entry.ds>now parses.dsimports, recursively transpiles all dependencies into a temp workspace preserving folder structure, and runs the entry as.mjs.- Injects Spectral builtins into every transpiled module in single-file mode (so
spec.*works in imported modules too). - Writes a temporary
package.jsonwith{"type":"module"}to suppress Node ESM warnings.
Changed
- Transpiler emit normalization
- Emits valid JS for function declarations:
func Name(→function Name(async func Name(→async function Name(
- Consistently rewrites
.dsimports/exports/bare/dynamic to.jsin both preprocessing and emitted output.
- Emits valid JS for function declarations:
- Fallback Spectral shim
- Removed unused
specwebconstant from the injected shim. - Shim remains synchronous and safe for Node and browser environments.
- Removed unused
Fixed
- Interface line/column mapping
- Parser-phase syntax errors are now mapped back to original source lines using a parsed→source map that simulates full interface removal (including single-line interfaces and trailing code after
}). - Column positions are corrected for inline transformations (e.g., removal of
::Type,func → function,maybeexpansion).
- Parser-phase syntax errors are now mapped back to original source lines using a parsed→source map that simulates full interface removal (including single-line interfaces and trailing code after
- ESM false positives
- JS syntax validation is skipped for ESM output to avoid reporting false “Unexpected token” errors when using
export/import.
- JS syntax validation is skipped for ESM output to avoid reporting false “Unexpected token” errors when using
- Single-file execution
- Ensures imported modules have
specavailable when builtins are enabled. - Suppresses Node’s MODULE_TYPELESS_PACKAGE_JSON warning by marking the temp workspace as ESM.
- Ensures imported modules have
CLI
dsc buildunchanged for multi-file projects (rewrites.ds→.jsin output).dsc <file.ds>:- Recursively compiles imported
.dsfiles. - Runs entry as
.mjswithcwdset to the temp workspace. - Applies builtins/migration only to the entry for console→spec migration; builtins are injected into all modules to provide
spec.
- Recursively compiles imported
Compatibility / Breaking Changes
- No breaking changes to the DeltaScript language syntax.
- If you relied on
specwebfrom the fallback shim, it has been removed (it was unused and undocumented). - For single-file runs that import other
.dsfiles, usedsc <entry.ds>; dependencies will be transpiled automatically.
Acknowledgements
Thanks for the feedback that led to:
- Robust .ds import handling (static, bare, dynamic).
- Precise diagnostic mapping after interfaces.
- Clean ESM execution in single-file workflows.
DeltaScript 1.0.1
DeltaScript 1.0.1 — Small Fix Release
- Date: 2025-10-31
- Package: deltascript@1.0.1
- CLI: dsc
Highlights
- Minor UX polish for build errors.
- Editor integration improvements (syntax + LSP).
- Docs expanded for mutability semantics.
Changes
-
CLI
- Refined build error summary:
- Pretty error with code frame shown once per file.
- “Failed” summary now lists only the file paths (no duplicate messages).
- Refined build error summary:
-
VS Code extension
- Syntax highlighting: added
mutkeyword (plus common control-flow tokens). - LSP:
- Completions include
mut. - Cross-file symbol indexing retained; diagnostics still backed by the transpiler.
- Completions include
- Stability: packaged VSIX and activation on startup/language ensured.
- Syntax highlighting: added
-
Docs
- README and Language Guide:
- Added “Mutability: mut / inmut”.
- Behavior clarified:
inmut varmakes an existingletimmutable from that point (like const).mut var = expris explicit mutation; invalid afterinmut.
- README and Language Guide:
-
Links
- README: added links to VS Code extension on Marketplace and Open VSX.
- docs/index.md: recommended extension with direct links; mention searching “deltascript” inside VS Code.
Installation
- npm: npm i -g deltascript
- Update to latest: npm i -g deltascript@latest
DeltaScript 1.0.0 Stable
DeltaScript 1.0.0 — Initial Stable Release
- Date: 2025-10-31
- Package: deltascript@1.0.0
- CLI: dsc
Install
You can install globally or locally.
npm
Global:
npm install -g deltascriptProject:
npm install deltascriptHighlights
- Stable initial release of the language, CLI, and tooling.
- Comprehensive documentation and practical examples included.
Features
-
CLI
dsc init: createsdsk.config.dsand ensures src/ exists.dsc build: compiles all.dsto ESM.jsinoutDir.dsc dev: watch mode with per-file debounce and concise output.dsc <file.ds>: transpiles and runs a single.dsusing a temporary.mjs(supports top‑level await and full interactivity).-v/--version: prints DeltaScript version.- Flags:
--no-builtins: disable SpectralLogs integration and console tips.--migrate-to-spec: rewriteconsole.*tospec.*automatically.--spectral-cdn: force CDN imports for SpectralLogs.
-
Language
- Typed annotations with
::. - Types:
num,str,mbool(true/false/maybe). - Arrays:
arr,arr<T>. - Objects:
obj. - Interfaces and classes.
funcinstead offunction.- Default parameters; return types inferred.
- Clear errors with code frames (file:line:col), colorized.
- Typed annotations with
-
Runner (single-file)
- Outputs to a temporary
.mjsto ensure ESM and top‑level await. - Interactive I/O preserved (e.g.,
await spec.input(...)). - Proper Ctrl+C forwarding and cleanup of temp files.
- Outputs to a temporary
-
SpectralLogs Integration
- Auto integration:
- Prefer package imports when available.
--spectral-cdnto use CDN.- No‑await shim fallback with
spec.*(includes asyncspec.input).
- Gentle warnings:
- Concise, yellow warning per session/file for
console.*. - Tip to use
--migrate-to-specwhen frequent.
- Concise, yellow warning per session/file for
- Auto integration:
-
Documentation
- README with logo and quick start.
- docs/: CLI, language, types, config, SpectralLogs, examples.
- Examples demonstrating functions, classes, control flow, interfaces, arrays, and structured logging.
Installation
- npm:
npm i -g deltascriptornpm i -D deltascript - bun:
bun add -g deltascriptorbun add -d deltascript - pnpm:
pnpm add -g deltascriptorpnpm add -D deltascript
Getting Started
- Initialize:
dsc init - Build:
dsc build - Watch:
dsc dev - Run single file:
dsc ./src/main.ds
Status: release notes prepared for 1.0.0 (initial stable).