Repository navigation
Releases
v0.12.1
v0.12.0
v0.12 is here! It's the biggest release yet for shell commands, and the largest breaking one so far: eight breaking changes, and fair warning: some of them can break existing scripts without check warnings or errors. Read the migration guide before upgrading, and run rad check --from-logs all to find the scripts that need attention.
β¨ Highlights
Shell commands are quoted, and readable inline. Values you interpolate are now quoted, so a filename with a space - or a string from somewhere you don't control - arrives as one argument instead of turning into shell syntax. A command can be read where it stands:
branch = $`git branch --show-current`.stdout.trim() catch "unknown"
if not $`which docker`.ok:
exit(1)
Captures now bind (stdout, stderr, code), so out = $cmd gives you the output rather than the exit code. And a command written as a list skips the shell entirely, so it behaves the same whichever shell is installed.
A REPL you can work in. rad repl gives you multi-line blocks, auto-indent, an editable line with history, and errors that hand you back the prompt instead of ending the session. Plus :vars, :docs <topic>, :load <file> and :help. The old --repl flag is gone.
Commands nest, and one can be the default. A command block can contain command blocks, so tool remote add works the way git remote add does, with shared args accepted anywhere along the path. Mark one command per level default and it runs when the user names none.
Scripts that prompt can run without a terminal. rad reads the script up front and refuses to start until every reachable prompt has an answer, given with --reply (keyed by line) or --reply-na for branches a run won't take. Nothing executes until they are all answered, so a CI or agent run is never left half-finished. rad also looks for a terminal on /dev/tty now, so echo x | rad script.rad prompts normally.
split() and replace() match literally. A regex is opt-in with regex=true. Most calls were passing literal text and quietly getting regex behavior - a . matching every character rather than a dot.
Error output fits your terminal. Diagnostics wrap to the width you actually have, and rad check renders through the same code as runtime errors. rad check also lost a batch of false positives: hints across a 206-script corpus dropped from 15 to 4.
π§° New builtins
get_os()-"macos","linux"or"windows"mkdir()- recursive and idempotent, likemkdir -pbase_name(),dir_name(),join_paths()- path helpers that work on paths that don't exist yetformat_epoch()- turns an epoch into a formatted date string, the counterpart toparse_date()lenbounds on how many values a list or variadic arg takes:pair len [2,2]
And plenty of bug fixes, see the list of commits below.
Don't hesitate to ask questions or raise issues!
Changelog
- 00cf40b feat!: answer a script's prompts when there's no terminal
- b3297b5 feat!: list args take several positional values
- 070dda5 feat!: shell captures bind stdout first, exit code last
- a75d948 feat!: shell commands can be read inline
- 27280ec feat!: shell commands quote what you interpolate into them
- 6411a25 feat!: split() and replace() match literally, regex= opts in
- caa05f9 feat(repl): make the REPL a command instead of a global flag
- a6686f1 feat: a failed shell command has its own error code
- fb4b52d feat: a fatal error can unwind instead of ending the process
- f69ebce feat: add get_os, mkdir, path helpers, and format_epoch builtins
- 5267bcc feat: dedicated error for '#' used as a comment
- bcbbb04 feat: hint at variadic form when list args overflow positionals
- ee56a96 feat: let a command run when the user names none
- 52dfca8 feat: let commands nest, like
git remote add - 0f87612 feat: make the REPL a session you can work in
- b5fc1f4 feat: prompt errors warn that a retry starts the script over
- c457ddc feat: rad check explains what the shell syntax change did to your script
- 2ee6fc2 feat: rad shows where a repeated prompt is called from
- fdfa395 feat: settle what a brace means inside a string
- a29621b fix!: constraints on a list arg are enforced, not ignored
- 5ac6891 fix(check): narrow through short-circuits and
inguards - 6c7aa76 fix(check): stop false positives on provably-safe code
- 678e489 fix(ci): benchmark runner survives the v0.12 shell quoting change
- edd6169 fix(ci): regenerate functions.txt, force LF on embedded/fixture paths
- e0a28ae fix(ci): trust the homebrew tap before bumping the formula
- 5d2bb6c fix: ?? and catch fire on an error you already hold
- cce7042 fix: a command that can't be started reports 127, not a Rad bug
- 0a7ea3d fix: a negative fallback no longer needs parentheses
- a9e68b3 fix: a pick that settles itself no longer discards your answer
- 108bf7c fix: a re-raised error names where it re-fired
- 10137ab fix: compound assign writes the binding it reads
- d31f5f5 fix: deleting during list iteration no longer duplicates an element
- 70dbaa1 fix: fit error output to the terminal
- 497628f fix: interactive prompts encode dash answers with the =-form
- ebe95d0 fix: list args show their type in --help again
- f8644d4 fix: on Windows, prompts draw to the console, not its input buffer
- 70da8e8 fix: rad fmt no longer declines files with a catch block
- 736ccab fix: rad no longer invents answers in its --reply suggestion
- 89aef63 fix: releasing survives scratch tags and notices a dirty tree
- 65e05f4 fix: running out of --reply answers no longer names one cause
- 9a89c6e fix: shrink ten diagnostics to the budget their own guide sets
- b82b8da fix: the benchmark harness writes its README without a shell
- a973e9a refactor: drop the arg branches nothing could reach
- df4f07c refactor: the shell executor works from a spec, not a statement
v0.11.0
Been a couple of months since the last release, so a lot's packed in here. v0.11 is headlined by two major new subsystems - a static type checker and a much richer language server - plus a canonical formatter, built-in docs, and interactive argument entry.
β¨ Highlights
Static type checker. Rad now catches whole classes of mistakes before your script runs: provable type mismatches, unknown typed-map keys, out-of-scope identifiers, and more - with type narrowing across if/while/for/switch/catch and closures. Uncertain cases stay non-blocking so it doesn't get in your way.
Our language server, radls, sees massive improvements. Hover, go-to-definition, find-references, rename, completion, semantic tokens, document symbols, and quick-fix code actions - backed by incremental parsing.
rad fmt - canonical formatter. One true formatting for Rad scripts, including args blocks and for with-clauses, driven by a documented rule catalog.
rad docs - docs in the binary. Look up any built-in straight from the CLI (rad docs <name>), no internet required.
Interactive argument entry (-i / --interactive). Fill in a script's arguments through a guided prompt, with a colorized transcript and the equivalent invocation echoed back. Interactive prompts (input, confirm, pick, multipick) are now powered by our own radish library.
Signal handling. New signal_trap and signal_ignore builtins, and defer blocks now run on SIGINT/SIGTERM for clean shutdown.
π§° New builtins
- to_json() - serialize values to JSON
- get_pid() - current process ID
- parse_duration() now accepts a w (weeks) suffix
- Time maps now include a weekday field
And various bug fixes, see list of commits below.
Don't hesitate to ask questions or raise issues!
Changelog
- 176e3e9 chore(check): tighten resolve types and binder issue plumbing
- 7649595 docs(check): fix stale Hint note in typed_local snapshot
- 62581d9 docs(errors): sweep error_docs comments + add validation test
- e9409a0 docs(fmt): document full-convergence vision and roadmap
- 956b619 docs(type-system): document scoping and name resolution
- 613e2b8 feat!: reject inapplicable global flags on built-in commands
- d9a8608 feat(check): T? suggestion in every nullable type position
- 9c788fe feat(check): add Scope/Symbol/Resolved name-resolution layer
- 11b67a5 feat(check): add bidirectional type-checker skeleton
- af4d5e1 feat(check): add binder-emitted issues + duplicate-param diagnostic
- 3818769 feat(check): add narrowing primitives + null predicate
- aa0e16f feat(check): bind for / while / list-comp scopes
- d324dc9 feat(check): bind function and lambda parameter scopes
- b7ce7ae feat(check): bind switch / defer / cmd_block scopes
- d437dfe feat(check): catch block narrows target to error
- a7bcfc8 feat(check): catch indexed assignment of wrong element type
- f276968 feat(check): closure rule drops narrowing on reassigned captures
- 876ce87 feat(check): collapse uninhabited tuples in union joins
- a57904b feat(check): detect unreachable switch cases (RAD40012)
- de97305 feat(check): diagnose lambda return body vs declared mismatch
- 6a0fe53 feat(check): enforce args-block and cmd-block types statically
- e33fd26 feat(check): faithful typing for fallible calls and literals
- 45e2a21 feat(check): for/while loop narrowing
- e83aa78 feat(check): gate provable type mismatches as errors
- d3cb295 feat(check): infer hoisted fn return types with SCC ordering
- 997def0 feat(check): infer lambda return type for structural matching
- 451af1d feat(check): infer tuple return type for multi-value returns
- ebe5242 feat(check): not / and / or narrowing predicates
- 684a7e4 feat(check): operator overload table for static expression types
- 2f95f53 feat(check): per-arg type-check on builtin calls
- 3e2537d feat(check): plumb suggestions through static diagnostics
- 85b5d87 feat(check): pre-plant lambda signature for recursive references
- 070e917 feat(check): promote provable type diagnostics to Error
- 9de2d1c feat(check): reassignment widening for while-loop bodies
- b2b0d6e feat(check): refine catch/?? result types
- e04715e feat(check): reject typed re-declaration (RAD40011)
- 68a78e1 feat(check): snapshot harness runs full Check() pipeline
- 7f4231d feat(check): static arity-check builtin calls
- 78dc8c9 feat(check): static call typing for user-defined functions
- cddc15e feat(check): static synthesis for list and map literals
- ec36cf9 feat(check): static undefined-identifier diagnostic with did-you-mean
- f131715 feat(check): structural matching for fn-value arguments
- 0d71264 feat(check): suggest '?' when 'null' appears in a type union
- c5a3a70 feat(check): switch narrowing + exhaustiveness diagnostic
- ce1aca9 feat(check): tighten ErrorType cascade prevention
- 33067e6 feat(check): truthy null-strip and in-literal-list narrowing
- 068f1d0 feat(check): type for-loop vars from union iterables and map k/v pairs
- c1ee6e9 feat(check): type_of, string-enum, in/not-in predicates
- 41d317b feat(check): typed local declarations end-to-end
- af58a63 feat(check): walk lambda bodies under captured frame
- 53da9c0 feat(check): wire narrowing through if/elif/else
- 69b4a84 feat(check,radls): diagnose unknown typed-map keys + key completion
- e7af68c feat(errors): retire dead parser codes + invest in three high-value ones
- 4ade0bd feat(fmt): add 'rad fmt' canonical formatter
- a16e46a feat(fmt): turn formatting rules into a documented catalog
- 60fdaa5 feat(lsp): resolve command callback references
- bf1a416 feat(radls): UFCS-aware completion ranking
- 3153632 feat(radls): add textDocument/definition
- b410882 feat(radls): add textDocument/documentSymbol
- 6241558 feat(radls): add textDocument/hover
- df4e1c1 feat(radls): add textDocument/references
- b977872 feat(radls): add textDocument/semanticTokens/full
- 8cb11d1 feat(radls): code actions surface diagnostic quick fixes
- 29446ba feat(radls): debounce diagnostics publishing per URI
- 8aaaeb9 feat(radls): filter internal builtins + parameter token for args
- cd70d46 feat(radls): immutable DocumentVersion snapshots per document
- 492c0dd feat(radls): introduce FileID indirection for documents
- 65a230e feat(radls): negotiate LSP position encoding via LineIndex
- 2e0b232 feat(radls): plumb context.Context and wire $/cancelRequest
- e4b2022 feat(radls): real completion - scope-walk + type-aware
- f9ee5c2 feat(radls): semantic tokens for type annotations
- b2ce132 feat(radls): structured docs in builtin hover + funcs doc infrastructure
- 7396532 feat(radls): textDocument/rename
- 4363b5c feat(types): add Dynamic (implicit any) distinct from explicit Any
- 640f213 feat(types): add ErrorType poison for static-check cascade prevention
- 35208d9 feat(types): add IsAssignableFrom to TypingT interface
- 80cfc24 feat(types): add Never bottom type for narrowing exhaustiveness
- b3dba6b feat(types): parens type groups + inline-colon lambdas + drop list[T]
- d4ade01 feat(typing): introduce TypingNullT for sound null literal handling
- a446ae8 feat: add get_pid() builtin
- dc047f6 feat: add signal_trap and signal_ignore builtins
- 5f80b7a feat: add to_json() builtin
- 05a233e feat: add weekday field to time maps
- 1834da2 feat: back pick() with radish instead of huh
- a2b47a3 feat: clean and navigate the rad docs corpus
- 8be4d28 feat: colorize the -i transcript and equivalent invocation
- 4c74002 feat: docs/funcs/ as source-of-truth for builtins + diagnostic sweep
- 841d4e2 feat: format the args block in rad fmt
- f3055f8 feat: interactive arg-entry mode (--interactive / -i)
- 8b35833 feat: make signal force-exit testable and shutdown deterministic
- 3a54604 feat: parse_duration accepts 'w' (weeks) suffix
- 6c3040d feat: readable -i transcripts and grouped bool multi-pick
- ed21d6e feat: replace huh with radish for input/confirm/multipick
- b4ad6b0 feat: run defer blocks on SIGINT/SIGTERM exit
- 475af15 feat: serve documentation from the binary via rad docs
- dae8dfa fix(benchmark): migrate off removed $! shell syntax
- 126df53 fix(check): accept string literals matching a StrEnum param
- 4b29812 fix(check): bind scopes only at function boundaries
- 8eadc6d fix(check): consult builtin set for cmd-callback resolution
- a928822 fix(check): deep divergence scan for branch joins
- dc7bc20 fix(check): give dynamic union arms bare-dynamic leniency in operators
- 35d6990 fix(check): isolate nested function bodies from outer narrowing
- 95890d8 fix(check): keep uncertain type mismatches non-blocking
- 957271a fix(check): narrowByTypeOf preserves null arm of Optional
- fca8db5 fix(check): null soundness in unions + promote bare-null mismatch
- 9d986d8 fix(check): stop false positives on valid scripts (#129-131, #133)
- fa4872f fix(check): structural union subsumption in joinFrames
- 57eb321 fix(check): switchDiverges read ExprTypes, don't re-enter synth
- cb769ac fix(check): while loop carries body frame mutations forward
- 7e9ca52 fix(check): widen while-loop narrowing on nested reassignments
- 12a4c7b fix(check, radls): name-precision DeclSpans for params/loop vars
- 39c90b6 fix(check, radls): point fn DeclSpan + SelectionRange at name
- d85f630 fix(radls): Mux.Notify - drop dead branch, omit nil params
- d3233ff fix(radls): correct inverted nil check in newError
- b62b89d fix(radls): debouncer race - superseded callback no longer clobbers successor
- 5a0fac0 fix(radls): dispatch quick fixes on error code, not message text
- d90a3de fix(radls): emit semantic token at fn name definition site
- a003530 fix(radls): file-scope completion respects cursor position
- d174a1e fix(radls): find references / goto-def from fn / args decl sites
- 9c587ee fix(...
v0.10.1
Changelog
- cd04129 feat(shell): auto-detect shell on Windows
v0.10.0
Changelog
- 5caffe8 ci: replace Dependabot with govulncheck for vulnerability scanning
- e454be5 feat: add 'transpose [expr]' directive to rad blocks
- fb6669b feat: add dim() text styling function
- ff29f1a feat: add shell autocompletion for rad CLI and scripts
- d8d6c03 feat: add strikethrough() text styling function
- b745339 feat: improve transpose behavior, support color modifies
- e7c7a30 fix: reject style attrs in rad block color modifiers
- 48da2ca style: fix up formatting
v0.9.2
Changelog
- 52791c9 feat: add end-to-end snapshot testing for radls
- 3aaff8f feat: add parse_date() built-in function
- 5840c0f fix: correctly capture defining scope in escaping closures
- a191108 fix: emit clean error when void value used in expression
- b7b910c fix: preserve float precision in alignment formatting
- c209834 fix: prevent cross-type map key collisions
- 8dd2a14 fix: produce clean error for null used as map key
- f633747 fix: return error when int() is called with Inf or NaN
- 8c59128 fix: support map in list for the in operator
- 9a05633 fix: support string comparison operators (< > <= >=)
- 3d80d0f fix: swap operands for list-in-list 'in' operator
- 47c1afe style: reformat code
v0.9.1
Changelog
- 212e690 Add llms.txt and llms-full.txt generation to docs site
- 5d82de7 Expand args docs with parsing model and edge cases
- 7205d79 Release VSCode extension v0.4.0
- 682c36c Release VSCode extension v0.5.0
- 9e1794e fix: use pipe delimiter in sed to avoid clash with URL slashes
- 3df330f refactor: rename lsp-server/ to radls/, update URLs to amterp.dev
v0.9.0
v0.9 is here!
Please note this version contains a higher number of breaking changes than usual.
I am trying to get them out of the way sooner rather than later, to minimize the overall pain.
I've done my best to make migrating really clear, including having error detection and clear messages that try and detect when you're doing something "the old ways".
See https://amterp.github.io/rad/migrations/v0.9/ for details about the breaking changes.
Changelog
- 4fa150c feat!: broaden ?? to null-coalesce, catchable null indexing
- 1ec9e5c feat!: make + operator strict about type matching
- 2a09c43 feat!: shorten parse_epoch unit parameter names
- 14a4b2c feat!: stop normalizing user data, add split_lines()
- 3d09b27 feat!: unify request/display into single rad keyword
- 18209b7 feat(funcs): make numeric functions type-preserving
- 52655ab feat: accept Enter as confirmation in confirm()
- 2a09807 feat: add "did you mean?" suggestions for undefined vars
- 4b6b4c4 feat: add 'rad explain list' to show available error codes
- f3c3ba8 feat: add --ast-tree and --cst-tree debug flags
- ec3185e feat: add CST-to-AST converter
- e2e06d4 feat: add Rust-style diagnostic renderer
- 322e9a2 feat: add TLS certificate verification bypass
- 338ffe3 feat: add call stack tracking and stack traces
- a7878a4 feat: add catch inline operator for error-only catching
- 5f4ee17 feat: add error testing framework and documentation
- 5d5a851 feat: add fill character and zero-pad to format specs
- 9b4d2e8 feat: add heuristics for ERROR node detection
- b33748f feat: add index_of() built-in for strings and lists
- 7372764 feat: add inline migration hint for + operator type error
- 539e566 feat: add limit param to split()
- cef9648 feat: add parse_duration and convert_duration functions
- 2f599d6 feat: add rad explain command for error documentation
- 790c615 feat: add semantic grammar checks for control flow
- f71e0dd feat: add source span tracking to RadValue
- 95ce0ff feat: add symbol table for tracking variable definitions
- a7225df feat: add trim_left and trim_right functions
- 7458ca7 feat: add unified diagnostic type system
- c518d3e feat: define AST node types, interfaces, and enums
- b7b95e2 feat: enable invocation logging by default
- 930212f feat: expand MISSING node messages with parent context
- 76983e2 feat: extract shared duration parser with day support
- 15e4995 feat: render markdown error docs with terminal styling
- 8861a11 feat: show [command] instead of [subcommand] in help
- c412221 feat: show per-severity diagnostic counts in check --from-logs
- 0f02eb1 fix!: align trim_prefix/trim_suffix semantics with their names
- 4c19a81 fix(deps): resolve Dependabot security alerts
- 3f514c9 fix: AST dump span padding now walks full tree
- e6ac0a1 fix: Levenshtein distance operates on bytes instead of runes
- 6837175 fix: TruthyFalsy crashes on RadError values
- bb9637d fix: add missing error codes to validation errors
- 3c4e5ad fix: bugs found in code review of AST foundation
- 1a97b79 fix: bump ra to v0.5.1
- 12c49b6 fix: clone target node in compound assign/incr-decr desugaring
- 21c218a fix: derive gutter width from displayed lines, not labels
- b245ca0 fix: diagnostic panics and lambda file name
- ea38df9 fix: diagnostic renderer byte-slices UTF-8 in truncation
- d7e964a fix: flaky truncate tests due to shared TerminalIsUtf8 state
- 902e00f fix: include response headers in http_* return value
- 3870211 fix: minor comment adjustments
- d81c49a fix: nil node panic in error emission functions
- 8f2dac0 fix: nil node safety and same-line label coloring
- f3d2a4c fix: panic on short non-JSON response body in RequestJson
- 39bed25 fix: preserve text attributes in trim, reverse, slice
- 66dcf7b fix: prevent hang on non-regular files like /dev/stdin
- 6093f5f fix: release notes workflow inserting into front matter
- 84382dc fix: remove invalid --latest flag from gh release view
- abce025 fix: shell catch nil pointer dereference
- 9f3dbb2 fix: split_lines strips trailing empty element
- a0af29c fix: string slicing now correctly handles multi-byte characters
- f62848d fix: truncate() now handles multi-byte characters correctly
- 27dc974 fix: unify equality semantics across == and Equals()
- da5efea fix: update go mod, add more details to AGENTS.md re: migrations
- 622026c fix: use pure Go DNS resolver for Linux static builds
- d082015 perf: fix IndexAt() to extract runes from segment directly
- 5fbaed2 perf: fix ToRuneList() O(nΒ²) complexity
- ea6c560 perf: short-circuit Plain() for single-segment strings
- 273beb2 perf: use strings.Builder in Plain() and Reverse()
- 3136be7 refactor: clarify diagnostic type hierarchy
- a258ce7 refactor: complete AST migration phases 5-8
- a0a26f3 refactor: migrate all errorf calls to new diagnostic system
- 14c797d refactor: migrate checker from CST to AST
- 9fcb675 refactor: migrate checker to AST, remove dead code
- 31eb894 refactor: migrate interpreter from CST to AST
- 531a112 refactor: migrate metadata extraction to AST
- 47acb87 refactor: move Span type from core/ to rts/rl/
- 7f93506 refactor: remove dead code from interpreter
- de5cdc7 refactor: remove unused SymbolTable, keep Levenshtein
- 2d3b92d refactor: seal CST from core/, add Children() to AST
- 0dc6c61 refactor: seal CST leaks from public interfaces
- 9ddc1bb refactor: simplify evalCatchingPanic, document error contract
- 7658ed3 refactor: unify dump tests into Go-based CST snapshot system
- ccb3bec refactor: unify error output to Rust-style format
- b820903 refactor: wire LSP to use AST-aware checker
- b8ed277 rename get_stash_dir to get_stash_path
- 162eb5a revert: remove RadValue span tracking (perf fix)
- 83a7ac9 style: minor adjustments
- 5328143 style: reformat
- 9f0e414 tests: improve snapshot failure diff output
- 9d57d24 tests: migrate common input->output assert tests to snapshot tests
v0.8.1
Changelog
- 6e0f4e9 fix: use pure Go DNS resolver for Linux static builds
v0.8.0
Changelog
- 7bbad61 feat!: remove get_default function in favor of ?? operator
- 79b0103 feat(docs): redesign website with "Sunset Terminal" theme
- 7350604 feat: add ?? fallback support for list and string indexing
- d13e6d7 feat: add list support to reverse function
- c8373a2 feat: hyphenate command names for CLI invocation
- 7c450bf fix: use workflow_run trigger for release notes workflow