Skip to main content

SahajCore

A minimalist, dynamically-typed programming language with a self-hosting interpreter — an interpreter for SahajCore, written in SahajCore itself.

Features

  • Clean C/JS-like syntax: let, fn, if/else, while, return
  • Data types: number, string, bool, list, dict, null
  • First-class functions with closures & recursion
  • Built-in self-hosting: selfhost.sahaj runs target.sahaj

Run a program

python3 main.py hello.sahaj

REPL

python3 main.py --repl

Self-Hosting (Bootstrapping)

python3 main.py selfhost.sahaj

This runs the SahajCore interpreter (written in SahajCore) which then executes target.sahaj.

Example

fn fib(n) { if n < 2 { return n } return fib(n - 1) + fib(n - 2) } let i = 0 while i < 10 { print("fib(" + str(i) + ") = " + str(fib(i))) i = i + 1 }

Release files for sahajcore 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sahajcore 4.0.0
File Size Uploaded
sahajcore-4.0.0.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sahajcore 4.0.0
File Interpreter ABI Platform
sahajcore-4.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.5 kB

Release files / sahajcore-4.0.0.tar.gz

Download URL sahajcore-4.0.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
38d1b971d5284cd184ecf36e3998fbc4bd97a00f05890af092add9c4212bc6ea
BLAKE2b-256 checksum
How to use checksums
243b458da19f18726ba3957215f26574c3f0491342a80d45a45c81bb7b3583ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / sahajcore-4.0.0-py3-none-any.whl

Download URL sahajcore-4.0.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c604f8c2af6eb7b61b192db672462de310cdc95bf530b147f0ac6393ad25070
BLAKE2b-256 checksum
How to use checksums
042f085e2570f220eea6e65cccee2cba7a871d808c7b982415a42ad27b741ad6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page