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
3. Run Porffor
The repo comes with easy alias scripts for Unix and Windows:
Unix:
Windows:
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:
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:
- Make changes to built-in files in
compiler/builtins/
- Precompile with
./porf precompile
- Test your changes with a sample script
- Run tests with the Test262 runner (see Testing)
- Commit your changes (see Commit Style)
Example: Testing Your Setup
Create a simple test file:
// test.js
console.log('Hello from Porffor!');
Run it:
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