<commit_before># Mal/Make-a-Lisp Implmentation Hints

<a name="milliseconds"></a>

### How do I get milliseconds since epoch for the "time-ms" function?
### Does the "time-ms" function have to return millisecond since epoch?

Most languages usually have some way to do this natively even though
it might be buried deeply in the language. If you are having trouble
finding how to do this in your target language, consider asking the
question on stackoverflow (if it has not been asked already) or asking
on a discussion channel for your language because there is a good
chance somebody there knows how and will answer quickly (if there is
a native way at all).

As a last resort you can always shell out and call the date command
like this:

```
date +%s%3N
```

There are currently three implementations where this method was
necessary (probably): bash, make and vimscript. Unfortunately this
method is limited to Linux/UNIX.

Also, "time-ms" technically just needs to return accurate milliseconds
since some arbitrary point in time (even program start) in order to be
used correctly for timing/benchmarking. For consistency it is best if
it returns epoch milliseconds, but this is not strictly required if
you language limitations make it difficult (e.g. size limit of
integers).


<a name="function_references"></a>

### How do I implement core/native functions if my language does not have any sort of function references (function pointers, closures, lambdas, etc)?
### How do I implement mal functions in step4 if I do not have function references?

There are very few language that do not have any sort of function
references so I suggest asking about the specific problem you are
having on stackoverflow or a discussion channel for your language. In
the rare case where you have a language without some sort of function
reference abstraction, then you may have to implement a single
function with a large switch statement (or equivalent) that calls out<commit_msg>docs/Hints: vimscript no longer shells out in time-ms<commit_after># Mal/Make-a-Lisp Implmentation Hints

<a name="milliseconds"></a>

### How do I get milliseconds since epoch for the "time-ms" function?
### Does the "time-ms" function have to return millisecond since epoch?

Most languages usually have some way to do this natively even though
it might be buried deeply in the language. If you are having trouble
finding how to do this in your target language, consider asking the
question on stackoverflow (if it has not been asked already) or asking
on a discussion channel for your language because there is a good
chance somebody there knows how and will answer quickly (if there is
a native way at all).

As a last resort you can always shell out and call the date command
like this:

```
date +%s%3N
```

There are currently two implementations where this method was
necessary (probably): bash and make. Unfortunately this method is
limited to Linux/UNIX.

Also, "time-ms" technically just needs to return accurate milliseconds
since some arbitrary point in time (even program start) in order to be
used correctly for timing/benchmarking. For consistency it is best if
it returns epoch milliseconds, but this is not strictly required if
you language limitations make it difficult (e.g. size limit of
integers).


<a name="function_references"></a>

### How do I implement core/native functions if my language does not have any sort of function references (function pointers, closures, lambdas, etc)?
### How do I implement mal functions in step4 if I do not have function references?

There are very few language that do not have any sort of function
references so I suggest asking about the specific problem you are
having on stackoverflow or a discussion channel for your language. In
the rare case where you have a language without some sort of function
reference abstraction, then you may have to implement a single
function with a large switch statement (or equivalent) that calls out
{'fraction_non_alphanumeric': 0.047367094986142604, 'fraction_numerical': 0.0010078105316200555, 'mean_word_length': 4.712230215827338, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5343724', 'n_tokens_mistral': 973, 'n_tokens_neox': 933, 'n_words': 619}