Welcome to Clyp
Welcome to Clyp — a readable, modern, strongly-typed scripting language designed for clarity and fast iteration.
This guide is a comprehensive starting point for learning Clyp. It covers installation, first-time setup, language philosophy, and a quick walkthrough of key concepts.
What is Clyp?
Clyp is a high-level, human-centric language that blends familiar
imperative and object-oriented constructs with a concise syntax inspired
by modern scripting languages. It targets rapid prototyping and
educational use, and ships with a small standard library (clyp.stdlib)
and tooling for transpiling and executing Clyp files.
Clyp files use the .clyp extension. The tooling in this repository
supports interpreted execution (clyp run) and conversion to Python
(py2clyp/transpiler).
Installation
Clyp is distributed as a Python package. You can install it either as a user (from PyPI) or as a developer (from source).
User installation
To install the latest release from PyPI:
pip install clyp
Developer installation
To set up a local development environment:
-
Create a virtual environment (recommended):
python -m venv .venv
.\.venv\Scripts\Activate.ps1 -
Clone the repository and install in editable mode:
git clone https://github.com/clyplang/clyp.git
cd clyp
pip install -e . -
Run tests to verify your environment:
uv run -m pytest -q
Note: this project uses uv as a lightweight runner script used across
its CI and dev workflows; you can also use python -m clyp directly.
Getting started — your first program
Create a file hello_world.clyp:
Clyp does not explicitly require the function keyword, but using it can improve readability at the cost of some verbosity.
function main() returns null {
print("Hello, Clyp!");
}
main();
Run it:
clyp run hello_world.clyp
If another program on your system uses the clyp command, you can run Clyp directly with python -m clyp, or with uv run -m clyp if you are using uv. This avoids conflicts with similarly named executables.
You should see Hello, Clyp! printed to the console.
Language philosophy
Clyp prioritizes:
- Readability: clean, minimal punctuation and a line-oriented layout.
- Safety: optional type annotations and runtime checks via
typeguard. - Interoperability: easy import/export with Python and a small stdlib.
Core concepts (high level)
- Files end in
.clypand use a lightweight block syntax with{ }and semicolons to separate statements. functiondeclares top-level functions; methods may omit thefunctionkeyword to decrease verbosity.letprovides a familiar declaration idiom (transpiles to assignment in Python).importloads other Clyp modules through the project's importer which falls back to Pythonpyimportwhen specified.
Where to next
- Syntax reference — detailed grammar and examples: see
/docs/syntax/. - Types — primitives, structs/classes, and annotations: see
/docs/types/. - Standard library — writable I/O, networking helpers, random utilities:
see
/docs/stdlib/.
For more details, explore the sidebar. If you run into issues, please
check the CONTRIBUTING.md in the repository and open an issue with a
repro case.