You'll need a C compiler and a POSIX compatible operating system (Mac, Linux, BSD, etc.) to build Pyro from source. (If you're on Windows, you can use the WSL to try Pyro.)
First, download the Pyro repository from Github and
cd into the
$ git clone https://github.com/dmulholl/pyro.git $ cd pyro
Build the release binary by running:
$ make release
The release binary will be created in a new
build/release directory as
cd into the
build/release directory and try running the Pyro binary with the
--help flag to view the command line help:
$ ./pyro --help Usage: pyro [file] The Pyro programming language. Arguments: [file] Script to run. Will open the REPL if omitted. Flags: -h, --help Print this help text and exit. -v, --version Print the version number and exit. Commands: test Run unit tests. time Run timing functions. Command Help: help <command> Print the command's help text.
Running the REPL
Running the Pyro binary without any arguments launches the REPL — an interactive environment where you can run Pyro commands directly.
Try running the REPL:
At the prompt, type
echo "hello world"; and hit return:
>>> echo "hello world"; hello world
Pyro statements normally end with a semicolon,
;, but you can omit the semicolon after typing a single statement in the REPL:
>>> echo "hello world" hello world
Ctrl-D or type
exit and hit return to end the REPL session.
Running a Script
Let's make a simple test script.
Create a file called
hello.pyro and add the following line to it:
echo "hello world";
Run the script by supplying its filename to the binary:
$ ./pyro hello.pyro hello world
That's it, you can officially add Pyro to the list of languages on your CV. Take the tour if you'd like to learn more about the language.
You can find instructions for installing Pyro here.