PHPackages                             capotej/pheme - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. capotej/pheme

ActivePhp-ext

capotej/pheme
=============

PHP extension that allows embedding of Scheme within PHP applications (using GNU Guile)

v0.2.2(4mo ago)011GPL-3.0-onlyPHPPHP &gt;=8.4CI passing

Since Dec 31Pushed 4mo agoCompare

[ Source](https://github.com/capotej/pheme)[ Packagist](https://packagist.org/packages/capotej/pheme)[ RSS](/packages/capotej-pheme/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Pheme
=====

[](#pheme)

Pheme is a PHP extension that allows you to use Scheme inside your PHP applications, using GNU Guile as the embedded Scheme interpreter.

Disclaimer ⚠️
-------------

[](#disclaimer-️)

This extension was almost entirely vibecoded (Kilo Code/MiniMax M2.1) for my own hobbyist needs, use it in **production at your own risk**.

Overview
--------

[](#overview)

Pheme provides a `GuileContext` class that enables PHP developers to:

- Evaluate Scheme code directly from PHP
- Create isolated execution contexts that maintain state
- Leverage Scheme's powerful functional programming features within PHP
- Share data between PHP and Scheme environments

Requirements
------------

[](#requirements)

- PHP 8.4 or higher
- GNU Guile 2.0 or higher (3.0 recommended)
- GCC or compatible C compiler
- GNU Autoconf

Installation
------------

[](#installation)

### Prerequisites

[](#prerequisites)

Install Guile using your system's package manager:

**macOS (Homebrew):**

```
brew install guile
```

**Ubuntu/Debian:**

```
sudo apt-get install guile-3.0 guile-3.0-dev
```

**Fedora/RHEL:**

```
sudo dnf install guile guile-devel
```

### Installing via PIE (Recommended)

[](#installing-via-pie-recommended)

You can install Pheme using [PIE](https://github.com/php/pie):

```
pie install capotej/pheme
```

### Installing via PECL

[](#installing-via-pecl)

You can also install Pheme using PECL:

```
pecl install capotej/pheme
```

### Building the Extension

[](#building-the-extension)

```
# Navigate to the extension directory
cd /path/to/pheme

# Generate configure script (if needed)
phpize

# Configure with Guile support
./configure --enable-pheme

# Build
make

# Run tests
make test TESTS=tests/

# Install (requires root)
sudo make install
```

### Enabling the Extension

[](#enabling-the-extension)

Add the following to your `php.ini` file:

```
extension=pheme.so
```

Verify the extension is loaded:

```
php -m | grep pheme
php -r "echo phpinfo();" | grep -A5 "pheme"
```

Usage
-----

[](#usage)

### Basic Example

[](#basic-example)

```

```

### Working with Lists and Data Structures

[](#working-with-lists-and-data-structures)

```
