Skip to main content
Hello! Thanks for your potential interest in contributing to Porffor. This guide will help you set up your development environment and understand the workflow.

Prerequisites

You should have:
  • Decent JavaScript knowledge
  • Some basic TypeScript (nothing complicated)
  • Low-level understanding (pointers, etc.) is a plus but not required
  • WebAssembly knowledge is helpful but not required

Setup

1. Clone the Repository

git clone https://github.com/CanadaHonk/porffor.git
cd porffor

2. Install Dependencies

npm install

3. Run Porffor

The repo comes with easy alias scripts for Unix and Windows: Unix:
./porf path/to/script.js
Windows:
.\porf path/to/script.js
You can also swap out node in the alias to use another runtime:
  • Deno: deno run -A runtime/index.js ...
  • Bun: bun runtime/index.js ...
Node, Deno, and Bun should all work.

Precompile Workflow

Critical: If you update any file inside compiler/builtins, you must precompile for your changes to take effect.
Run the precompile command:
./porf precompile
This compiles the TypeScript built-ins into a format the compiler can use. If you see errors:
  • You might have a syntax error in your code
  • There could be a compiler error with Porffor
  • Feel free to ask for help in the Porffor Discord

Development Workflow

A typical development cycle looks like:
  1. Make changes to built-in files in compiler/builtins/
  2. Precompile with ./porf precompile
  3. Test your changes with a sample script
  4. Run tests with the Test262 runner (see Testing)
  5. Commit your changes (see Commit Style)

Example: Testing Your Setup

Create a simple test file:
// test.js
console.log('Hello from Porffor!');
Run it:
./porf test.js
You should see the output printed to the console.

Getting Help

If you have any questions or get stuck:
  • Join the Porffor Discord
  • Ask anything - the community is friendly and helpful
  • Don’t hesitate to ask for help with errors or concepts

Next Steps

Build docs developers (and LLMs) love