-7

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!

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Sukumar Gaonkar
  • 147
  • 2
  • 12
  • I did find the pearl implementation for the dog compiler but m unsure how to use it
    I tried using online pearl compilers line Ideone but no success
    – Sukumar Gaonkar Jul 27 '14 at 20:11
  • Near the top of that Perl script is: `"Usage: dog.pl program.dog\n"`. So I'm guessing you would use that Perl script by saving it as `dog.pl` and invoking it on the command line as described. `program.dog` would contain your DOG code. – David Jul 27 '14 at 20:11
  • Thanks do I need to install pearl compiler first if yes then what steps after installing the compiler – Sukumar Gaonkar Jul 27 '14 at 20:16
  • 1
    If you don't have a Perl interpreter then you'll need one, yes. – David Jul 27 '14 at 20:18
  • If you need the exact steps, these might vary depending on your OS. For example, if you are using Linux and have perl installed, it is as simple as downloading the script as a text file (and naming it anything you want), running `chmod +x name` (where `name` is the name of the compiler you just downloaded) and then running `./name dogsourcefile` (where `dogsourcefile` is the file containing your DOG code. **You do not need to name it dog.pl**) – Nick Meyer Jul 27 '14 at 20:21
  • 3
    It's Perl, not Pearl. – Keith Thompson Jul 27 '14 at 20:42

1 Answers1

1

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

Nick Meyer
  • 1,771
  • 1
  • 17
  • 29