Skip to content

Repository files navigation

PySquirrel - A Python binding for Squirrel programming language

Squirrel is a high level imperative, object-oriented programming language, designed to be a light-weight scripting language that fits in the size, memory bandwidth, and real-time requirements of applications like video games. PySquirrel is intended to be a comprehensive binding of Squirrel 3 for Python.

github-stars

CI status
MSVC 2022 AppVeyor
pip builds Pip Actions Status
cibuildwheel Wheels Actions Status

An project built with pybind11. This requires Python 3.7+; for older versions of Python, check the commit history.

Browser demo

Try squirrel-py directly in the browser with the Pyodide demo:

https://shabbywu.github.io/squirrel-py/

The demo loads a WebAssembly wheel and runs the same SQVM example without a local Python install.

Installation

pip install squirrel-lang

Installing from source

Initialize the vendored native sources first:

git submodule update --init --recursive

The build uses vcpkg automatically when VCPKG_ROOT is set or vcpkg is on PATH. Without vcpkg, install the Python build helpers first:

python -m pip install cmake pybind11
python -m pip install .

Legacy python setup.py install is also supported for local installs, but python -m pip install . is the recommended path.

Debug trace macros are disabled by default. Enable them explicitly when needed:

TRACE_CONTAINER_GC=1 TRACE_OBJECT_CAST=1 python -m pip install .

Test call

from squirrel import SQVM

vm = SQVM()
vm.execute("""
sq <- {
function say () {
    return "hello world"
}
}
""")
sq = vm.get_roottable()["sq"]
assert str(sq.say()) == "hello world"

About

A Python binding for Squirrel programming language.

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages