<commit_before>GOALS: Language Features
------------------------

* Basic Types:
    * Functions: (args) => {body; return result}
    * Variables: variableName = value
    * Operators: prefix, postfix, infix
    * Boolean: true, false
* Split multiple statements with semicolon (;)
* Ability to define operators as functions with precedence
* Quantities can have a unit or be dimensionless (a unit of `unit`)
* Comments begin with `#`
* Functions with default arguments
* Valid characters for variable name/operator:
    `a-zA-Z0-9$_^&*!@%+?<>.:/\|~'"\``
* Ability to create JavaScript modules that tap into the interpreter
    * `middleware` hooks into various things such as finding undefined variables (could be used to define numbers, constants, etc.)
    * Side-effects of this: you could potentially do things like
        define `2 = 9` if you want...might be dangerous (but also 
        extremely powerful)
    * If middleware is done right, it could enable extensions to provide
        additional functionality like `const` function or an `override` 
        function for storing whether certain symbols are constant 
        or variable and then overriding that information when necessary
* Basic definitions written in the language loaded initially (like Prelude)
* Functions define closures
* Numbers are simply symbols that can be reduced like anything else (same with true and false)
* Short circuit evaluation
* Exceptions thrown using special functions (`error(message)`, `assert(boolean)`, `inRange(value, start, end)`, etc.)
* Anything that isn't defined is automatically a special Symbol type (useful for isinstance checking)
* Lazy by default (makes `if` easier to implement)

Supported Expressions:
----------------------

    $ # simple arithmetic
    $ 2 + 2 * 3
    = 8
    $ # parenthesis change operator precedence
    $ # fractions are automatically preserved
    $ 2 * (3 + 2) / 4
    = 5 / 2
    $ # force fraction evaluation with the ! postfix operator
    $ (5 / 2)!
    = 2.5
    $ # defining a function
    $ # functions automatically get the highest precedence as do most symbols or numbers
    $ f = (x) => 2 * x
    $ # functions are simply prefix operators
    $ # evaluating with a defined value
    $ f 3
    = 6
    $ # evaluating with an undefined value
    $ f x
    = (x) => 2 * x
    $ f y
    = (y) => 2 * y
    $ # defining an operator
    $ # POSTFIX is simply a variable
    $ operator POSTFIX 7 doubled f
    $ 7 doubled<commit_msg>Added possible extensions and defined values for true and false (they are just 1 and 0 now)<commit_after>GOALS: Language Features
------------------------

* Basic Types:
    * Functions: (args) => {body; return result}
    * Variables: variableName = value
    * Operators: prefix, postfix, infix
    * Boolean: true = 1, false = 0
* Split multiple statements with semicolon (;)
* Ability to define operators as functions with precedence
* Quantities can have a unit or be dimensionless (a unit of `unit`)
* Comments begin with `#`
* Functions with default arguments
* Valid characters for variable name/operator:
    `a-zA-Z0-9$_^&*!@%+?<>.:/\|~'"\``
* Ability to create JavaScript modules that tap into the interpreter
    * `middleware` hooks into various things such as finding undefined variables (could be used to define numbers, constants, etc.)
    * Side-effects of this: you could potentially do things like
        define `2 = 9` if you want...might be dangerous (but also 
        extremely powerful)
    * If middleware is done right, it could enable extensions to provide
        additional functionality like `const` function or an `override` 
        function for storing whether certain symbols are constant 
        or variable and then overriding that information when necessary
* Basic definitions written in the language loaded initially (like Prelude)
* Functions define closures
* Numbers are simply symbols that can be reduced like anything else (same with true and false)
* Short circuit evaluation
* Exceptions thrown using special functions (`error(message)`, `assert(boolean)`, `inRange(value, start, end)`, etc.)
* Anything that isn't defined is automatically a special Symbol type (useful for isinstance checking)
* Lazy by default (makes `if` easier to implement)
* Possible extensions:
    * Varadic parameters (i.e. (...args) => args) - requires support for arrays

Supported Expressions:
----------------------

    $ # simple arithmetic
    $ 2 + 2 * 3
    = 8
    $ # parenthesis change operator precedence
    $ # fractions are automatically preserved
    $ 2 * (3 + 2) / 4
    = 5 / 2
    $ # force fraction evaluation with the ! postfix operator
    $ (5 / 2)!
    = 2.5
    $ # defining a function
    $ # functions automatically get the highest precedence as do most symbols or numbers
    $ f = (x) => 2 * x
    $ # functions are simply prefix operators
    $ # evaluating with a defined value
    $ f 3
    = 6
    $ # evaluating with an undefined value
    $ f x
    = (x) => 2 * x
    $ f y
    = (y) => 2 * y
    $ # defining an operator
    $ # POSTFIX is simply a variable
    $ operator POSTFIX 7 doubled f
    $ 7 doubled
{'fraction_non_alphanumeric': 0.09951503394762366, 'fraction_numerical': 0.010475266731328807, 'mean_word_length': 2.9600614439324118, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '692474', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1295, 'n_words': 632}