github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/changelog/v5.0.md (about)

     1  # v5.0
     2  
     3  v5.0 is a massive release. It brings along changes to syntax, new operators as well as new builtins, reserved variables and a new event
     4  
     5  ## Breaking Changes
     6  
     7  Murex tries to retain backwards compatibility wherever possible. However sometimes changes need to be made to keep the language, shell and general usability moving forwards. The following are a list of such changes:
     8  
     9  * unquoted parameters that are formatted like `[alpha, numeric, underscore]\(...\)` will be parsed as a function rather than a string. eg `command foo(bar baz)` where **foo** will be treated as a subshell function with **bar baz** as its parameters. Solution is simply to put that parameter inside quotation marks instead of leaving it as a bareword parameter
    10  * brace quotes without a leading `%` will be first parsed as an expression. eg `%(valid string)` vs `(valid expression)` which might cause unexpected results in edge cases where a `(string)` is also a valid expression. Please update `(strings)` to include `%`, eg `%(string)`
    11  
    12  ## Deprecation Warnings
    13  
    14  These are changes to Murex defaults, however you shouldn't expect any breaking changes to Murex's behaviour:
    15  
    16  * `$ARGV` now preferred instead of `$ARGS` (`$ARGS` will remain supported for now)
    17  * `command: parameters ...` style syntax has been deprecated in favour of the more traditional `command parameters ...` (without a colon) syntax. 
    18  
    19  ## Features
    20  
    21  Features marked as **EXPERIMENTAL** are provided without assurances of future breaking changes.
    22  
    23  * new website!!
    24  * commands can now be inlined in expressions, eg `foobar = uptime()` ([issue 676](https://github.com/lmorg/murex/issues/676))
    25  * commands can also be inlined into statements too, eg `echo uptime()` ([issue 676](https://github.com/lmorg/murex/issues/676))
    26  
    27  * new event `onSignalReceived` for catching OS signals
    28  * new builtin `signal` for sending OS signals
    29  * new builtins `which` ([issue 609](https://github.com/lmorg/murex/issues/609))
    30  * new builtin `type` ([issue 609](https://github.com/lmorg/murex/issues/609))
    31  * `cd` defaults to `~` if now parameters are passed ([issue 672](https://github.com/lmorg/murex/issues/672))
    32  * `cd -` changes to previous directory ([issue 672](https://github.com/lmorg/murex/issues/672))
    33  * `$SELF.Interactive` value to detect if scope is running in an interactive shell ([issue 685](https://github.com/lmorg/murex/issues/685))
    34  * `$COLUMNS` reserved variable to output width of terminal
    35  * `$MUREX_ARGV` reserved variable to output command line parameters of Murex shell (not to be confused with the parameters of the running function, eg `$ARGV`)
    36  * `format` from a table (eg `csv`) to `json` or `yaml` will now return a map instead of an array of arrays (use `jsonl` (jsonlines) if you need to retain a 2D array of data in JSON-like format)
    37  * `csv` data type and `select` builtin now support converting maps (eg JSON objects) into tables ([issue 689](https://github.com/lmorg/murex/issues/689))
    38  * `murex-doc` / `help` can now display a greater number of documents when offline
    39  * improved man page parsing
    40  * improved man page displays in preview
    41  * `alias` now stores `FileRef` metadata ([issue 124](https://github.com/lmorg/murex/issues/124))
    42  * packages can now be removed via `murex-package remove` ([issue 687](https://github.com/lmorg/murex/issues/687))
    43  * a package creation wizard has been added via `murex-package new`
    44  * another new flag for `murex-package`: **git**. Which allows you to run `git` commands on a package even when you're not in that package's working directory
    45  * version constraints added to Murex packages (docs to follow)
    46  * readline: `up` and `down` arrows on a partial command line will cycle through history of only lines that contain your partial command line
    47  * readline: new hotkey, `ctrl`+`z` while readline is open will undo the previous key strokes
    48  * EXPERIMENTAL: logical operators added to expressions: `||` and `&&` ([issue 708](https://github.com/lmorg/murex/issues/708))
    49  * EXPERIMENTAL: new assignment operator `:=`, assigns a value but retains the former data type, thus converting the value when required (ideally I'd have preferred this as default option but it ran the risk of some serious and unexpected breaking changes to the behaviour of some existing shell scripts)
    50  * EXPERIMENTAL: Various builtins that require variable names now support `$` sigils, eg `foreach $var { ... }` works as well as `foreach var { ... }`
    51  * EXPERIMENTAL: new variable group `$MOD`, like `$GLOBAL` but scoped to the module level
    52  * EXPERIMENTAL: new command pipe to create variable based on that command's FID and PID: `<fid:VAR_NAME>` and `<pid:VAR_NAME>` respectively
    53  * EXPERIMENTAL: official support added for a pure Go library for sqlite3 -- thus saving individuals from having to install `gcc` as well as `go` compilers. The reduced `cgo` footprint has already reduced file sizes by a 3rd
    54  
    55  ## Bug Fixes
    56  
    57  * homebrew environment set on Intel macOS systems (previous only worked on ARM)
    58  * `config` functions (eg `hint-text-func`) now execute with the `FileRef` of the setter. Meaning they can call privates correctly
    59  * scalars fail expression pre-parser ([issue 674](https://github.com/lmorg/murex/issues/674))
    60  * readline: prompt can now span multiple lines ([issue 612](https://github.com/lmorg/murex/issues/612))
    61  * floating point numbers were not loosely compared correctly in expressions
    62  * readline: delay timer hint text should disappear when completed
    63  * `$PWDHIST` was corrupting upon first update
    64  * fixed bug with `git-commit` man page parsing, which caused the parser to hang and ramp up CPU usage on `git` autocompletions
    65  * fixed parsing of nested quotes inside curly braces ([issue 697](https://github.com/lmorg/murex/issues/697))
    66  * don't carry non-zero exit numbers forward if unit test successful
    67  * fixed instances where `FileRef` either wasn't being set, wasn't being set correctly, or was missing a timestamp ([issue 696](https://github.com/lmorg/murex/issues/696))
    68  * `printf` dependency removed from `aliases` function -- this means `aliases` now works on Windows too
    69  * removed lazy variable expansion from hint text ([issue 663](https://github.com/lmorg/murex/issues/663))
    70  * `||` and `&&` now parse correctly in expressions
    71  
    72  ## Special Thanks
    73  
    74  Special thank yous for this release goes to the following contributors:
    75  
    76  * [orefalo](https://github.com/orefalo) for building the new website (which is now small task!), documentation fixes, and general support
    77  * [tiymat](https://github.com/tiymat) for the high quality bug reports and beta testing
    78  * All the downstream package maintainers, who publish Murex to their preferred operating systems/package managers thus making it easier for a wider audience to install and update Murex
    79  
    80  You rock!
    81  
    82  <hr>
    83  
    84  Published: 07.09.2023 at 00:12
    85  
    86  ## See Also
    87  
    88  * [FileRef](../user-guide/fileref.md):
    89    How to track what code was loaded and from where
    90  * [Modules and Packages](../user-guide/modules.md):
    91    An introduction to Murex modules and packages
    92  * [`ARGV` (json)](../variables/argv.md):
    93    Array of the command name and parameters within a given scope
    94  * [`COLUMNS` (int)](../variables/columns.md):
    95    Character width of terminal
    96  * [`MUREX_ARGV` (json)](../variables/murex_argv.md):
    97    Array of the command name and parameters passed to the current shell
    98  * [`SELF` (json)](../variables/self.md):
    99    Meta information about the running scope.
   100  * [`alias`](../commands/alias.md):
   101    Create an alias for a command
   102  * [`autocomplete`](../commands/autocomplete.md):
   103    Set definitions for tab-completion in the command line
   104  * [`config`](../commands/config.md):
   105    Query or define Murex runtime settings
   106  * [`csv`](../types/csv.md):
   107    CSV files (and other character delimited tables)
   108  * [`event`](../commands/event.md):
   109    Event driven programming for shell scripts
   110  * [`float` (floating point number)](../types/float.md):
   111    Floating point number (primitive)
   112  * [`murex-docs`](../commands/murex-docs.md):
   113    Displays the man pages for Murex builtins
   114  * [`murex-package`](../commands/murex-package.md):
   115    Murex's package manager
   116  * [`onSignalReceived`](../events/onsignalreceived.md):
   117    Trap OS signals
   118  * [`signal`](../commands/signal.md):
   119    Sends a signal RPC
   120  * [`which`](../commands/which.md):
   121    Locate command origin
   122  
   123  <hr/>
   124  
   125  This document was generated from [gen/changelog/v5.0_doc.yaml](https://github.com/lmorg/murex/blob/master/gen/changelog/v5.0_doc.yaml).