README-work

DSL::Translators (Comprehensive Translation by DSL parser-interpreters)

This Raku package provides comprehensive multi-DSL translations.

Installation

From Zef ecosystem:

zef install DSL::Translators

From GitHub:

zef install https://github.com/antononcube/Raku-DSL-Translators.git

Via a script

The package "DSL::Translators" depends on a large number of specialized DSL Raku packages and several LLM packages.

See the installation code in the resource file "zsh-nuke-and-install.sh".

(For faster installation the installation commands have --/test.)

Usage

Here we load the package:

use DSL::Translators;

Here is an example that shows:

  • Automatic determination of the DSL grammar

  • JSON format of the result

ToDSLCode('
    use dfStarWars;
    select the columns name, species, mass and height;
    cross tabulate species over mass', 
        format => 'JSON');

In the example above the function ToDSLCode figured out that the sequence of commands (separated by semicolon) specifies a data transformation workflow. See [AAr2].

Here is an example using Bulgarian data transformation spec that explicitly specifies:

  • DSL parser to use (with the first command)

  • Language (Bulgarian)

  • Default targets spec that is usually a programming language name ("Python")

ToDSLCode('
    DSL module DataQueryWorkflows;
    използвай dfStarWars;
    избери колоните name, species, mass и height;
    крос табулация на species върху mass', 
        language => 'Bulgarian',
        default-targets-spec => 'Python',
        format => 'Code');

The function dsl-translation is a version of ToDSLCode that is intended to be used in command line and web interfaces. It returns a Hash object. Here is an example:

my %res = dsl-translation('
    USER ID dd7833sa;
    DSL MODULE DataQueryWorkflows;
    use dfStarWars;
    select the columns name, species, mass and height;
    cross tabulate species over mass');
.say for %res;

CLI

The package provides several Command Line Interface (CLI) scripts:

CLIDescription
dsl-translationDSL translation with the package
dsl-web-translationDSL translation using a Web service provided by this package
dsl-web-translation-serviceStarts a Web service for DSL translation
dsl-web-translation-service-with-wolfram-engineStarts a Web service for DSL translation which can also use Wolfram Engine

Here is the usage message of dsl-translation:

dsl-translation --help

The DSL Web translation can be seen (tried on) with this interactive interface.

Remark: dsl-web-translation-service provides a service that has both grammar-based and LLM-based DSL translations.

References

Articles, blog posts

[AA1] Anton Antonov, "Multi-language Data Wrangling and Acquisition Conversational Agents presentation", (2021), RakuForPreiction at WordPress.

[AA2] Anton Antonov, "Fast and compact classifier of DSL commands", (2022), RakuForPreiction at WordPress.

[AA3] Anton Antonov, "DSL::Bulgarian", (2022), RakuForPreiction at WordPress.

Packages

[AAp1] Anton Antonov, DSL::English::ClassificationWorkflows, Raku package, (2020-2024), GitHub/antononcube.

[AAp2] Anton Antonov, DSL::English::DataAcquisitionWorkflows, Raku package, (2021-2024), GitHub/antononcube.

[AAp3] Anton Antonov, DSL::English::DataQueryWorkflow, Raku package, (2020-2024), GitHub/antononcube.

[AAp4] Anton Antonov, DSL::English::EpidemiologyModelingWorkflows, Raku package, (2020-2026), GitHub/antononcube.

[AAp5] Anton Antonov, DSL::English::FoodPreparationWorkflows, Raku package, (2021-2026), GitHub/antononcube.

[AAp6] Anton Antonov, DSL::English::LatentSemanticAnalysisWorkflows, Raku package, (2020-2024), GitHub/antononcube.

[AAp7] Anton Antonov, DSL::English::QuantileRegressionWorkflows, Raku package, (2020-2024), GitHub/antononcube.

[AAp8] Anton Antonov, DSL::English::RecommenderWorkflows, Raku package, (2020-2025), GitHub/antononcube.

[AAp9] Anton Antonov, DSL::English::SearchEngineQueries, Raku package, (2020-2024), GitHub/antononcube.

[AAp10] Anton Antonov, DSL::Bulgarian, Raku package, (2022-2026), GitHub/antononcube.

[AAp11] Anton Antonov, ML::FindTextualAnswer, Raku package, (2023-2026), GitHub/antononcube.

[AAp12] Anton Antonov, ML::NLPTemplateEngine, Raku package, (2023-2025), GitHub/antononcube.

Repositories

[AAr1] Anton Antonov, "Raku for Prediction" book, (2021), GitHub/antononcube.

Videos

[AAv1] Anton Antonov, "Multi-language Data-Wrangling Conversational Agent", (2020), Wolfram Technology Conference 2020.

[AAv2] Anton Antonov, "Raku for Prediction, (2021), The Raku Conference 2021.

DSL::Translators v0.1.1

DSL-to-DSL translation with multiple DSLs.

Authors

  • Anton Antonov

License

Artistic-2.0

Dependencies

Clipboard:ver<0.1.1+>JSON::Fast:ver<0.19+>HTTP::UserAgentCro::HTTPLingua::NumericWordForms:ver<0.6.2+>Chemistry::Stoichiometry:ver<0.1.10+>ML::TriesWithFrequencies:ver<0.6.7+>LLM::Functions:ver<0.1.24+>ML::FindTextualAnswer:ver<0.2.5+>ML::NLPTemplateEngine:ver<0.1.3+>DSL::Shared:ver<0.2.11+>DSL::English::ClassificationWorkflows:ver<0.1.5+>DSL::English::DataAcquisitionWorkflows:ver<0.1.0+>DSL::English::DataQueryWorkflows:ver<0.6.5+>DSL::English::EpidemiologyModelingWorkflowsDSL::English::FoodPreparationWorkflows:ver<0.1.0+>DSL::English::LatentSemanticAnalysisWorkflows:ver<0.8.3>DSL::English::QuantileRegressionWorkflows:ver<0.8.3+>DSL::English::RecommenderWorkflows:ver<0.6.4+>DSL::English::SearchEngineQueries:ver<0.5.0+>DSL::Bulgarian:ver<0.1.1+>Test::OutputURI::Encode

Test Dependencies

Provides

  • DSL::Translators

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.