(φ) Phicode

Your Code, Your Syntax, Your Environment

Overview
Phicode is a symbolic, mathematical syntax for Python that lets you write code in a more concise and expressive way using .φ
files — while staying 100% compatible with standard Python.
With the Phicode VS Code extension you can:
- Write Python using symbols and mathematical notation.
- Run
.φ
files directly, or mix them seamlessly with .py
files in existing projects.
- Convert back and forth between Phicode ⇆ Python at any time.
Simply install the runtime with:
pip install phicode
…and you’re ready to use Phicode inside VS Code.
Features
Core Language Support
- Syntax highlighting for Phicode symbols and Python keywords
- Language configuration with auto-indentation and bracket matching
- File icon theme support for
.φ
files
- Code Formatting: Document and range formatting with configurable rules
- IntelliSense: Hover information, definition navigation, and reference finding
- Symbol Support: Document outline and workspace-wide symbol search
- Refactoring: Rename symbols across files with cross-language support
Execution & Conversion
- Code Execution: Run & debug Phicode files
- Access the benchmark suite: Run benchmark suite
- Bidirectional Conversion: Convert between Python and Phicode syntax
- Smart Tokenization: Preserves strings and comments during conversion
Productivity Features
- Interactive Tutorial: Comprehensive symbol reference with search functionality
- Code Snippets: 50+ templates for common Phicode patterns
- Configuration Support: Customizable symbol mappings and formatting options
Installation
Prerequisites
- Python 3.8+
- Phicode runtime package
Steps
- Install the Phicode runtime:
pip install phicode
- Install the extension from Visual Studio Code Marketplace:
- Open VS Code Extensions view (Ctrl+Shift+X)
- Search for "Phicode"
- Install the extension
Usage
Basic Example
Create a file with .φ
extension:
# Phicode
ƒ calculate_sum(n):
total = 0
∀ i ∈ ⟪(n):
total += i
⟲ total
π(calculate_sum(10))
# Python
def calculate_sum(n):
total = 0
for i in range(n):
total += i
return total
Commands
Phicode: Run File
- Execute current Phicode file
Phicode: Debug File
- Debug current Phicode file
Phicode: Convert to Phicode
- Convert Python to Phicode syntax
Phicode: Convert to Python
- Convert Phicode to Python syntax
Phicode: Show Tutorial
- Display interactive symbol reference
- Right click in editor or on file
Convert to Python/Phicode
for quick conversion
Keyboard Shortcuts
Ctrl+Alt+P
- Convert Python to Phicode
Ctrl+Alt+Shift+P
- Convert Phicode to Python
Configuration
The extension supports configuration through VS Code settings:
{
"phicode.autoConvert": true,
"phicode.symbolHints": true,
"phicode.formatting.spaceAroundOperators": true,
"phicode.formatting.spaceAfterCommas": true
}
Requirements
- Visual Studio Code 1.74.0 or higher
- Python 3.8 or higher
- Phicode runtime package
Roadmap
- [ ] Custom Syntax Configuration
- [ ] Linting
- [ ] Symbol insert panel
- [ ] Local API connection to engine
Support