From dcb48ea670b44a31240c8b1b1c50cc242c72ef8d Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 3 Apr 2026 05:50:27 -0400 Subject: [PATCH 1/9] Start another round of noting 10.x Changes --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 1af44ad84..edfae9e64 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -43,6 +43,7 @@ Bugs Fixed #. #1492 ``UpSet`` not giving a "Tag Integer is Protected." message #. #1487 ``FindMinimum``, ``FindMaximim`` do not give approximate results when ``$IterationLimit`` has been exceeded and convergence fails #. #1481 $TraceBuiltins=False does not work after more than one $TraceBuiltins=True use. +#. Reset ``evaluation.iteration__count`` on each new evaluation. This caused problems in long-running sessions, such as the Mathics3-django gallery examples. Command-line Utilites From 9c064ba27c9747903f1da9f263bb3be38a96e041 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 4 Apr 2026 09:14:38 -0400 Subject: [PATCH 2/9] Start adding PR and issue links --- CHANGES.rst | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index edfae9e64..7a60c1a9a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,7 +7,10 @@ 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. -Note: There are incompatible changes. Use with Mathics-scanner 10.0.0 or greater. +Notes: + +#. There are incompatible changes. Use with Mathics-scanner 10.0.0 or greater. +#. We are in the process of renaming ``Mathics`` to ``Mathics3``. ``Mathics`` was monolithic Python 2-ish code. Mathics3 has rewritten a number of major subcomponents, and spit off a number of subcomponents. There are still several that still 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``. New Builtins @@ -15,7 +18,7 @@ New Builtins #. ``$Language`` variable #. ``ArcBox`` boxing function -#. ``Csch`` function [PR # #1768] +#. ``Csch`` function `PR #1768 `_ #. ``JSON`Import`JSONImport`` #. ``RasterBox`` boxing function #. ``RoundBox`` boxing function @@ -32,24 +35,24 @@ Enhancements Bugs Fixed ---------- -#. PR #1762 Fix Rayleigh expansion rules to only match half-integer orders. (Chenxin Zhong) -#. #1741 Implement ``MachinePrecision`` option for large numbers that fall outside of Python's builtin ``float`` mantissa -#. #1740 ``N[3^200]`` in formats as ``PrecisionReal`` instead of ``MachinePrecision`` -#. #1723 ``DiscretePlot`` gives wrong results nested function in ``First`` or ``Last`` -#. #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. -#. #1692 ``Map`` does not automatically map a function over ``Association`` values (vasdommes) -#. #1639 Map does not automatically map a function over Association values -#. #1519 ``Order`` for Numerics, e.g. ``Order[1.0, 1] == -1``, but is 0 -#. #1492 ``UpSet`` not giving a "Tag Integer is Protected." message -#. #1487 ``FindMinimum``, ``FindMaximim`` do not give approximate results when ``$IterationLimit`` has been exceeded and convergence fails -#. #1481 $TraceBuiltins=False does not work after more than one $TraceBuiltins=True use. +#. `PR #1762 `_ Fix Rayleigh expansion rules to only match half-integer orders. (Chenxin Zhong) +#. `#1741 `_ Implement ``MachinePrecision`` option for large numbers that fall outside of Python's builtin ``float`` mantissa +#. `#1740 `_ ``N[3^200]`` in formats as ``PrecisionReal`` instead of ``MachinePrecision`` +#. `#1723 `_ ``DiscretePlot`` gives wrong results nested function in ``First`` or ``Last`` +#. `#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. +#. `#1692 `_ ``Map`` does not automatically map a function over ``Association`` values (vasdommes) +#. `#1639 `_ Map does not automatically map a function over Association values +#. `#1519 `_ ``Order`` for Numerics, e.g. ``Order[1.0, 1] == -1``, but is 0 +#. `#1492 `_ ``UpSet`` not giving a "Tag Integer is Protected." message +#. `#1487 `_ ``FindMinimum``, ``FindMaximim`` do not give approximate results when ``$IterationLimit`` has been exceeded and convergence fails +#. `#1481 `_ $TraceBuiltins=False does not work after more than one $TraceBuiltins=True use. #. Reset ``evaluation.iteration__count`` on each new evaluation. This caused problems in long-running sessions, such as the Mathics3-django gallery examples. -Command-line Utilites ---------------------- +Command-line Utilities +---------------------- -Command-line program ``mathics`` was renamed to ``mathics3``; the old name will be available for a while. This appearently facilitates uv packaging. +Command-line program ``mathics`` was renamed to ``mathics3``; the old name will be available for a while. This apparently facilitates uv packaging. 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. @@ -62,8 +65,8 @@ Internals Corrections were made to variables ``$PrintForms`` and ``$OutputForms``. * 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. * Internals for handling Graphics have been revised to be able to accept a more complete list. -* Parsing now uses more data from YAML tables insead of hard-coding values inside code. -* 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. +* Parsing now uses more data from YAML tables instead of hard-coding values inside code. +* 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. * Numerous internal changes were made to improve performance. * ``mpmath`` is used to store large integer mantissas in ``N[x_Integer]``. * 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``. @@ -71,14 +74,15 @@ Internals Package updates --------------- +#. Python 3.14 supported. Support for Python 3.10 dropped; it may still work, but is not supported. #. Sympy 1.14 supported -#. llvm 15+ now supported +#. llvm 18+ now supported API incompatibility ------------------- * Front ends must now issue an explicit call to - ``import_and_load_builtins()``. Previously this was handled simpy by + ``import_and_load_builtins()``. Previously this was handled simply by ``import`` of ``MathicsSession``. Loading modules loaded via ``import`` was unpredictable in how and when things got loaded. The change was make do address this and to be able to give more @@ -1512,7 +1516,7 @@ Other changes #. blacken (format) a number of Python files and remove blanks at the end of lines #. Adding several CI tests #. Remove various deprecation warnings -#. Change shbang from ``python`` to ``python3`` +#. Change ``#!`` from ``python`` to ``python3`` #. Update docs Backward incompatibilities From 78b5469c8a50a8ca04008540b09a37551e6f68c6 Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Sat, 4 Apr 2026 09:22:14 -0400 Subject: [PATCH 3/9] Fix typos and improve clarity in CHANGES.rst --- CHANGES.rst | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 7a60c1a9a..5e0df16cd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,12 +5,12 @@ 10.0.0 ====== -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. +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. Notes: #. There are incompatible changes. Use with Mathics-scanner 10.0.0 or greater. -#. We are in the process of renaming ``Mathics`` to ``Mathics3``. ``Mathics`` was monolithic Python 2-ish code. Mathics3 has rewritten a number of major subcomponents, and spit off a number of subcomponents. There are still several that still 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``. +#. 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``. New Builtins @@ -29,7 +29,7 @@ New Builtins Enhancements ------------ -* Many Builtin functions now report argument mismatch errors +* Many Builtin functions now report argument-mismatch errors * ``Trig`` option added to ``Numerator`` and ``Denominator`` Bugs Fixed @@ -63,7 +63,7 @@ Internals Corrections were made to variables ``$PrintForms`` and ``$OutputForms``. (mmatera) * A major revision and reorganization was begun to improve Boxing. Corrections were made to variables ``$PrintForms`` and ``$OutputForms``. -* 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. +* 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. * Internals for handling Graphics have been revised to be able to accept a more complete list. * Parsing now uses more data from YAML tables instead of hard-coding values inside code. * 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. @@ -82,10 +82,10 @@ API incompatibility ------------------- * Front ends must now issue an explicit call to - ``import_and_load_builtins()``. Previously this was handled simply by + ``import_and_load_builtins()``. Previously, this was handled simply by ``import`` of ``MathicsSession``. Loading modules loaded via ``import`` was unpredictable in how and when things got loaded. The - change was make do address this and to be able to give more + change was made to address this and to be able to give more flexibility in loading. * Token names have changed to align better with ``CodeParser`CodeTokenize`` @@ -104,11 +104,11 @@ 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``. +Preliminary work to track locations has started. This is useful in debugging and error reporting, and is controlled via the 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. +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``. @@ -153,13 +153,13 @@ 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 +#. ``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 + ``-help``, ``-file`` are now accepted. Short option ``-f`` is associated with ``-file`` rather than ``--fullform``; ``-F`` 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. +#. 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. +#. We check argument counts on more built-in 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 ---------- @@ -168,13 +168,13 @@ Bugs Fixed #. #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 +#. #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 +#. #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`` @@ -464,23 +464,23 @@ Internals --------- * ``eval_abs`` and ``eval_sign`` extracted from ``Abs`` and ``Sign`` and added to ``mathics.eval.arithmetic``. -* Maximum number of digits allowed in a string set to 7000 and can be adjusted using environment variable +* The maximum number of digits allowed in a string is set to 7000 and can be adjusted using an environment variable ``MATHICS_MAX_STR_DIGITS`` on Python versions that don't adjust automatically (like pyston). -* Real number comparisons implemented is based now in the internal implementation of ``RealSign``. +* Real number comparisons implemented now use the internal implementation of ``RealSign``. * For Python 3.11, the variable ``$MaxLengthIntStringConversion`` controls the maximum size of the literal conversion between large integers and Strings. * Older style non-appearing and non-pedagogical doctests have been converted to pytest * Built-in code is directed explicitly rather than implicitly. This facilitates the ability to lazy load builtins or "autoload" them a la GNU Emacs autoload. * Add mpmath LRU cache -* 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 +* 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 Bugs Fixed ---------- * ``Definitions`` is compatible with ``pickle``. -* Improved support for ``Quantity`` expressions, including conversions, formatting and arithmetic operations. +* Improved support for ``Quantity`` expressions, including conversions, formatting, and arithmetic operations. * ``Background`` option for ``Graphics`` and ``Graphics3D`` is operative again. * Numeric comparisons against expressions involving ``String``; Issue #797) * ``Switch[]`` involving ``Infinity``. Issue #956 @@ -498,7 +498,7 @@ API We now require an explicit call to a new function ``import_and_load_builtins()``. Previously, loading was implicit and indeterminate as to when this occurred, as it was based on import -order. We need this so that we can add support in the future for lazy loading built-in modules. +order. We need this so that we can add support in the future for lazy-loading built-in modules. Package updates --------------- From 1700ecd33e22ce0e2c23f362266040498da76e81 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 4 Apr 2026 14:00:57 -0400 Subject: [PATCH 4/9] Improve subscript formatting in DiscretePlot doc --- mathics/builtin/drawing/plot_listplot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathics/builtin/drawing/plot_listplot.py b/mathics/builtin/drawing/plot_listplot.py index 7ff1468eb..277e8986d 100644 --- a/mathics/builtin/drawing/plot_listplot.py +++ b/mathics/builtin/drawing/plot_listplot.py @@ -386,7 +386,7 @@ class DiscretePlot(_ListPlot):
plots $expr$ with $x$ ranging from $n_{min}$ to $n_{max}$ usings steps $dn$.
'DiscretePlot'[{$expr_1$, $expr_2$, ...}, ...] -
plots the values of all $expri$. +
plots the values of all $expr_{i}$. The number of primes for a number $k$: From 68b648963b3d294065d00781df57ebe8a5662dcd Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 8 Apr 2026 19:53:39 -0400 Subject: [PATCH 5/9] Revise advantages of Mathics3 --- mathics/doc/documentation/1-Manual.mdoc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mathics/doc/documentation/1-Manual.mdoc b/mathics/doc/documentation/1-Manual.mdoc index 22107ae96..7c5490173 100644 --- a/mathics/doc/documentation/1-Manual.mdoc +++ b/mathics/doc/documentation/1-Manual.mdoc @@ -33,17 +33,18 @@ However, even if you are willing to pay hundreds of dollars for the software, yo
  • :SciPy: https://www.scipy.org/ for Scientific calculations. -Performance of \Mathics3 is not, right now, fast in large-scale projects and calculations. However, it can be used as a tool for exploration and education and non-computationally intensive use. And \Mathics3 provides better debugging and tracing, since we can be completely transparent about every aspect of its operation. +Performance of \Mathics3 is not, right now, fast in large-scale projects and calculations. With better use of NumPy arrays, and better compilation, we hope to ameliorate this in the future. + +However, right now \Mathics3 can be used as a tool for exploration and education and non-computationally intensive use. And \Mathics3 provides better debugging and tracing, since we can be completely transparent about every aspect of its operation.
    -Because \Mathics3 is compatible with the Wolfram-Language kernel within the -confines of the Python ecosystem, it is a powerful functional +Because \Mathics3 is compatible with the Wolfram-Language kernel within the confines of the Python ecosystem, it is a powerful functional \ programming language, driven by pattern matching and rule application. -Primitive types include rationals, complex numbers, and arbitrary-precision numbers. Other primitive types, such as images or graphs, or NLP, come from the various Python libraries that \Mathics3 uses. +Primitive types include rationals, complex numbers, and arbitrary-precision numbers (courtesy of :mpmath: https://mpmath.org/). Other primitive types, such as images or graphs, or NLP, come from the various Python libraries that \Mathics3 uses. Outside of the "core" \Mathics3 kernel (which has only a primitive command-line interface), in separate GitHub projects, as add-ons, there are: @@ -57,7 +58,7 @@ Outside of the "core" \Mathics3 kernel (which has only a primitive command-line
  • a :A docker container:https://hub.docker.com/r/mathicsorg/mathics which bundles all of the above -In the future, we might provide better interaction with other Open-source projects and tools. For example, we might be able someday to read and write Jupyter notebooks, or translate into pure SymPy and \Mathics3. +In the future, we might provide better interaction with other Open-source projects like :SageMath:https://www.sagemath.org/ and Open-source tools. For example, we might be able someday to read and write Jupyter notebooks, translate into pure SymPy and \Mathics3, or translate between SageMath object and \Mathics3 objects more seamlessly. A couple of the notable Mathematica packages that work on \Mathics3 are :Combinatorica :https://github.com/Mathics3/Mathics3-Combinatorica,and :Rubi:https://github.com/Mathics3/Mathics3-Package-Rubi/. From fdfb107dd09123de8008d5e7a19e41d5828237d4 Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 8 Apr 2026 21:01:31 -0400 Subject: [PATCH 6/9] Finish going over pull requests --- CHANGES.rst | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 5e0df16cd..91711f0b5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,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. +A major revision of Form handling and character encoding ``$CharacterEncoding`` was started with a focus on ``TeXForm``, ``MLForm``, and ``OutputForm``. + Notes: #. There are incompatible changes. Use with Mathics-scanner 10.0.0 or greater. @@ -21,7 +23,8 @@ New Builtins #. ``Csch`` function `PR #1768 `_ #. ``JSON`Import`JSONImport`` #. ``RasterBox`` boxing function -#. ``RoundBox`` boxing function +#. ``Format`` +#. ``FormBox``, and ``RoundBox`` boxing functions #. ``ShowSpecialCharacters`` option #. ``ShowStringCharacters`` option @@ -29,8 +32,14 @@ New Builtins Enhancements ------------ -* Many Builtin functions now report argument-mismatch errors -* ``Trig`` option added to ``Numerator`` and ``Denominator`` +#. Many Builtin functions now report argument-mismatch errors +#. ``Trig`` option added to ``Numerator`` and ``Denominator`` +#. ``PowerMod`` and ``Quotient`` handle the 3-argument form, roots of exponents (``PowerMod``) lists of exponents, and numbers other than Integers. +#. ``N[integer, MachinePrecision]`` added +#. ``PrintPrecision`` for ``N[integer]`` matches WMA; so does largest mantissa before converting to MachinePrecision Integer (for display) matches WMA. +#. ``BeginPackage`` with ``Needs`` parameter added. This should allow more packages to load properly +#. ``Expand`` works with relations + Bugs Fixed ---------- @@ -52,7 +61,7 @@ Bugs Fixed Command-line Utilities ---------------------- -Command-line program ``mathics`` was renamed to ``mathics3``; the old name will be available for a while. This apparently facilitates uv packaging. +Command-line program ``mathics`` was renamed to ``mathics3``; the old name will be available for a while. This apparently facilitates ``uv`` packaging. 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. @@ -61,8 +70,6 @@ Internals * 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) Corrections were made to variables ``$PrintForms`` and ``$OutputForms``. (mmatera) -* A major revision and reorganization was begun to improve Boxing. - Corrections were made to variables ``$PrintForms`` and ``$OutputForms``. * 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. * Internals for handling Graphics have been revised to be able to accept a more complete list. * Parsing now uses more data from YAML tables instead of hard-coding values inside code. From d17dac1eebebf97bde5fcd38bc07ff1a0580a22e Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 10 Apr 2026 21:19:01 -0400 Subject: [PATCH 7/9] Note new options to Get[] --- CHANGES.rst | 1 + mathics/builtin/files_io/files.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 91711f0b5..1497cc8d0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -34,6 +34,7 @@ Enhancements #. Many Builtin functions now report argument-mismatch errors #. ``Trig`` option added to ``Numerator`` and ``Denominator`` +#. ``CharacterEncoding``, and ``Path`` options option added to ``Get`` #. ``PowerMod`` and ``Quotient`` handle the 3-argument form, roots of exponents (``PowerMod``) lists of exponents, and numbers other than Integers. #. ``N[integer, MachinePrecision]`` added #. ``PrintPrecision`` for ``N[integer]`` matches WMA; so does largest mantissa before converting to MachinePrecision Integer (for display) matches WMA. diff --git a/mathics/builtin/files_io/files.py b/mathics/builtin/files_io/files.py index cd2d10f66..644c93b41 100644 --- a/mathics/builtin/files_io/files.py +++ b/mathics/builtin/files_io/files.py @@ -358,7 +358,7 @@ class Get(PrefixOperator):
    Set the search path to the single directory $dir$ in the 'Get'.
    'Path'->{"$dir_1$", "$dir_2$", ...}
    Set the search path, '$PATH' to the list of directories. -
    'Character_Encoding'->"{$name}" +
    'CharacterEncoding'->"{$name}"
    Set the file input encoding to $name$. From 0631c5fbf95bea581fb9a7f8b0504f46a825596c Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 11 Apr 2026 10:19:25 -0400 Subject: [PATCH 8/9] Revise FUTURE.rst for what we know now --- FUTURE.rst | 43 +++++++++++++++++++++++++++++++++---------- mathics/session.py | 6 +++--- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/FUTURE.rst b/FUTURE.rst index 9aa7e3a1e..5ba6d1793 100644 --- a/FUTURE.rst +++ b/FUTURE.rst @@ -1,8 +1,21 @@ *One can always dream...* -2025-2026 Roadmap +2026-2027 Roadmap ================= + +2026 Achievements +----------------- + +Support Python 3.14 and Poetry packaging. + +Major foundational work was done in revising Form and ``MakeBox`` handling. + +How Mathics3 handles ``CharacterEncoding`` was revised. + +Introduction of NumPy vectors using ``NumericArray`` was started. Some foundational work was done to revise Plotting and speed it up using vectorization. + + 2025 Achievements ----------------- @@ -19,22 +32,33 @@ Some preliminary debugging support was added. Position information is starting t Upcoming work ------------- -MakeBoxes -++++++++++ +Support for NumPy Vectors and Arrays +++++++++++++++++++++++++++++++++++++ + +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) + +Compilation ++++++++++++ + +A Compiler for pure functions to SymPy expressions was started to speed up Plotting. (Bruce Lucas). + +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. + -We hope to improve conformance of ``MakeBoxes`` and this will: +More Forms and MakeBoxes +++++++++++++++++++++++++ +* Implement ``DisplayForm``, ``ScientificForm``, ``EngineeringForm``, and ``DecimalForm`` +* Improve``TraditionalForm`` * Improve conformance to WMA for expressions such as polynomial expressions -* Make 2-D Character-oriented printing easy * Improve data returned by ``Information[]`` -* Allow better integration into Jupyter cells. Improving MakeBoxes is also needed for improving formatting and rendering. Evaluation ++++++++++ -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 `_. +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 `_ and `Issue #1789 `_. Debugging +++++++++ @@ -51,14 +75,13 @@ Major components that still need revision/rewrite * Efficient pattern matching * Documentation * Start a real instruction-driven interpreter -* Compile system * Rewrite how Graphics Routines are implemented and implement a robust API for extending +* Notebook Integration Smaller things: -* Redo/rethink Complex representation -* Better and more back-end formatting and rendering * Basic Object system. Some of our BaseElement objects don't feel right. +* Improve Complex conversion to SymPy (via SymPy.Add?) * Remove home-grown Expression Cache. diff --git a/mathics/session.py b/mathics/session.py index 9db69f9b9..4445f4628 100644 --- a/mathics/session.py +++ b/mathics/session.py @@ -4,9 +4,9 @@ In particular we provide: -* a class to create a Mathics session, -* load the Mathics core settings files (written in WL), -* read and set Mathics Settings. +* a class to create a Mathics3 session, +* load the Mathics core settings files (written in WL), +* read and set Mathics3 Settings. """ import os From 1d5e8a2152cf3f903ff273e256fba5834f1ff217 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 11 Apr 2026 10:26:09 -0400 Subject: [PATCH 9/9] Mathics->Mathics3 and... mathics.core.expression: revise a docstring --- CHANGES.rst | 107 +++++++++++------------- FUTURE.rst | 43 +++------- mathics/core/convert/expression.py | 6 +- mathics/core/expression.py | 5 +- mathics/doc/documentation/1-Manual.mdoc | 11 ++- mathics/session.py | 2 +- 6 files changed, 69 insertions(+), 105 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1497cc8d0..1af44ad84 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,14 +5,9 @@ 10.0.0 ====== -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. +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. -A major revision of Form handling and character encoding ``$CharacterEncoding`` was started with a focus on ``TeXForm``, ``MLForm``, and ``OutputForm``. - -Notes: - -#. There are incompatible changes. Use with Mathics-scanner 10.0.0 or greater. -#. 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``. +Note: There are incompatible changes. Use with Mathics-scanner 10.0.0 or greater. New Builtins @@ -20,11 +15,10 @@ New Builtins #. ``$Language`` variable #. ``ArcBox`` boxing function -#. ``Csch`` function `PR #1768 `_ +#. ``Csch`` function [PR # #1768] #. ``JSON`Import`JSONImport`` #. ``RasterBox`` boxing function -#. ``Format`` -#. ``FormBox``, and ``RoundBox`` boxing functions +#. ``RoundBox`` boxing function #. ``ShowSpecialCharacters`` option #. ``ShowStringCharacters`` option @@ -32,37 +26,29 @@ New Builtins Enhancements ------------ -#. Many Builtin functions now report argument-mismatch errors -#. ``Trig`` option added to ``Numerator`` and ``Denominator`` -#. ``CharacterEncoding``, and ``Path`` options option added to ``Get`` -#. ``PowerMod`` and ``Quotient`` handle the 3-argument form, roots of exponents (``PowerMod``) lists of exponents, and numbers other than Integers. -#. ``N[integer, MachinePrecision]`` added -#. ``PrintPrecision`` for ``N[integer]`` matches WMA; so does largest mantissa before converting to MachinePrecision Integer (for display) matches WMA. -#. ``BeginPackage`` with ``Needs`` parameter added. This should allow more packages to load properly -#. ``Expand`` works with relations - +* Many Builtin functions now report argument mismatch errors +* ``Trig`` option added to ``Numerator`` and ``Denominator`` Bugs Fixed ---------- -#. `PR #1762 `_ Fix Rayleigh expansion rules to only match half-integer orders. (Chenxin Zhong) -#. `#1741 `_ Implement ``MachinePrecision`` option for large numbers that fall outside of Python's builtin ``float`` mantissa -#. `#1740 `_ ``N[3^200]`` in formats as ``PrecisionReal`` instead of ``MachinePrecision`` -#. `#1723 `_ ``DiscretePlot`` gives wrong results nested function in ``First`` or ``Last`` -#. `#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. -#. `#1692 `_ ``Map`` does not automatically map a function over ``Association`` values (vasdommes) -#. `#1639 `_ Map does not automatically map a function over Association values -#. `#1519 `_ ``Order`` for Numerics, e.g. ``Order[1.0, 1] == -1``, but is 0 -#. `#1492 `_ ``UpSet`` not giving a "Tag Integer is Protected." message -#. `#1487 `_ ``FindMinimum``, ``FindMaximim`` do not give approximate results when ``$IterationLimit`` has been exceeded and convergence fails -#. `#1481 `_ $TraceBuiltins=False does not work after more than one $TraceBuiltins=True use. -#. Reset ``evaluation.iteration__count`` on each new evaluation. This caused problems in long-running sessions, such as the Mathics3-django gallery examples. - - -Command-line Utilities ----------------------- +#. PR #1762 Fix Rayleigh expansion rules to only match half-integer orders. (Chenxin Zhong) +#. #1741 Implement ``MachinePrecision`` option for large numbers that fall outside of Python's builtin ``float`` mantissa +#. #1740 ``N[3^200]`` in formats as ``PrecisionReal`` instead of ``MachinePrecision`` +#. #1723 ``DiscretePlot`` gives wrong results nested function in ``First`` or ``Last`` +#. #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. +#. #1692 ``Map`` does not automatically map a function over ``Association`` values (vasdommes) +#. #1639 Map does not automatically map a function over Association values +#. #1519 ``Order`` for Numerics, e.g. ``Order[1.0, 1] == -1``, but is 0 +#. #1492 ``UpSet`` not giving a "Tag Integer is Protected." message +#. #1487 ``FindMinimum``, ``FindMaximim`` do not give approximate results when ``$IterationLimit`` has been exceeded and convergence fails +#. #1481 $TraceBuiltins=False does not work after more than one $TraceBuiltins=True use. + + +Command-line Utilites +--------------------- -Command-line program ``mathics`` was renamed to ``mathics3``; the old name will be available for a while. This apparently facilitates ``uv`` packaging. +Command-line program ``mathics`` was renamed to ``mathics3``; the old name will be available for a while. This appearently facilitates uv packaging. 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. @@ -71,10 +57,12 @@ Internals * 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) Corrections were made to variables ``$PrintForms`` and ``$OutputForms``. (mmatera) -* 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. +* A major revision and reorganization was begun to improve Boxing. + Corrections were made to variables ``$PrintForms`` and ``$OutputForms``. +* 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. * Internals for handling Graphics have been revised to be able to accept a more complete list. -* Parsing now uses more data from YAML tables instead of hard-coding values inside code. -* 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. +* Parsing now uses more data from YAML tables insead of hard-coding values inside code. +* 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. * Numerous internal changes were made to improve performance. * ``mpmath`` is used to store large integer mantissas in ``N[x_Integer]``. * 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``. @@ -82,18 +70,17 @@ Internals Package updates --------------- -#. Python 3.14 supported. Support for Python 3.10 dropped; it may still work, but is not supported. #. Sympy 1.14 supported -#. llvm 18+ now supported +#. llvm 15+ now supported API incompatibility ------------------- * Front ends must now issue an explicit call to - ``import_and_load_builtins()``. Previously, this was handled simply by + ``import_and_load_builtins()``. Previously this was handled simpy by ``import`` of ``MathicsSession``. Loading modules loaded via ``import`` was unpredictable in how and when things got loaded. The - change was made to address this and to be able to give more + change was make do address this and to be able to give more flexibility in loading. * Token names have changed to align better with ``CodeParser`CodeTokenize`` @@ -112,11 +99,11 @@ 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 the Boolean System variable ``$TrackLocations``. +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. +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``. @@ -161,13 +148,13 @@ 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 +#. ``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 now used for + ``-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 filter either rewrite rules or evaluation expressions. Presumably, you don't want to filter both. -#. We check argument counts on more built-in 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. +#. 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 ---------- @@ -176,13 +163,13 @@ Bugs Fixed #. #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. +#. #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. +#. #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`` @@ -472,23 +459,23 @@ Internals --------- * ``eval_abs`` and ``eval_sign`` extracted from ``Abs`` and ``Sign`` and added to ``mathics.eval.arithmetic``. -* The maximum number of digits allowed in a string is set to 7000 and can be adjusted using an environment variable +* Maximum number of digits allowed in a string set to 7000 and can be adjusted using environment variable ``MATHICS_MAX_STR_DIGITS`` on Python versions that don't adjust automatically (like pyston). -* Real number comparisons implemented now use the internal implementation of ``RealSign``. +* Real number comparisons implemented is based now in the internal implementation of ``RealSign``. * For Python 3.11, the variable ``$MaxLengthIntStringConversion`` controls the maximum size of the literal conversion between large integers and Strings. * Older style non-appearing and non-pedagogical doctests have been converted to pytest * Built-in code is directed explicitly rather than implicitly. This facilitates the ability to lazy load builtins or "autoload" them a la GNU Emacs autoload. * Add mpmath LRU cache -* 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 +* 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 Bugs Fixed ---------- * ``Definitions`` is compatible with ``pickle``. -* Improved support for ``Quantity`` expressions, including conversions, formatting, and arithmetic operations. +* Improved support for ``Quantity`` expressions, including conversions, formatting and arithmetic operations. * ``Background`` option for ``Graphics`` and ``Graphics3D`` is operative again. * Numeric comparisons against expressions involving ``String``; Issue #797) * ``Switch[]`` involving ``Infinity``. Issue #956 @@ -506,7 +493,7 @@ API We now require an explicit call to a new function ``import_and_load_builtins()``. Previously, loading was implicit and indeterminate as to when this occurred, as it was based on import -order. We need this so that we can add support in the future for lazy-loading built-in modules. +order. We need this so that we can add support in the future for lazy loading built-in modules. Package updates --------------- @@ -1524,7 +1511,7 @@ Other changes #. blacken (format) a number of Python files and remove blanks at the end of lines #. Adding several CI tests #. Remove various deprecation warnings -#. Change ``#!`` from ``python`` to ``python3`` +#. Change shbang from ``python`` to ``python3`` #. Update docs Backward incompatibilities diff --git a/FUTURE.rst b/FUTURE.rst index 5ba6d1793..9aa7e3a1e 100644 --- a/FUTURE.rst +++ b/FUTURE.rst @@ -1,21 +1,8 @@ *One can always dream...* -2026-2027 Roadmap +2025-2026 Roadmap ================= - -2026 Achievements ------------------ - -Support Python 3.14 and Poetry packaging. - -Major foundational work was done in revising Form and ``MakeBox`` handling. - -How Mathics3 handles ``CharacterEncoding`` was revised. - -Introduction of NumPy vectors using ``NumericArray`` was started. Some foundational work was done to revise Plotting and speed it up using vectorization. - - 2025 Achievements ----------------- @@ -32,33 +19,22 @@ Some preliminary debugging support was added. Position information is starting t Upcoming work ------------- -Support for NumPy Vectors and Arrays -++++++++++++++++++++++++++++++++++++ - -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) - -Compilation -+++++++++++ - -A Compiler for pure functions to SymPy expressions was started to speed up Plotting. (Bruce Lucas). - -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. - +MakeBoxes +++++++++++ -More Forms and MakeBoxes -++++++++++++++++++++++++ +We hope to improve conformance of ``MakeBoxes`` and this will: -* Implement ``DisplayForm``, ``ScientificForm``, ``EngineeringForm``, and ``DecimalForm`` -* Improve``TraditionalForm`` * Improve conformance to WMA for expressions such as polynomial expressions +* Make 2-D Character-oriented printing easy * Improve data returned by ``Information[]`` +* Allow better integration into Jupyter cells. Improving MakeBoxes is also needed for improving formatting and rendering. Evaluation ++++++++++ -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 `_ and `Issue #1789 `_. +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 `_. Debugging +++++++++ @@ -75,13 +51,14 @@ Major components that still need revision/rewrite * Efficient pattern matching * Documentation * Start a real instruction-driven interpreter +* Compile system * Rewrite how Graphics Routines are implemented and implement a robust API for extending -* Notebook Integration Smaller things: +* Redo/rethink Complex representation +* Better and more back-end formatting and rendering * Basic Object system. Some of our BaseElement objects don't feel right. -* Improve Complex conversion to SymPy (via SymPy.Add?) * Remove home-grown Expression Cache. diff --git a/mathics/core/convert/expression.py b/mathics/core/convert/expression.py index 60784bfea..5611aebc1 100644 --- a/mathics/core/convert/expression.py +++ b/mathics/core/convert/expression.py @@ -24,7 +24,7 @@ def to_expression( elements_conversion_fn: Callable = from_python, ) -> Expression: """ - This is an expression constructor that can be used when the Head and elements are not Mathics + This is an expression constructor that can be used when the Head and elements are not Mathics3 objects. For example to_expression("Plus", 1, 2, 3) """ if isinstance(head, str): @@ -70,7 +70,7 @@ def to_mathics_list( ) -> ListExpression: """ This is an expression constructor for list that can be used when - the elements are not Mathics objects. + the elements are not Mathics3 objects. For example:: @@ -90,7 +90,7 @@ def to_mathics_list( def to_numeric_args(mathics_args: BaseElement, evaluation) -> tuple: """ - Convert Mathics arguments, such as the arguments in an evaluation + Convert Mathics3 arguments, such as the arguments in an evaluation method a Python list that is suitable for feeding as arguments into SymPy, NumPy, or mpmath. diff --git a/mathics/core/expression.py b/mathics/core/expression.py index 58f1f744a..d39de744b 100644 --- a/mathics/core/expression.py +++ b/mathics/core/expression.py @@ -621,8 +621,9 @@ def evaluate( def evaluate_elements(self, evaluation) -> "Expression": """ - return a new expression with the head and the - evaluable elements evaluated, according to the attributes. + Return a new expression with the head and the + evaluable elements evaluated, taking into account the + the expression's head attribute and its HOLD properties. """ head = self._head if isinstance(head, EvalMixin): diff --git a/mathics/doc/documentation/1-Manual.mdoc b/mathics/doc/documentation/1-Manual.mdoc index 7c5490173..22107ae96 100644 --- a/mathics/doc/documentation/1-Manual.mdoc +++ b/mathics/doc/documentation/1-Manual.mdoc @@ -33,18 +33,17 @@ However, even if you are willing to pay hundreds of dollars for the software, yo
  • :SciPy: https://www.scipy.org/ for Scientific calculations. -Performance of \Mathics3 is not, right now, fast in large-scale projects and calculations. With better use of NumPy arrays, and better compilation, we hope to ameliorate this in the future. - -However, right now \Mathics3 can be used as a tool for exploration and education and non-computationally intensive use. And \Mathics3 provides better debugging and tracing, since we can be completely transparent about every aspect of its operation. +Performance of \Mathics3 is not, right now, fast in large-scale projects and calculations. However, it can be used as a tool for exploration and education and non-computationally intensive use. And \Mathics3 provides better debugging and tracing, since we can be completely transparent about every aspect of its operation.
  • -Because \Mathics3 is compatible with the Wolfram-Language kernel within the confines of the Python ecosystem, it is a powerful functional \ +Because \Mathics3 is compatible with the Wolfram-Language kernel within the +confines of the Python ecosystem, it is a powerful functional programming language, driven by pattern matching and rule application. -Primitive types include rationals, complex numbers, and arbitrary-precision numbers (courtesy of :mpmath: https://mpmath.org/). Other primitive types, such as images or graphs, or NLP, come from the various Python libraries that \Mathics3 uses. +Primitive types include rationals, complex numbers, and arbitrary-precision numbers. Other primitive types, such as images or graphs, or NLP, come from the various Python libraries that \Mathics3 uses. Outside of the "core" \Mathics3 kernel (which has only a primitive command-line interface), in separate GitHub projects, as add-ons, there are: @@ -58,7 +57,7 @@ Outside of the "core" \Mathics3 kernel (which has only a primitive command-line
  • a :A docker container:https://hub.docker.com/r/mathicsorg/mathics which bundles all of the above -In the future, we might provide better interaction with other Open-source projects like :SageMath:https://www.sagemath.org/ and Open-source tools. For example, we might be able someday to read and write Jupyter notebooks, translate into pure SymPy and \Mathics3, or translate between SageMath object and \Mathics3 objects more seamlessly. +In the future, we might provide better interaction with other Open-source projects and tools. For example, we might be able someday to read and write Jupyter notebooks, or translate into pure SymPy and \Mathics3. A couple of the notable Mathematica packages that work on \Mathics3 are :Combinatorica :https://github.com/Mathics3/Mathics3-Combinatorica,and :Rubi:https://github.com/Mathics3/Mathics3-Package-Rubi/. diff --git a/mathics/session.py b/mathics/session.py index 4445f4628..ad9acd628 100644 --- a/mathics/session.py +++ b/mathics/session.py @@ -84,7 +84,7 @@ def load_default_settings_files( def get_settings_value(definitions: Definitions, setting_name: str): - """Get a Mathics Settings` value with name "setting_name" from + """Get a Mathics3 Settings` value with name "setting_name" from definitions. If setting_name is not defined return None. """ try: