<commit_before># Milk

Milk is a language that compiles into JavaScript. It is the love child of Python and JavaScript.

## Philosophy

Milk tries to be as readable and beautiful as Python without sacrificing the typical JavaScript flavor. Thus keywords and operators from JavaScript hasn’t been changed. One can even use a JavaScript syntax highlighter on Milk source code. Check out the [examples](https://github.com/yishn/milk-lang/tree/master/examples) for getting a feeling of the language.

## Language Reference

Just like Python, Milk uses significant whitespace to delimit blocks of code. Semicolons are not necessary to terminate statements, however they can be used to fit several statements onto a single line. A statement is usually terminated by a line ending, but if an expression is too long, a line break at any binary operation such as `+`, `*` or `.` won’t terminate it.

### Functions

There are several ways to define a function in Milk. That’s the standard way to do it:

```js
function square(x):
    r = x * x
    return r
```

Unlike Python you actually can pass such a function as a function argument:

```js
list = [1, 2, 3, 4, 5]

list.map(function(x):
    return x * x<commit_msg>Fix typo<commit_after># Milk

Milk is a language that compiles into JavaScript. It is the love child of Python and JavaScript.

## Philosophy

Milk tries to be as readable and beautiful as Python without sacrificing the typical JavaScript flavor. Thus keywords and operators from JavaScript hasn’t been changed. One can even use a JavaScript syntax highlighter on Milk source code. Check out the [examples](https://github.com/yishn/milk-lang/tree/master/examples) for getting a feeling of the language.

## Language Reference

Just like Python, Milk uses significant whitespace to delimit blocks of code. Semicolons are not necessary to terminate statements, however they can be used to fit several statements onto a single line. A statement is usually terminated by a line ending, but if an expression is too long, a line break at any binary operator such as `+`, `*` or `.` won’t terminate it.

### Functions

There are several ways to define a function in Milk. That’s the standard way to do it:

```js
function square(x):
    r = x * x
    return r
```

Unlike Python you actually can pass such a function as a function argument:

```js
list = [1, 2, 3, 4, 5]

list.map(function(x):
    return x * x
{'fraction_non_alphanumeric': 0.06716417910447761, 'fraction_numerical': 0.0041459369817578775, 'mean_word_length': 4.112288135593221, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2906547', 'n_tokens_mistral': 663, 'n_tokens_neox': 624, 'n_words': 362}