|
1 | | -# ROADMAP |
| 1 | +# Roadmap |
2 | 2 |
|
3 | | -Overall the goal is to make a powerful and broad featured library for numerical and scientific computing. In order to make a transition from python easy we should largely follow the conventions of numpy and scipy, but we should allow for the flexibility to do things differently where it improves user experience or greatly effects performance. |
| 3 | +Our primary objective is to develop a robust and comprehensive library for numerical and scientific computing. To facilitate a smooth transition from Python, we will primarily adhere to the conventions of `numpy` and `scipy`, while allowing deviations when they: |
4 | 4 |
|
5 | | -With that in mind NuMojo as a project is in an early stage of development. If you notice a missing feature either build it and make a pull request or make a feature request. |
| 5 | +- Align with the design philosophy of the Mojo programming language. |
| 6 | +- Significantly enhance performance, such as through the use of generics. |
| 7 | +- Improve consistency in conventions, such as naming parameters and arguments. |
6 | 8 |
|
7 | | -## TASKS |
| 9 | +NuMojo is currently in its early development stages. At this point, our focus is to ***stabilize the API*** and ***implement the majority of functionalities***. If you notice any missing features, please consider developing them and submitting a pull request or creating a feature request. |
8 | 10 |
|
9 | | -* Implement array version all SIMDable standard library math functions (mostly done waiting on std lib [issue 2492](https://github.com/modularml/mojo/issues/2492)) |
10 | | -* Build statistics functions |
11 | | -* Build optimizers (newton raphson, bisection,etc) |
12 | | -* Build function approximators |
| 11 | +## Core Tasks |
13 | 12 |
|
14 | | -## N-dimensional Arrays |
| 13 | +- Implement the n-dimensional array type and support SIMD-compatible standard library math functions[^stdlib]. |
| 14 | +- Develop `numpy`-like functions for mathematical, statistical, linear algebra, searching, sorting, etc. |
| 15 | +- Create `scipy`-like functions for scientific purposes, such as optimizers, function approximators, and FFT. |
15 | 16 |
|
16 | | -Now that Modular has decided to no longer support array and to open source and deprecate it NuMojo intends to take array and Make it our own Once they do. |
| 17 | +### N-dimensional Arrays |
17 | 18 |
|
18 | | -Which means that we will be trying to add many of the features from numpy.array that array currently lacks, while not sacrificing performance. |
| 19 | +We have implemented basic functions and methods for the N-dimensional array `NDArray` (and also `ComplexNDArray` and `Matrix`). We are working on incorporating additional essential features similar to those in `numpy`. |
19 | 20 |
|
20 | | -## Notional organization of functions and features |
| 21 | +Currently, operations on an array return a copy. When the Mojo programming language supports parameterized traits, some operations (e.g., slicing and transpose) will return a view of the array. This will avoid excessive copying of data, increase memory reuse, and potentially enhance performance. |
21 | 22 |
|
22 | | -* Most common functions at top level like in numpy (trig, basic stats, masking, querying, and mapping) |
23 | | -* Other features should be organized either by type of math or intended utilization |
24 | | - * Statistics probably merits its own sub module |
25 | | - * Regression could either be a submodule of statistics or its own module |
26 | | - * kernel density estimators almost certainly should be part of the statistics sub module |
27 | | - * It is tempting to make a algebra, calculus and trig submodules however that may end up being confusing as those topics include so many things, it may be better to organize what would be there into functional applications instead |
28 | | - * An Ordinary differential equations submodule would include solvers and utilities |
29 | | - * The optimizer sub module could mirror scipy.optimize but minimally should include all of those functions |
30 | | -* There will need to be discussions and bike shedding about both organization of the library and what does and doesn't belong. |
| 23 | +In the future, when the Mojo programming language supports GPU functionality as it currently does with SIMD, NuMojo will also provide an option to use the GPU for calculations. |
| 24 | + |
| 25 | +### Implement Basic Numeric Functions |
| 26 | + |
| 27 | +We are currently working on implementing basic numeric functions into NuMojo. The scope is similar to `numpy`. Functions on [this page](https://numpy.org/doc/stable/reference/routines.html) will be considered for gradual implementation in NuMojo. |
| 28 | + |
| 29 | +### Implement Advanced Functions |
| 30 | + |
| 31 | +We also aim to implement advanced functions into NuMojo. The scope is similar to `scipy`. |
| 32 | + |
| 33 | +## Internal Organization of Objects and Functions |
| 34 | + |
| 35 | +NuMojo organizes modules internally according to the following structure[^numpy]: |
| 36 | + |
| 37 | +1. A `routines` folder is created under `/numojo`. Functions covered by [this page](https://numpy.org/doc/stable/reference/routines.html) will be considered for implementation in this folder. |
| 38 | +2. Sub-folders[^single] will be created under `/routines` for each topic [on this page](https://numpy.org/doc/stable/reference/routines.html). Examples include: |
| 39 | + - `/creation` (Array creation routines) |
| 40 | + - `/logic` (Logic functions) |
| 41 | + - `/mathematics` (Mathematical functions) |
| 42 | + - ... |
| 43 | +3. In each sub-folder, functions are grouped by topics into single Mojo files. For example, in the `/mathematics` folder, the following files will be created [(as classified by NumPy on this page)](https://numpy.org/doc/stable/reference/routines.math.html): |
| 44 | + - `trig.mojo` (Trigonometric functions) |
| 45 | + - `hyperbolic.mojo` (Hyperbolic functions) |
| 46 | + - `exp_log.mojo` (Exponents and logarithms) |
| 47 | + - `other.mojo` (Other special functions) |
| 48 | + - `arithmetic.mojo` (Arithmetic operations) |
| 49 | + - ... |
| 50 | +4. In each file, functions are sorted alphabetically. |
| 51 | +5. The `__init__.mojo` files of parent folders import functions from their child modules explicitly, avoiding `import *` to prevent polluting the namespace. |
| 52 | + |
| 53 | +Additionally, a `science` folder is created under `/numojo`. It is similar to the `routines` folder but contains sub-packages for features present in `scipy`[^science]. For example: |
| 54 | + |
| 55 | +Users can access the functions either directly at the top level or via sub-packages. |
| 56 | + |
| 57 | +1. Most common functions can be called from the top level, e.g., `numojo.sort()`. |
| 58 | +2. Advanced features (e.g., those listed as sub-packages in `numpy` or `scipy`) need to be called via their own namespaces. For example: |
| 59 | + - Random array generators, e.g., `numojo.random.randint()`. |
| 60 | + - Linear algebra, e.g., `numojo.linalg.solve()`. |
| 61 | + - FFT, e.g., `numojo.fft()`. |
| 62 | + - Ordinary differential equations. |
| 63 | + - Optimizers, e.g., `numojo.optimize`. |
| 64 | + |
| 65 | +[^stdlib]: Standard library functions that are SIMD-compatible. |
| 66 | +[^numpy]: The structure is inspired by the organization of functions in NumPy. |
| 67 | +[^single]: If a topic has only a few functions, they can be grouped into a single Mojo file instead of creating a separate folder. |
| 68 | +[^science]: This folder can be further integrated into the `routines` folder if necessary. |
0 commit comments