<commit_before># API design

Starting points in the API design are:

- We want to embrace pure functions over the old, monolithic, stateful instance.
- Layered API: Open up low level factory functions,
  but also offer ready-made functions out of the box.
- As little magic as possible, give the user full control.
- Should be easy to understand and remember.
- Allow picking just the functions that you actually use.
- Allow picking just the data types that you use.


## Concepts

The currently proposed API has the following concepts:

1. **Loading functions**

  There are two ways to load a function:

  1.  Use ready made functions:

      ```js
      import { add, multiply } from 'mathjs'
      ```

  2.  Create a function yourself using `create` and `recipes`:

      Create a mathjs instance using `create` and factory functions.
      A factory function (like `createAdd`) typically has a number of dependencies<commit_msg>Some tweaking of the API design ideas<commit_after># API design

Starting points in the API design are:

- We want to embrace pure functions over a monolithic, stateful instance.
- We want a layered API: offer ready-made functions out of the box,
  but also allow using low level factory functions.
- We want the API to be easy to understand and remember.
- We want as little magic as possible, give the user full control.
- We want to be able to pick just the functions that you actually use.
- We want to be able to pick just the data types that you use.


## Concepts

The currently proposed API has the following concepts:

1. **Loading functions**

  There are two ways to load a function:

  1.  Use ready made functions:

      ```js
      import { add, multiply } from 'mathjs'
      ```

  2.  Create a function yourself using `create` and `recipes`:

      Create a mathjs instance using `create` and factory functions.
      A factory function (like `createAdd`) typically has a number of dependencies
{'fraction_non_alphanumeric': 0.05906522855675398, 'fraction_numerical': 0.0030816640986132513, 'mean_word_length': 3.3579418344519016, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3598697', 'n_tokens_mistral': 511, 'n_tokens_neox': 485, 'n_words': 291}