Skip to main content

v5.0

Laurence MorganAbout 4 min

v5.0

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

Breaking Changes

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:

  • 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
  • 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)

Deprecation Warnings

These are changes to Murex defaults, however you shouldn't expect any breaking changes to Murex's behaviour:

  • $ARGV now preferred instead of $ARGS ($ARGS will remain supported for now)
  • command: parameters ... style syntax has been deprecated in favour of the more traditional command parameters ... (without a colon) syntax.

Features

Features marked as EXPERIMENTAL are provided without assurances of future breaking changes.

  • new website!!

  • commands can now be inlined in expressions, eg foobar = uptime() (issue 676open in new window)

  • commands can also be inlined into statements too, eg echo uptime() (issue 676open in new window)

  • new event onSignalReceived for catching OS signals

  • new builtin signal for sending OS signals

  • new builtins which (issue 609open in new window)

  • new builtin type (issue 609open in new window)

  • cd defaults to ~ if now parameters are passed (issue 672open in new window)

  • cd - changes to previous directory (issue 672open in new window)

  • $SELF.Interactive value to detect if scope is running in an interactive shell (issue 685open in new window)

  • $COLUMNS reserved variable to output width of terminal

  • $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)

  • 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)

  • csv data type and select builtin now support converting maps (eg JSON objects) into tables (issue 689open in new window)

  • murex-doc / help can now display a greater number of documents when offline

  • improved man page parsing

  • improved man page displays in preview

  • alias now stores FileRef metadata (issue 124open in new window)

  • packages can now be removed via murex-package remove (issue 687open in new window)

  • a package creation wizard has been added via murex-package new

  • 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

  • version constraints added to Murex packages (docs to follow)

  • readline: up and down arrows on a partial command line will cycle through history of only lines that contain your partial command line

  • readline: new hotkey, ctrl+z while readline is open will undo the previous key strokes

  • EXPERIMENTAL: logical operators added to expressions: || and && (issue 708open in new window)

  • 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)

  • EXPERIMENTAL: Various builtins that require variable names now support $ sigils, eg foreach $var { ... } works as well as foreach var { ... }

  • EXPERIMENTAL: new variable group $MOD, like $GLOBAL but scoped to the module level

  • EXPERIMENTAL: new command pipe to create variable based on that command's FID and PID: <fid:VAR_NAME> and <pid:VAR_NAME> respectively

  • 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

Bug Fixes

  • homebrew environment set on Intel macOS systems (previous only worked on ARM)
  • config functions (eg hint-text-func) now execute with the FileRef of the setter. Meaning they can call privates correctly
  • scalars fail expression pre-parser (issue 674open in new window)
  • readline: prompt can now span multiple lines (issue 612open in new window)
  • floating point numbers were not loosely compared correctly in expressions
  • readline: delay timer hint text should disappear when completed
  • $PWDHIST was corrupting upon first update
  • fixed bug with git-commit man page parsing, which caused the parser to hang and ramp up CPU usage on git autocompletions
  • fixed parsing of nested quotes inside curly braces (issue 697open in new window)
  • don't carry non-zero exit numbers forward if unit test successful
  • fixed instances where FileRef either wasn't being set, wasn't being set correctly, or was missing a timestamp (issue 696open in new window)
  • printf dependency removed from aliases function -- this means aliases now works on Windows too
  • removed lazy variable expansion from hint text (issue 663open in new window)
  • || and && now parse correctly in expressions

Special Thanks

Special thank yous for this release goes to the following contributors:

  • orefaloopen in new window for building the new website (which is now small task!), documentation fixes, and general support
  • tiymatopen in new window for the high quality bug reports and beta testing
  • 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

You rock!


Published: 07.09.2023 at 00:12

See Also


This document was generated from gen/changelog/v5.0_doc.yamlopen in new window.

Last update:
Contributors: Laurence Morgan