Skip to content

9.0.0: Release 9.0 (#1483)

Latest

Choose a tag to compare

@rocky rocky released this 29 Aug 00:39
· 40 commits to master since this release
5aaf5e5

Added support for Python 3.13. Dropped support for Python 3.8 and 3.9.

Note: There are incompatible changes. Use with Mathics-scanner 2.0.0 or greater.

You may notice a speedup in performance, especially graphics performance, in this version. There is a speedup due to removing conversions from Mathics3 to Python and vice versa for literal data, which happens a lot in plotting graphics. Also, Python 3.13 is a bit faster than previous versions. Previously, rendering via asymptote was slow. This is no longer the situation.

Preliminary work to track locations has started. This is useful in debugging and error reporting, and is controlled via Boolean System variable $TrackLocations.

Boxing operators have been added. The full range of escape sequences is supported. A limited form of boxing escape \* that handles a single Boxing function has been added.

A basic interrupt handler was added that loosely follows wolframscript's interrupt handler. Interrupt commands "abort", "exit", "continue", "debugger", "show", and "inspect" are available; "trace" will be added later.

main.py has been moved to __main__.py following Python conventions for main routines. This makes python -m mathics work. GNU Readline history is enabled for mathics when it is available. It shares history files with mathicsscript.

The priority for rule selection when there are several matching a function call has been revised and more closely follows WMA behavior.

Assignment statements, e.g. SetDelayed, UpSetDelayed, or DownSetDelayed have been revised to isolate left-hand-side references from conditions and element attributes. As a result, more of the code in WMA and Mathics3 packages work.

$IterationLimit detects runaway rule expansion better.

Parameter count checking expanded to more Builtin functions.

New Builtins

  • $SessionID
  • $TrackLocations (not WMA)
  • BinaryReadList[] (needed to support importing gzip files)
  • Hypergeometric2F1

By Aravindh Krishnamoorthy (needed for better Rubi support):

  • Hypergeometric1F1[]
  • HypergeometricPFQ[]
  • MeijerG[]
  • HypergeometricU[]

Documentation

Go over docs for Beta[], Gamma[], Product[], and infix operators with no meaning.
Expand Transpose[] documentation.

Enhancements

  • Set-related code reworked for better WMA conformance. There is better WMA conformance in rule selection when several rules match.
  • mathics CLI options are more like wolframscript
  • The debugging interface has been improved. TraceEvaluation[] and TraceDebug[] filter and colorize output for Mathics3 constructs much better.
  • Single-dash long options like -help, -file are now accepted. Short option -f is associated with -file rather than --fullform; -F is is now used for
    FullForm. Option --read with alias -r is now -code and short option -c.
  • Boolean Options ShowRewrites and ShowEvaluation were added to TraceEvalation[]. These filtering for either rewrite rules or evaluation expressions. Presumably, you don't want to filter both.
  • We check argument counts on more Builtin Functions and give error messages (tags argb, argx, argr, argrx) for invalid parameter combinations.
  • $TraceBuiltins output uses standard Mathics3 I/O mechanisms rather than Python's builtin print. Therefore it will be seen in more front-ends like Django or pyoxide.

Bugs Fixed

  • #1057 ListPlot[] error handling (and NestList[]) needs going over
  • #1213 Condition[] expressions as second element in RuleDelayed behaviour not compatible with WMA
  • #1187 Add Hypergeometric2F1 Builtin Function
  • #1198 Blanks in Set operations are not properly handled in tag positions.
  • #1245 Add "lpn" error message checking in _ListPlot
  • #1383 Support for hypergeometric functions
  • #1384 Option management tweaks
  • #1388 In WMA, Pochhammer[0,-2] returns 1/2
  • #1395 Match WMA for Gamma[1+x] and Product[...]
  • #1405 structure_cache in mathics.core.expression.structure is None but we try to set it in _is_neutral_symbol()
  • #1412 Transpose[] does not work on three-dimensional array
  • #1425 `Erroneous Protected message in SetDelayed
  • #1432 URL links with $ in them are getting messed up
  • #1461 "noopen" errors sometimes return $Failed
  • #1465 Crash in running Trace[Sin[Log[2.5, 7]]]
  • #1473 Doctest for Quantity, KnownUnitQ, and others fail when the documentation is generated
  • #1474 Document typo: "is a valid Association object" should be "is a valid Quantity object"
  • #1476 $IterationLimit is not limiting evalation expansion

WMA Compatibility

  • Hypergeometric functions have been revised to conform better to WMA behavior by expanding hypergeometric results.
  • $IterationLimit now defaults to 4096.
  • mathics command-line conform better to wolframscript options.
  • Rule selection of functions when multiple rules apply conforms to WMA more closely.
  • LHS reference selection conforms to WMA more closely.

Incompatible changes

Scanner API has changed. Options on mathics CLI have changed. See above for the changes.
Location of mathics in mathics.__main__, the more usual location, rather than mathics.main.

  • Mathics scanner exceptions of class TranslateError are incompatible
    with previous versions, and now store error parameters, "name", "tag", and
    "args".
  • The method get_sort_key() was replaced by two different properties:
    element_order, for canonical ordering of expressions, and
    pattern_precedence, used for ordering rules according to their precedence
    in the evaluation loop.
  • In both cases, the part of the sort key related to properties of the
    expressions and patterns are now stored as a magic number instead of
    a tuple.