Skip to content

Commit d799526

Browse files
authored
Merge pull request #799 from Mathics3/update-FUTURE
Start noting what's up and what goals have been met
2 parents 5e3eecc + 8a0c707 commit d799526

File tree

2 files changed

+172
-3
lines changed

2 files changed

+172
-3
lines changed

FUTURE.rst

Lines changed: 117 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,120 @@
22

33
.. contents::
44

5+
The following 2023 road map that appears the 6.0.0 hasn't gone through enough discussion. This provisional.
6+
Check the github repository for updates.
7+
8+
9+
2023 Roadmap
10+
============
11+
12+
13+
When the release settles, "Forms, Boxing, And "Formatting" is the next
14+
large refactor slated. Having this will allow us to supporting Jupyter or other front
15+
ends. And it is something that is most visibly wrong in Mathics3 output.
16+
17+
See ``PAST.rst`` for how the 2023 Roadmap compares to the 2022 Roadmap.
18+
19+
Forms, Boxing and Formatting
20+
----------------------------
21+
22+
This remains the biggest holdover item from 2022, and seems easily doable.
23+
It hinders interaction with Jupyter or other front ends.
24+
25+
Right now "Form" (a high-level specification of how to format) and
26+
"format" (a low level specification of how output is encoded) are sometimes muddied.
27+
28+
For example, TeXForm may be a "Form", but output encoded for AMS-LaTeX is done by a *formatter*.
29+
So AMS-LaTeX rendering and other kinds of rendering should be split into its own rendering for formatter module.
30+
Currently we have asymptote, and svg "format" modules.
31+
32+
Back to high-level again, Boxing is something that can be written in Mathics3, and doing this at
33+
least initially ensures that we have design that fits more naturally
34+
into the Wolfram Language philosophy.
35+
36+
37+
Performance
38+
-----------
39+
40+
While this is probably more of an overall concern, for now, big refactoring needed here, such as
41+
going over pattern matching, will get done after Forms, Boxing and Formatting .
42+
43+
Forms, Boxing and Formatting will however contain one improvement that
44+
should speed up our performance: separating M-Expression evaluation from
45+
Box "evaluations).
46+
47+
We expect there will be other little opportunities here and there as we have seen in the past.
48+
49+
50+
More Custom kinds of (compound) Expressions
51+
+++++++++++++++++++++++++++++++++++++++++++
52+
53+
We scratched the surface here with ListExpression. Associations and Python/Sympy/numpy literals can be customized with an aim towards reducing conversions from and to M-expressions.
54+
A number of compound expressions, especially those which involve literals are more efficiently represented in some other way. For example,
55+
representing a Mathics3 Association as a Python ordered dictionary, a Mathics3 List as a Python list or tuple, or as a numpy array.
56+
57+
58+
Further Code Reorganization in Core and Eval
59+
--------------------------------------------
60+
61+
Core object like ``BaseElement`` and possibly ``Symbol``, (and
62+
probably others) are too "fat": they have too many custom methods that
63+
are not applicable for most of the subclasses support. It is likely
64+
another pass will be made over this.
65+
66+
We have started moving "eval" code out of the "eval" methods and into its own module.
67+
68+
Mathics3 Module Enhancement
69+
---------------------------
70+
71+
While we have put in quite a bit of effort to get these to be 6.0.0 compliant. There is still more work to do, and there are numerous bugs there.
72+
Refactoring code to generate Graphs in ``pymathics.graph`` might happen. Porting the ``pymathics.graph`` code to use NetworkX 3.0 would be nice;
73+
``pymathics.natlang`` could also use a look over in terms of the libraries we are using.
74+
75+
Python upgrades
76+
---------------
77+
78+
After Mathics3 Version 6.0.0, Python 3.6 will be dropped and possibly 3.7. Changes are needed to support 3.11 so we will be focusing on 3.8 to 3.11.
79+
80+
We have gradually been using a more modern Python programming style
81+
and idioms: more type annotation, use of ``isort`` (order Python
82+
imports), ``black`` (code formatting), and ``flake8`` (Python lint
83+
checking).
84+
85+
86+
Deferred
87+
--------
88+
89+
As mentioned before, pattern-matching revision is for later. `This
90+
discussion
91+
<https://github.com/Mathics3/mathics-core/discussions/800>`_ is a
92+
placeholder for this discussion.
93+
94+
Overhauling the documentation to use something better supported and
95+
more mainstream like sphinx is deferred. This would really be nice to
96+
have, but it will require a bit of effort and detracts from all of the other work that is needed.
97+
98+
We will probably try this out in a limited basis in one of the Mathics3 modules.
99+
100+
Speaking of Mathics3 Modules, there are probably various scoping/context issues that Mathics3 modules make more apparent.
101+
This will is deferred for now.
102+
103+
Way down the line, is converting to a more sequence-based interpreter which is needed for JIT'ing and better Compilation support.
104+
105+
Likewise, speeding up startup time via saving and loading an image is something that is more of a long-term goal.
106+
107+
Things in this section can change, depending on the help we can get.
108+
109+
110+
Miscellaneous
111+
-------------
112+
113+
No doubt there will be numerous bug fixes, and builtin-function additions especially now that we have a better framework to support this kind of growth.
114+
Some of the smaller deferred issues refactorings may get addressed.
115+
116+
As always, where and how fast things grow here depends on help available.
117+
118+
5119
2022 Roadmap
6120
=============
7121

@@ -57,11 +171,11 @@ The current home-grown documentation should be replaced with Sphynx and autodoc.
57171
Compilation
58172
-----------
59173

60-
Complation is a rather unsophisticated process by trying to speed up Python code using llvmlite. The gains here will always be small compared the kinds of gains a compiler can get. However in order to even be able to contemplate writing a compiler (let alone say a JIT compiler), the code base needs to be made to work more like a traditional interpreter. Some work will be needed just to be able or create a sequence of instructions to run.
174+
Compilation is a rather unsophisticated process by trying to speed up Python code using llvmlite. The gains here will always be small compared the kinds of gains a compiler can get. However in order to even be able to contemplate writing a compiler (let alone say a JIT compiler), the code base needs to be made to work more like a traditional interpreter. Some work will be needed just to be able or create a sequence of instructions to run.
61175

62-
Right now the interpreter is strictly a tree interperter.
176+
Right now the interpreter is strictly a tree interpreter.
63177

64-
Simpiler Things
178+
Simpler Things
65179
---------------
66180

67181
There have been a number of things that have been deferred:

PAST.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
While ``FUTURE.rst`` gives our current roadmap, this file ``PAST.rst``
2+
looks the other way for what we have accomplished when compared to what _was_ planned in ``FUTURE.rst``
3+
4+
While this is also listed in ``CHANGES.rst``, here we extract that to
5+
make it easier to see the bigger picture without the details that are
6+
in ``CHANGES.rst``.
7+
8+
Progress from 2022
9+
==================
10+
11+
A fair bit of code refactoring has gone on so that we might be able to
12+
scale the code, get it to be more performant, and more in line with
13+
other interpreters.
14+
15+
The buitin Functions have been organized into grouping akind to what is found in WMA.
16+
This is not just for documentation purposes, but it better modularizes the code and keep
17+
the modules smaller while suggesting where functions below as we scale.
18+
19+
Image Routines have been gone over.
20+
21+
A number of Built-in functions that were implemented were not accessible for various reasons.
22+
23+
Mathics3 Modules are better integrated into the documentation.
24+
Existing Mathics3 modules pymathics.graph and pymathics.natlang have
25+
had a major overhaul, although more is needed. And will continue after th 6.0.0 release
26+
27+
We have gradually been rolling in more Python type annotations and
28+
current Python practices such as using ``isort``, ``black`` and ``flake8``.
29+
30+
31+
Boxing and Formatting
32+
---------------------
33+
34+
While some work on formatting is done has been made and the change in API reflects a little of this.
35+
However a lot more work needs to be done.
36+
37+
Excecution Performance
38+
----------------------
39+
40+
This has improved a slight bit, but not because it has been a focus, but
41+
rather because in going over the code organization, we are doing this
42+
less dumb, e.g. using Symbols more where symbols are intended. Or
43+
fixing bugs like resetting mpmath numeric precision on operations that
44+
need to chnage it temporarily.
45+
46+
Simpler Things
47+
--------------
48+
49+
A number of items here remain, but should not be thought as independent items, but instead part of
50+
"Forms, Boxing and Formatting".
51+
52+
"Making StandardOutput of polynomials match WMA" is really are Forms, Boxing and Formatting issue;
53+
"Working on Jupyter integrations" is also very dependant this.
54+
55+
So the next major refactor will be on Forms, Boxing and Formatting.

0 commit comments

Comments
 (0)