Getting Started

Get up and running with Petroleum in minutes. From installation to your first program.

1

Prerequisites

Before installing Petroleum, you'll need to have Go installed on your system. Petroleum compiles to Go code under the hood, so the Go toolchain is required.

System Requirements

  • Go 1.21 or later (current: 1.25.1) - Download & Install Go
  • Windows 10/11 with Administrator privileges for installation
  • PowerShell 5.0 or later (included with Windows) for running installer
  • Command line access (PowerShell, Command Prompt, or Terminal) for compiling programs

🚀 Quick Start

Want to see Petroleum in action right away? Here's a simple program you can try after installation:

def main():
    print("Hello, Petroleum!")

Save this as hello.pet and run: petroleum run hello.pet

To check if Go is installed, open a terminal and run:

$ go version
go version go1.25.1 windows/amd64
2

Download Petroleum

Download the latest Petroleum release package. The download includes everything you need for a complete installation.

Download Petroleum v0.2.0

The download package contains:

  • Petroleum-Installer.exe - Main installer
  • petroleum.exe - CLI frontend
  • petroleumc.exe - Compiler
  • Petroleum-Uninstaller.exe - Uninstaller
3

Install Petroleum

Extract the downloaded ZIP file to any folder, then run the installer with administrator privileges.

  1. Extract the ZIP file to a temporary folder
  2. Right-click on Petroleum-Installer.exe
  3. Select "Run as administrator"
  4. Follow the installation prompts

The installer will:

  • Create C:\Program Files\Petroleum\ directory
  • Copy all executables to the installation directory
  • Add Petroleum to your system PATH
  • Set up the runtime environment
  • Install the uninstaller for easy removal later

Note: You may need to restart your terminal or PowerShell after installation for the PATH changes to take effect.

4

Verify Installation

Open a new terminal or PowerShell window and verify that Petroleum is installed correctly:

$ petroleum --version
Petroleum Programming Language v0.2.0
Created By: Jeremy Lewis

If you see the version information, Petroleum is ready to use!

5

Your First Program

Create your first Petroleum program. Open your favorite text editor and create a file called hello.pet:

def main():
    print("Hello, Petroleum!")
    
    name = "World"
    print("Hello, " + name + "!")

Save the file and run it from your terminal:

$ petroleum run hello.pet
Compiled successfully: hello.exe
Hello, Petroleum!
Hello, World!

Congratulations! You've just written and executed your first Petroleum program.

6

Basic Commands

Petroleum provides several commands to work with your code:

# Run a Petroleum file (compiles and executes)
$ petroleum run myprogram.pet

# Compile to executable without running
$ petroleum compile myprogram.pet

# Show version information
$ petroleum --version

# Get help
$ petroleum --help

🚀 What's Next?

🔧 Troubleshooting

Command not found

If you get "petroleum is not recognized as an internal or external command":

  • Restart your terminal/PowerShell
  • Check that C:\Program Files\Petroleum\bin is in your PATH
  • Re-run the installer as administrator
  • See our Common Issues FAQ below for more help

Go not found

If you get errors about Go not being found:

  • Install Go from go.dev/doc/install
  • Restart your terminal after installing Go
  • Verify with go version

Permission errors

If you encounter permission errors during compilation:

  • Make sure you have write permissions in your working directory
  • Try running your terminal as administrator

Uninstalling

To remove Petroleum from your system:

  • Run C:\Program Files\Petroleum\Petroleum-Uninstaller.exe as administrator
  • This will remove all files and PATH entries

📋 Common Issues FAQ

"petroleum is not recognized as a command"

Solution: The PATH environment variable wasn't updated properly. Restart your terminal, or manually add C:\Program Files\Petroleum\bin to your system PATH.

"go: command not found" during compilation

Solution: Install Go from go.dev/doc/install and restart your terminal.

Permission denied errors

Solution: Run your terminal as administrator, or ensure you have write permissions in your working directory.

Version mismatch errors

Solution: Ensure you have Go 1.21 or later installed. Check with go version.

Still having issues? Check the About page for community links and support resources.