Search code examples
interpreterdog

Compiler for Dog programming language


I recently came across a new programming language - "The Dog programming language"
I was searching for a compiler for this language.

I found an article about the Dog language.

I found a Dog compiler written in the Perl language but I don't know how to use it.

Thanks in advance!


Solution

  • How to use the Perl DOG compiler

    Windows

    First, install perl and make sure it is in your path:

    Download it here: http://www.perl.org/get.html

    You can use strawberry perl (possibly the other one too).

    Then, download the compiler from http://viewsourcecode.org/code/perl/dog.txt and save it as dog.txt
    (you can actually name it whatever you want but these instructions assume you named it dog.txt).

    Make a DOG source code file. Let's assume it is called helloworld.dog.

    Here's some code you can put into helloworld.dog:

    bark "Hello world!\n"
    

    Run it in a terminal (command prompt):

    perl dog.txt helloworld.dog

    Linux/Mac/Unix

    Download the compiler:

    wget http://viewsourcecode.org/code/perl/dog.txt

    Make it executable:

    chmod +x dog.txt

    Make a DOG source code file. Let's assume it is called helloworld.dog.

    Here's some code you can put into helloworld.dog:

    bark "Hello world!\n"
    

    Run it:

    ./dog.txt helloworld.dog