#!/usr/bin/env perl6

use Cro::HTTP::Router;
use Cro::HTTP::Server;

use DSL::Shared::Utilities::MetaSpecsProcessing;
use DSL::Translators;
use Lingua::NumericWordForms;
use JSON::Fast;

use Net::ZMQ4;
use Net::ZMQ4::Constants;


my %*SUB-MAIN-OPTS = :named-anywhere;

#============================================================
# MAIN program
#============================================================
#| Start a Cro service for translation of DSLs into executable code. (OBSOLETE CLI script!)
multi sub MAIN(*@args, *%args) {
    note 'WARNING: The CLI script RakuForPredictionCroWebService is obsolete. ' ~
            'Please use dsl-translation-web-service or dsl-translation-web-service-with-wolfram-engine .';
    note 'Redirecting to dsl-translation-web-service-with-wolfram-engine .';
    my @cmd = ('dsl-translation-web-service-with-wolfram-engine', |@*ARGS);
    my $proc = run(@cmd):out:err;
    note $proc.err.slurp(:close);
    $proc.out.slurp(:close).say;
}
