A modern Python runtime for Forthic - a stack-based, concatenative programming language
Project description
Forthic Python Runtime
A Python runtime for Forthic - a stack-based, concatenative programming language.
Installation (Development)
cd forthic-py
pip install -e ".[dev]"
Quick Start
import asyncio
from forthic import Interpreter
async def main():
interp = Interpreter()
# Push some numbers
await interp.run("42 3.14 TRUE")
# Create an array
await interp.run("[1 2 3]")
# Define a word
await interp.run(": DOUBLE 2 * ;")
# Get the stack
stack = interp.get_stack()
print("Stack:", stack.get_items())
asyncio.run(main())
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=forthic
# Run specific test file
pytest tests/test_tokenizer.py
# Run with verbose output
pytest -v
License
BSD 2-Clause License - See LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
forthic_py-0.1.0.tar.gz
(136.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forthic_py-0.1.0.tar.gz.
File metadata
- Download URL: forthic_py-0.1.0.tar.gz
- Upload date:
- Size: 136.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45e106787e66325257a67a2d9aff8b9d1fbd92c0c34ef0d878c8f6d2e8157cad
|
|
| MD5 |
46080394fe322232c15ca8d608d306b8
|
|
| BLAKE2b-256 |
e2fb157c29f27003d2a05b6b5b4e13d095b3b6e4c522a980ce2094cb46d43ee8
|
File details
Details for the file forthic_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: forthic_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 78.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4f91e2cf13dc5448d1ac1a99d1f6388f867cb113c8febfc6db650f1613e563d
|
|
| MD5 |
e1cc04498f789ef410f155d330b0763f
|
|
| BLAKE2b-256 |
33c858e3f7d9de013c490f337fe08bb5425de73227e35d76bc4c406cae8fd05e
|