github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/changelog/v3.0.md (about) 1 # v3.0 2 3 This is a major release that brings a significant number of changes and improvements, including a complete overhaul of the parser. Backwards compatibility is a high priority however these new features bring greater readability and consistency to shell scripting. So while the older syntax remains for compatibility, it is worth migrating over to the newer syntax for all new code being written 4 5 ### Breaking Changes 6 7 * Optional builtin removed: `bson`. This was disabled by default and likely never used. So it has been removed to reduce Murex's testing footprint. It can easily be re-added if anyone does actually use it 8 9 * Optional builtin removed: `coreutils`. This was actually enabled by default for Windows builds. However rewriting Linux/UNIX coreutils for Windows support is a massive project in its own right and with the maturity of WSL there's almost no reason to run Murex on "native Windows". So the `coreutils` builtin has been dropped to allow us to focus on the responsibilities of the shell 10 11 ### Features 12 13 * Support for expressions, eg `5 * 5` or `foobar = $foo + "bar"`, etc. This syntax can be used directly or specified specifically via the `expr` builtin 14 15 * New syntax sugar for creating JSON objects: `%{ foo: bar }` 16 17 * New syntax sugar for creating JSON arrays: `%[ foo bar ]` 18 19 * New syntax sugar for creating strings: `%()` (this is preferred over the, now deprecated, feature of parenthesis quotes) 20 21 * Ranges supported in `[]` (`@[` is now deprecated) 22 23 * Support for multiline comments: `/# comment #/`. It is unfortunate this differs from C-style comments (`/* comment */`) but this has to be the case because `/*` is ambiguous for barewords in shells: is it a path and glob or a comment? Where as `/#` isn't a common term due to `#` denoting a comment 24 25 * If any processes pass `null` as a data type across the pipe, it will be ignored. This solves the problem where functions that don't write to STDOUT would still define the data type 26 27 * Config option **auto-glob** renamed to **expand-glob**, and now enabled by default 28 29 * Globbing exclusion list. This allows you to avoid annoying prompts when parameters shouldn't be expanded as globs by the shell (eg when using regular expressions). This can be managed via **shell expand-glob-unsafe-commands** option in `config` 30 31 * `@g` removed. It is no longer needed with **expand-glob** enabled by default 32 33 * New builtin: `continue`: skip subsequent processes in an iteration block and continue to next iteration 34 35 * New builtin: `break`: exit out of a block of code (eg in an iteration loop) 36 37 * Additional syntax for _index_ (`[`): `*1`: 1st row, `*A`: 1st column 38 39 * New alias: `help` -> `murex-docs`. This brings Murex a little more inline with Bash et al 40 41 * **pre-cache-hint-summaries** now enabled by default after testing has demonstrated it doesn't have nearly as expensive footprint as first assumed 42 43 * Hitting **TAB** when nothing has been typed in the REPL will suggest past command lines 44 45 * `^` autocompletion added 46 47 * `getfile` writes to disk if STDOUT is a TTY 48 49 * **mkarray** (eg `ja`) now writes an integer array if range is integers. eg `ja: [1..3]`. This change wouldn't affect `a` since that outputs as list of strings (for streaming performance reasons) rather than a data type aware document 50 51 * `debug` (method) output tweaked 52 53 * Improved error messages in a number places 54 55 * Revamped README / website landing page 56 57 ### Non-User Facing / Maintenance Changes 58 59 * Minimum Go version supported is now 1.17.x 60 61 * Main parser completely rewritten 62 63 * `ReadArray` API now requires a `context.Context` 64 65 * `egrep` references changed to `grep -E` to work around GNU grep deprecating support for _egrep_ 66 67 * Added marshallers for `boolean`, `null` 68 69 * `Variables.GetValue()` now errors instead of returns `nil` when no variable set 70 71 * Additional tests. So many new tests added 72 73 * Lots of code refactoring 74 75 ### Bug Fixes 76 77 * `regexp` wasn't erroring if nothing was matched 78 79 * readline: fixed deadlock 80 81 * `append` and `prepend` now type aware (no longer converts all arrays into string arrays) 82 83 * `foreach` was setting variables as strings rather than honoring their original data type 84 85 * `yarn` autocompletion errors should be suppressed 86 87 * spellcheck missing `break` causing more occasionally incorrect instances of underlined words 88 89 * `config` wasn't passing data type when executing blocks via **eval** 90 91 * `debug` wasn't setting data type when used as a function 92 93 * macro variables don't re-prompt when the same variable is used multiple times 94 95 <hr> 96 97 Published: 31.12.2022 at 08:10 98 99 ## See Also 100 101 * [`[ ..Range ]`](../parser/range.md): 102 Outputs a ranged subset of data from STDIN 103 * [`a` (mkarray)](../commands/a.md): 104 A sophisticated yet simple way to build an array or list 105 * [`append`](../commands/append.md): 106 Add data to the end of an array 107 * [`break`](../commands/break.md): 108 Terminate execution of a block within your processes scope 109 * [`config`](../commands/config.md): 110 Query or define Murex runtime settings 111 * [`continue`](../commands/continue.md): 112 Terminate process of a block within a caller function 113 * [`expr`](../commands/expr.md): 114 Expressions: mathematical, string comparisons, logical operators 115 * [`foreach`](../commands/foreach.md): 116 Iterate through an array 117 * [`getfile`](../commands/getfile.md): 118 Makes a standard HTTP request and return the contents as Murex-aware data type for passing along Murex pipelines. 119 * [`ja` (mkarray)](../commands/ja.md): 120 A sophisticated yet simply way to build a JSON array 121 * [`murex-docs`](../commands/murex-docs.md): 122 Displays the man pages for Murex builtins 123 * [`prepend`](../commands/prepend.md): 124 Add data to the start of an array 125 * [`regexp`](../commands/regexp.md): 126 Regexp tools for arrays / lists of strings 127 * [index](../parser/item-index.md): 128 Outputs an element from an array, map or table 129 130 <hr/> 131 132 This document was generated from [gen/changelog/v3.0_doc.yaml](https://github.com/lmorg/murex/blob/master/gen/changelog/v3.0_doc.yaml).