<commit_before>#!/bin/bash

set -eu

FLAGS="-O1 -g4"
export EMCC_DEBUG=1
if [[ "${1-}" == "release" ]]; then
  export EMCC_DEBUG=0
  FLAGS="-Os"
  echo "Release mode (\"${FLAGS}\")" >&2
elif [[ "${1-}" != "" ]]; then
  echo "Unknown mode: $1" >&2
  exit 1
fi

# needed if we're not SIDE_MODULE
#   -s ERROR_ON_UNDEFINED_SYMBOLS=0 \

# causes signature mismatch but no size/speed changes
#   -s ONLY_MY_CODE=1 \

# TOTAL_MEMORY/TOTAL_STACK are set to a single page each: we put stack at the end of memory
# (Emscripten is dumb and stack would go forever otherwise) and this lets us pass as much memory as
# we like on creation inside JS.

emcc $FLAGS \
  -s EMIT_EMSCRIPTEN_METADATA=1 \
  -s SIDE_MODULE=1 \
  -s TOTAL_MEMORY=65536 \
  -s TOTAL_STACK=65536 \
  -o runner.wasm \
  *.c ../*.c ../simple/simple.c

echo "Ok! => runner.wasm"<commit_msg>compile helper<commit_after>#!/bin/bash

set -eu

FLAGS="-O1 -g4"
export EMCC_DEBUG=1
if [[ "${1-}" == "release" ]]; then
  export EMCC_DEBUG=0
  FLAGS="-Os"
  echo "Release mode (\"${FLAGS}\")" >&2
elif [[ "${1-}" != "" ]]; then
  echo "Unknown mode: $1" >&2
  exit 1
fi

# needed if we're not SIDE_MODULE
#   -s ERROR_ON_UNDEFINED_SYMBOLS=0 \

# causes signature mismatch but no size/speed changes
#   -s ONLY_MY_CODE=1 \

# TOTAL_MEMORY/TOTAL_STACK are set to a single page each: we put stack at the end of memory
# (Emscripten is dumb and stack would go forever otherwise) and this lets us pass as much memory as
# we like on creation inside JS.

emcc $FLAGS \
  -s EMIT_EMSCRIPTEN_METADATA=1 \
  -s SIDE_MODULE=1 \
  -s TOTAL_MEMORY=65536 \
  -s TOTAL_STACK=65536 \
  -o runner.wasm \
  *.c ../*.c ../tokens/helper.c ../simple/simple.c

echo "Ok! => runner.wasm"

{'fraction_non_alphanumeric': 0.14635568513119535, 'fraction_numerical': 0.027988338192419825, 'mean_word_length': 3.2162162162162162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3771934', 'n_tokens_mistral': 710, 'n_tokens_neox': 662, 'n_words': 209}