<commit_before>#ifndef ATL_HPP
#define ATL_HPP
/**
 * @file /home/ryan/programming/atl/atl.hpp
 * @author <NAME> <<EMAIL>>
 * Created on Feb 07, 2015
 */

#include <type.hpp>
#include <tiny_vm.hpp>
#include <primitive_callable.hpp>
#include <compile.hpp>
#include <gc.hpp>
#include <parser.hpp>
#include <environment.hpp>
#include <compile.hpp>
#include <print.hpp>

namespace atl {
    struct Atl {
        GC gc;
        ParseString parse;
        Environment env;
        Compile compile;
        TinyVM vm;

        Atl() : parse(gc), env(gc), compile(env) {
            setup_interpreter(env, parse);
        }

        Any eval(Any value)
        {
            auto tag = compile.any(value);
            compile.assert_ready();
#ifdef DEBUGGING
            compile.print();
            vm.run_debug(*compile.wrapped.output, compile.wrapped.main_entry_point);
#else
            vm.run(*compile.wrapped.output, compile.wrapped.main_entry_point);
#endif
            compile.repl_reset();

            return Any(tag, reinterpret_cast<void*>(vm.stack[0]));
        }

	    // Parse, compile, and run the first sexpr in a string
        Any string_(const std::string& ss) {
	        return eval(parse.string_(ss));
        }

	    // Parse, compile, and run all the sexprs in a stream
        Any stream(istream& ss)
	    {
		    Any rval;
		    while(ss.peek() != EOF)<commit_msg>Update Atl debugging output<commit_after>#ifndef ATL_HPP
#define ATL_HPP
/**
 * @file /home/ryan/programming/atl/atl.hpp
 * @author <NAME> <<EMAIL>>
 * Created on Feb 07, 2015
 */

#include <type.hpp>
#include <tiny_vm.hpp>
#include <primitive_callable.hpp>
#include <compile.hpp>
#include <gc.hpp>
#include <parser.hpp>
#include <environment.hpp>
#include <compile.hpp>
#include <print.hpp>

namespace atl {
    struct Atl {
        GC gc;
        ParseString parse;
        Environment env;
        Compile compile;
        TinyVM vm;

        Atl() : parse(gc), env(gc), compile(env) {
            setup_interpreter(env, parse);
        }

        Any eval(Any value)
        {
            auto tag = compile.any(value);
            compile.assert_ready();
#ifdef DEBUGGING
            compile.dbg();
            vm.run_debug(*compile.wrapped.output, compile.wrapped.main_entry_point);
#else
            vm.run(*compile.wrapped.output, compile.wrapped.main_entry_point);
#endif
            compile.repl_reset();

            return Any(tag, reinterpret_cast<void*>(vm.stack[0]));
        }

	    // Parse, compile, and run the first sexpr in a string
        Any string_(const std::string& ss) {
	        return eval(parse.string_(ss));
        }

	    // Parse, compile, and run all the sexprs in a stream
        Any stream(istream& ss)
	    {
		    Any rval;
		    while(ss.peek() != EOF)
{'fraction_non_alphanumeric': 0.12752161383285301, 'fraction_numerical': 0.005043227665706052, 'mean_word_length': 2.353864734299517, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '2378053', 'n_tokens_mistral': 923, 'n_tokens_neox': 872, 'n_words': 212}