<commit_before>use v6;
unit class HTTP::Server::Tiny;

use Raw::Socket::INET;
use NativeCall;

my class IO::Scalar::Empty {
    method eof() { True }
    method read(Int(Cool:D) $bytes) {
        my $buf := buf8.new;
        return $buf;
    }
}

has $.port = 80;
has $.host = '127.0.0.1';

has $!sock;

has %pids;

has Bool $shown-banner;

my Buf $http_header_end_marker = Buf.new(13, 10, 13, 10);

sub info($message) {
    say "[INFO] [{$*THREAD.id}] $message";
}

sub debug($message) {
    say "[DEBUG] [{$*THREAD.id}] $message";
}

module private {
    our sub waitpid(Int $pid, CArray[int] $status, Int $options)
            returns Int is native { ... }
}

my sub fork()<commit_msg>use macro for better performance<commit_after>use v6;
unit class HTTP::Server::Tiny;

use Raw::Socket::INET;
use NativeCall;

my class IO::Scalar::Empty {
    method eof() { True }
    method read(Int(Cool:D) $bytes) {
        my $buf := buf8.new;
        return $buf;
    }
}

has $.port = 80;
has $.host = '127.0.0.1';

has $!sock;

has %pids;

has Bool $shown-banner;

my Buf $http_header_end_marker = Buf.new(13, 10, 13, 10);

sub info($message) {
    say "[INFO] [{$*THREAD.id}] $message";
}

constant DEBUGGING = %*ENV<DEBUGGING>.Bool;

macro debug($message) {
    if DEBUGGING {
        quasi {
            say "[DEBUG] [{$*THREAD.id}] " ~ {{{$message}}};
        }
    }
}

module private {
    our sub waitpid(Int $pid, CArray[int] $status, Int $options)
            returns Int is native { ... }
}

my sub fork()
{'fraction_non_alphanumeric': 0.176158940397351, 'fraction_numerical': 0.02384105960264901, 'mean_word_length': 2.9348958333333335, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '205093', 'n_tokens_mistral': 599, 'n_tokens_neox': 569, 'n_words': 153}