Skip to content

Commit 1d5e8a2

Browse files
committed
Mathics->Mathics3 and...
mathics.core.expression: revise a docstring
1 parent 0631c5f commit 1d5e8a2

6 files changed

Lines changed: 69 additions & 105 deletions

File tree

CHANGES.rst

Lines changed: 47 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,50 @@
55
10.0.0
66
======
77

8-
Some foundational work on overhauling plotting with NumPy vectors was started. Alas, work on it was not complete by release time, so this could not be finished. Expect a future release to have revamped graphics.
8+
Some foundational work done to overhaul plotting using vectors with NumPy was started. Alas, work on it was not complete by release time to have finished this. Expect a future release to have revamped graphics.
99

10-
A major revision of Form handling and character encoding ``$CharacterEncoding`` was started with a focus on ``TeXForm``, ``MLForm``, and ``OutputForm``.
11-
12-
Notes:
13-
14-
#. There are incompatible changes. Use with Mathics-scanner 10.0.0 or greater.
15-
#. We are in the process of renaming ``Mathics`` to ``Mathics3``. You will notice a new Mathics3 logo in the documentation. ``Mathics`` was monolithic Python 2-ish code. Mathics3 has rewritten a number of major subcomponents and split off a number of subcomponents. There are still several that need to be revised or rewritten. The name change reflects this distinction between the two efforts, and emphasizes that ``Mathics3`` uses modern Python 3 idioms. While right now the repository name and import refer to ``mathics``, several repositories that use the Mathics3 core, or that Mathics3 uses, have been renamed. In particular, ``Mathics_Scanner`` is now ``Mathics3_Scanner``.
10+
Note: There are incompatible changes. Use with Mathics-scanner 10.0.0 or greater.
1611

1712

1813
New Builtins
1914
------------
2015

2116
#. ``$Language`` variable
2217
#. ``ArcBox`` boxing function
23-
#. ``Csch`` function `PR #1768 <https://github.com/Mathics3/mathics-core/pull/1768>`_
18+
#. ``Csch`` function [PR # #1768]
2419
#. ``JSON`Import`JSONImport``
2520
#. ``RasterBox`` boxing function
26-
#. ``Format``
27-
#. ``FormBox``, and ``RoundBox`` boxing functions
21+
#. ``RoundBox`` boxing function
2822
#. ``ShowSpecialCharacters`` option
2923
#. ``ShowStringCharacters`` option
3024

3125

3226
Enhancements
3327
------------
3428

35-
#. Many Builtin functions now report argument-mismatch errors
36-
#. ``Trig`` option added to ``Numerator`` and ``Denominator``
37-
#. ``CharacterEncoding``, and ``Path`` options option added to ``Get``
38-
#. ``PowerMod`` and ``Quotient`` handle the 3-argument form, roots of exponents (``PowerMod``) lists of exponents, and numbers other than Integers.
39-
#. ``N[integer, MachinePrecision]`` added
40-
#. ``PrintPrecision`` for ``N[integer]`` matches WMA; so does largest mantissa before converting to MachinePrecision Integer (for display) matches WMA.
41-
#. ``BeginPackage`` with ``Needs`` parameter added. This should allow more packages to load properly
42-
#. ``Expand`` works with relations
43-
29+
* Many Builtin functions now report argument mismatch errors
30+
* ``Trig`` option added to ``Numerator`` and ``Denominator``
4431

4532
Bugs Fixed
4633
----------
4734

48-
#. `PR #1762 <https://github.com/Mathics3/mathics-core/pull/1762>`_ Fix Rayleigh expansion rules to only match half-integer orders. (Chenxin Zhong)
49-
#. `#1741 <https://github.com/Mathics3/mathics-core/issues/1741>`_ Implement ``MachinePrecision`` option for large numbers that fall outside of Python's builtin ``float`` mantissa
50-
#. `#1740 <https://github.com/Mathics3/mathics-core/issues/1740>`_ ``N[3^200]`` in formats as ``PrecisionReal`` instead of ``MachinePrecision``
51-
#. `#1723 <https://github.com/Mathics3/mathics-core/issues/1723>`_ ``DiscretePlot`` gives wrong results nested function in ``First`` or ``Last``
52-
#. `#1713 <https://github.com/Mathics3/mathics-core/issues/1713>`_ ``?`` *symbol* and ``??`` *symbol* should be parsed as ``Information["symbol"]`` and ``Information["symbol"#. #1699 Character sequences used for string representation of boxes should be treated as single characters in string character-wise manipulation operations.
53-
#. `#1692 <https://github.com/Mathics3/mathics-core/issues/1692>`_ ``Map`` does not automatically map a function over ``Association`` values (vasdommes)
54-
#. `#1639 <https://github.com/Mathics3/mathics-core/issues/1639>`_ Map does not automatically map a function over Association values
55-
#. `#1519 <https://github.com/Mathics3/mathics-core/issues/1519>`_ ``Order`` for Numerics, e.g. ``Order[1.0, 1] == -1``, but is 0
56-
#. `#1492 <https://github.com/Mathics3/mathics-core/issues/1492>`_ ``UpSet`` not giving a "Tag Integer is Protected." message
57-
#. `#1487 <https://github.com/Mathics3/mathics-core/issues/1487>`_ ``FindMinimum``, ``FindMaximim`` do not give approximate results when ``$IterationLimit`` has been exceeded and convergence fails
58-
#. `#1481 <https://github.com/Mathics3/mathics-core/issues/1481>`_ $TraceBuiltins=False does not work after more than one $TraceBuiltins=True use.
59-
#. Reset ``evaluation.iteration__count`` on each new evaluation. This caused problems in long-running sessions, such as the Mathics3-django gallery examples.
60-
61-
62-
Command-line Utilities
63-
----------------------
35+
#. PR #1762 Fix Rayleigh expansion rules to only match half-integer orders. (Chenxin Zhong)
36+
#. #1741 Implement ``MachinePrecision`` option for large numbers that fall outside of Python's builtin ``float`` mantissa
37+
#. #1740 ``N[3^200]`` in formats as ``PrecisionReal`` instead of ``MachinePrecision``
38+
#. #1723 ``DiscretePlot`` gives wrong results nested function in ``First`` or ``Last``
39+
#. #1713 ``?`` *symbol* and ``??`` *symbol* should be parsed as ``Information["symbol"]`` and ``Information["symbol"#. #1699 Character sequences used for string representation of boxes should be treated as single characters in string character-wise manipulation operations.
40+
#. #1692 ``Map`` does not automatically map a function over ``Association`` values (vasdommes)
41+
#. #1639 Map does not automatically map a function over Association values
42+
#. #1519 ``Order`` for Numerics, e.g. ``Order[1.0, 1] == -1``, but is 0
43+
#. #1492 ``UpSet`` not giving a "Tag Integer is Protected." message
44+
#. #1487 ``FindMinimum``, ``FindMaximim`` do not give approximate results when ``$IterationLimit`` has been exceeded and convergence fails
45+
#. #1481 $TraceBuiltins=False does not work after more than one $TraceBuiltins=True use.
46+
47+
48+
Command-line Utilites
49+
---------------------
6450

65-
Command-line program ``mathics`` was renamed to ``mathics3``; the old name will be available for a while. This apparently facilitates ``uv`` packaging.
51+
Command-line program ``mathics`` was renamed to ``mathics3``; the old name will be available for a while. This appearently facilitates uv packaging.
6652

6753
Command-line program ``mathics3-code-parse`` was added to show how expressions are parsed. This is roughly analogous to the ``CodeParse`` function of the ``CodeParser`` WMA package.
6854

@@ -71,29 +57,30 @@ Internals
7157

7258
* A major revision and reorganization was begun to improve Form handling, leading to the new modules ``mathics.forms.format`` and ``mathics.forms.render``. Existing render functions from ``mathics.format`` have been moved under ``mathics.form.render``. (mmatera)
7359
Corrections were made to variables ``$PrintForms`` and ``$OutputForms``. (mmatera)
74-
* Primitive datatype ``NumericArray``, which is essentially a NumPy array, was added to support vector operations, such as plotting. (Bruce Lucas) In support of this, the module ``mathics.core.atoms`` was split up.
60+
* A major revision and reorganization was begun to improve Boxing.
61+
Corrections were made to variables ``$PrintForms`` and ``$OutputForms``.
62+
* Primitive datatype ``NumericArray``, which is essentially a NumPy array was added to support vector operations, such as plotting. (Bruce Lucas) In support of this the module ``mathics.core.atoms`` was split up.
7563
* Internals for handling Graphics have been revised to be able to accept a more complete list.
76-
* Parsing now uses more data from YAML tables instead of hard-coding values inside code.
77-
* Revise representation for ``Complex`` Numbers; both the real and imaginary parts can now be arbitrary non-complex Real numbers. The precision, a derived value, is also saved.
64+
* Parsing now uses more data from YAML tables insead of hard-coding values inside code.
65+
* Revise representation for ``Complex`` Numbers; both the real and imaginary parts can now be arbitrary non-complex Real numbers. The precsion, a derived value, is also saved.
7866
* Numerous internal changes were made to improve performance.
7967
* ``mpmath`` is used to store large integer mantissas in ``N[x_Integer]``.
8068
* Token names were changed to align better with the names reported in ``CodeParser`Tokenize``. Note however Mathics3 parsing is a bit different from ``CodeParser`Parse``.
8169

8270
Package updates
8371
---------------
8472

85-
#. Python 3.14 supported. Support for Python 3.10 dropped; it may still work, but is not supported.
8673
#. Sympy 1.14 supported
87-
#. llvm 18+ now supported
74+
#. llvm 15+ now supported
8875

8976
API incompatibility
9077
-------------------
9178

9279
* Front ends must now issue an explicit call to
93-
``import_and_load_builtins()``. Previously, this was handled simply by
80+
``import_and_load_builtins()``. Previously this was handled simpy by
9481
``import`` of ``MathicsSession``. Loading modules loaded via
9582
``import`` was unpredictable in how and when things got loaded. The
96-
change was made to address this and to be able to give more
83+
change was make do address this and to be able to give more
9784
flexibility in loading.
9885
* Token names have changed to align better with ``CodeParser`CodeTokenize``
9986

@@ -112,11 +99,11 @@ which happens a lot in plotting graphics. Also, Python 3.13 is a bit
11299
faster than previous versions. Previously, rendering via ``asymptote`` was
113100
slow. This is no longer the situation.
114101

115-
Preliminary work to track locations has started. This is useful in debugging and error reporting, and is controlled via the Boolean System variable ``$TrackLocations``.
102+
Preliminary work to track locations has started. This is useful in debugging and error reporting, and is controlled via Boolean System variable ``$TrackLocations``.
116103

117104
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.
118105

119-
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.
106+
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.
120107

121108
``main.py`` has been moved to ``__main__.py`` following Python conventions for main routines. This makes ``python -m mathics`` work.
122109
GNU Readline history is enabled for ``mathics`` when it is available. It shares history files with ``mathicsscript``.
@@ -161,13 +148,13 @@ Enhancements
161148
------------
162149

163150
#. Set-related code reworked for better WMA conformance. There is better WMA conformance in rule selection when several rules match.
164-
#. ``mathics`` CLI options are more like WolframScript
151+
#. ``mathics`` CLI options are more like wolframscript
165152
#. The debugging interface has been improved. ``TraceEvaluation[]`` and ``TraceDebug[]`` filter and colorize output for Mathics3 constructs much better. Single-dash long options like
166-
``-help``, ``-file`` are now accepted. Short option ``-f`` is associated with ``-file`` rather than ``--fullform``; ``-F`` is now used for
153+
``-help``, ``-file`` are now accepted. Short option ``-f`` is associated with ``-file`` rather than ``--fullform``; ``-F`` is is now used for
167154
``FullForm``. Option ``--read`` with alias ``-r`` is now ``-code`` and short option ``-c``.
168-
#. Boolean Options ``ShowRewrites`` and ``ShowEvaluation`` were added to ``TraceEvalation[]``. These filter either rewrite rules or evaluation expressions. Presumably, you don't want to filter both.
169-
#. We check argument counts on more built-in functions and give error messages (tags ``argb``, ``argx``, ``argr``, ``argrx``) for invalid parameter combinations.
170-
#. ``$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.
155+
#. 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.
156+
#. We check argument counts on more Builtin Functions and give error messages (tags ``argb``, ``argx``, ``argr``, ``argrx``) for invalid parameter combinations.
157+
#. ``$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.
171158

172159
Bugs Fixed
173160
----------
@@ -176,13 +163,13 @@ Bugs Fixed
176163
#. #1213 ``Condition[]`` expressions as second element in ``RuleDelayed`` behaviour not compatible with WMA
177164
#. #1187 Add ``Hypergeometric2F1`` Builtin Function
178165
#. #1198 Blanks in ``Set`` operations are not properly handled in tag positions.
179-
#. #1245 Add "lpn" error message checking in _ListPlot.
180-
#. #1383 Support for hypergeometric functions.
181-
#. #1384 Option management tweaks.
166+
#. #1245 Add "lpn" error message checking in _ListPlot
167+
#. #1383 Support for hypergeometric functions
168+
#. #1384 Option management tweaks
182169
#. #1388 In WMA, ``Pochhammer[0,-2]`` returns 1/2
183170
#. #1395 Match WMA for ``Gamma[1+x]`` and ``Product[...]``
184171
#. #1405 structure_cache in ``mathics.core.expression.structure`` is ``None`` but we try to set it in ``_is_neutral_symbol()``
185-
#. #1412 ``Transpose[]`` does not work on three-dimensional array.
172+
#. #1412 ``Transpose[]`` does not work on three-dimensional array
186173
#. #1425 `Erroneous Protected message in SetDelayed
187174
#. #1432 URL links with $ in them are getting messed up
188175
#. #1461 "noopen" errors sometimes return ``$Failed``
@@ -472,23 +459,23 @@ Internals
472459
---------
473460

474461
* ``eval_abs`` and ``eval_sign`` extracted from ``Abs`` and ``Sign`` and added to ``mathics.eval.arithmetic``.
475-
* The maximum number of digits allowed in a string is set to 7000 and can be adjusted using an environment variable
462+
* Maximum number of digits allowed in a string set to 7000 and can be adjusted using environment variable
476463
``MATHICS_MAX_STR_DIGITS`` on Python versions that don't adjust automatically (like pyston).
477-
* Real number comparisons implemented now use the internal implementation of ``RealSign``.
464+
* Real number comparisons implemented is based now in the internal implementation of ``RealSign``.
478465
* For Python 3.11, the variable ``$MaxLengthIntStringConversion`` controls the maximum size of
479466
the literal conversion between large integers and Strings.
480467
* Older style non-appearing and non-pedagogical doctests have been converted to pytest
481468
* Built-in code is directed explicitly rather than implicitly. This facilitates the ability to lazy load
482469
builtins or "autoload" them a la GNU Emacs autoload.
483470
* Add mpmath LRU cache
484-
* Some work was done to make it possible so that in the future, we can speed up initial loading and reduce the initial memory footprint
471+
* Some work was done to make it possible so that in the future we can speed up initial loading and reduce the initial memory footprint
485472

486473

487474
Bugs Fixed
488475
----------
489476

490477
* ``Definitions`` is compatible with ``pickle``.
491-
* Improved support for ``Quantity`` expressions, including conversions, formatting, and arithmetic operations.
478+
* Improved support for ``Quantity`` expressions, including conversions, formatting and arithmetic operations.
492479
* ``Background`` option for ``Graphics`` and ``Graphics3D`` is operative again.
493480
* Numeric comparisons against expressions involving ``String``; Issue #797)
494481
* ``Switch[]`` involving ``Infinity``. Issue #956
@@ -506,7 +493,7 @@ API
506493
We now require an explicit call to a new function
507494
``import_and_load_builtins()``. Previously, loading was implicit and
508495
indeterminate as to when this occurred, as it was based on import
509-
order. We need this so that we can add support in the future for lazy-loading built-in modules.
496+
order. We need this so that we can add support in the future for lazy loading built-in modules.
510497

511498
Package updates
512499
---------------
@@ -1524,7 +1511,7 @@ Other changes
15241511
#. blacken (format) a number of Python files and remove blanks at the end of lines
15251512
#. Adding several CI tests
15261513
#. Remove various deprecation warnings
1527-
#. Change ``#!`` from ``python`` to ``python3``
1514+
#. Change shbang from ``python`` to ``python3``
15281515
#. Update docs
15291516

15301517
Backward incompatibilities

FUTURE.rst

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
11
*One can always dream...*
22

3-
2026-2027 Roadmap
3+
2025-2026 Roadmap
44
=================
55

6-
7-
2026 Achievements
8-
-----------------
9-
10-
Support Python 3.14 and Poetry packaging.
11-
12-
Major foundational work was done in revising Form and ``MakeBox`` handling.
13-
14-
How Mathics3 handles ``CharacterEncoding`` was revised.
15-
16-
Introduction of NumPy vectors using ``NumericArray`` was started. Some foundational work was done to revise Plotting and speed it up using vectorization.
17-
18-
196
2025 Achievements
207
-----------------
218

@@ -32,33 +19,22 @@ Some preliminary debugging support was added. Position information is starting t
3219
Upcoming work
3320
-------------
3421

35-
Support for NumPy Vectors and Arrays
36-
++++++++++++++++++++++++++++++++++++
37-
38-
While ``NumericArray`` exists as atomic element, it is not accessible as a user function. Evaluation routines for built-in function needs to be expanded to accomodate ``NumericArray`` type. (Bruce Lucas)
39-
40-
Compilation
41-
+++++++++++
42-
43-
A Compiler for pure functions to SymPy expressions was started to speed up Plotting. (Bruce Lucas).
44-
45-
This needs to be expanded to handle Mathics3 evaluation routines that do not have exact SymPy functions. The compiler also needs to be expanded to handle introduction of variables and procedural or statement kinds of expressions.
46-
22+
MakeBoxes
23+
++++++++++
4724

48-
More Forms and MakeBoxes
49-
++++++++++++++++++++++++
25+
We hope to improve conformance of ``MakeBoxes`` and this will:
5026

51-
* Implement ``DisplayForm``, ``ScientificForm``, ``EngineeringForm``, and ``DecimalForm``
52-
* Improve``TraditionalForm``
5327
* Improve conformance to WMA for expressions such as polynomial expressions
28+
* Make 2-D Character-oriented printing easy
5429
* Improve data returned by ``Information[]``
30+
* Allow better integration into Jupyter cells.
5531

5632
Improving MakeBoxes is also needed for improving formatting and rendering.
5733

5834
Evaluation
5935
++++++++++
6036

61-
Some fundamental flaws have been detected around our main evaluation loop. We probably need to split function application from rule rewrite. ``Hold`` attributes, like ``HoldAll`` prevent function application, but not rule rewriting. This is apparent in the handling of ``Unevaluated[]``, ``Evaluate[]``, and ``With[]`` and ``Condition``. These need to be addressed. See for example: `Issue #1206 <https://github.com/Mathics3/mathics-core/issues/1206>`_ and `Issue #1789 <https://github.com/Mathics3/mathics-core/issues/1789>`_.
37+
Some fundamental flaws have been detected around our main evaluation loop. This is appareent in the handling of ``Unevaluated[]``, ``Evaluate[]``, and ``With[]`` and ``Condition``. These need to be addressed. See for example: `Issue #1206 <https://github.com/Mathics3/mathics-core/issues/1206>`_.
6238

6339
Debugging
6440
+++++++++
@@ -75,13 +51,14 @@ Major components that still need revision/rewrite
7551
* Efficient pattern matching
7652
* Documentation
7753
* Start a real instruction-driven interpreter
54+
* Compile system
7855
* Rewrite how Graphics Routines are implemented and implement a robust API for extending
79-
* Notebook Integration
8056

8157
Smaller things:
8258

59+
* Redo/rethink Complex representation
60+
* Better and more back-end formatting and rendering
8361
* Basic Object system. Some of our BaseElement objects don't feel right.
84-
* Improve Complex conversion to SymPy (via SymPy.Add?)
8562
* Remove home-grown Expression Cache.
8663

8764

0 commit comments

Comments
 (0)