Skip to main content

Corvus Programming Language Logo

Corvus Programming Language

A modern, clean, and general-purpose programming language built in Python — featuring explicit block scoping, static type annotations, first-class lambdas, OOP, and friendly diagnostic errors.

The StoryKey FeaturesQuickstartCode ExamplesLicense


📖 The Story Behind Corvus

"I got inspired to build my own programming language after watching a video about a programmer who created G# and C#. Since I already knew Python, I decided to take on the challenge and build my very own programming language from scratch!"
Saatvik Jain (11-Year-Old Creator of Corvus)

Corvus was born out of curiosity and a passion for computer science. Instead of relying on indentation (like Python) or curly braces (like C/JavaScript), Corvus introduces a unique syntax using square brackets [ ... ] for code blocks, reserving curly braces { ... } for native lists. It combines the ease of Python with explicit type declarations, structured error recovery, and actionable developer diagnostics.


🌟 Key Features

  • 📦 Explicit Scope Delimiters: Code blocks use brackets [ ... ] for clean, unambiguous scope boundaries.
  • 🏷️ Explicit Type Declarations: set <type>; name = value for typed variables and set const; NAME = value for immutable constants.
  • 🎯 Actionable Error Diagnostics: Custom diagnostic engine that points to the exact line/column with caret pointers (^) and actionable fix suggestions.
  • ⚡ First-Class Lambdas: Inline and block lambdas (lmb[x] => x * 2) with functional list transformations (.map(), .filter()).
  • 🧬 Object-Oriented Programming: Complete support for classes (cls Person() [ ... ]) with init constructors and self instance dispatch.
  • 🛡️ Structured Exception Recovery: try [ ... ] error(e) [ ... ] final [ ... ] blocks.
  • 📚 Native Standard Modules: Built-in modules including get math (math.pi, math.sqrt) and get system.

🚀 Quickstart

Prerequisites

Make sure you have Python 3.8+ installed on your computer.

Running a Corvus Script

Clone the repository and run any .crv file using the Corvus driver:

git clone https://github.com/YOUR_USERNAME/Corvus.git
cd Corvus
python Corvus.py test_v01.crv

💻 Code Showcase

1. Factorial Recursion & Control Flow

?{ Pure recursive function in Corvus }
mk func factorial(n) [
    if (n <= 1) [
        givout 1
    ]
    givout n * factorial(n - 1)
]

log("Factorial of 5 is:", factorial(5))

2. Lambdas & Higher-Order List Operations

set lis; numbers = {1, 2, 3, 4, 5}
set lmb; double_fn = lmb[x] => x * 2

set lis; doubled_list = numbers.map(double_fn)
log("Doubled numbers:", doubled_list)

3. Object-Oriented Class Declaration

cls Person() [
    set str; name
    set int; age

    mk func init(name_val, age_val) [
        self.name = name_val
        self.age = age_val
    ]

    mk func describe() [
        log("Person -> Name:", self.name, "| Age:", self.age)
    ]
]

set Person; user = Person("Saatvik Jain", 22)
user.describe()

4. Diagnostic Error Handling

try [
    log("Executing calculation...")
    set int; result = 10 / 0
] error(err) [
    log("Caught error safely ->", err["message"])
] final [
    log("Cleanup block executed.")
]

🏗️ Architecture & How It Works

Corvus is built using a textbook 5-stage compiler pipeline:

$$\text{Corvus Source Code (.crv)} \xrightarrow{\text{Lexer}} \text{Tokens} \xrightarrow{\text{Parser}} \text{AST} \xrightarrow{\text{Evaluator + Environment}} \text{Execution}$$

  1. Lexer (lexercorvus.py): Tokenizes source code into typed tokens while handling comments (?{ ... }) and multi-line offsets.
  2. Parser (parsercorvus.py): Recursive-descent parser constructing Abstract Syntax Tree (AST) nodes with an operator precedence ladder.
  3. AST (astnodes.py): Strongly-typed dataclass representation of all language primitives.
  4. Evaluator (evaluatorcorvus.py): AST Visitor interpreter managing lexically-scoped Environment trees and runtime dispatch.
  5. Diagnostics (errors.py): Formatted exception formatter printing precise line/column pointers and fix suggestions.

📄 License & Author

  • Author: Saatvik Jain (11-Year-Old Developer)
  • Documentation: See Corvus v0.1.0.docx for the full language reference specification.
  • License: Released under the open-source MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

corvus_lang-0.1.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

corvus_lang-0.1.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file corvus_lang-0.1.0.tar.gz.

File metadata

  • Download URL: corvus_lang-0.1.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for corvus_lang-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fd66967ca5654fc9d1b5badd9bcb27fe20f004747ae0fa9f11075922cc763e91
MD5 f20999c096fbf831895df9b07e31d964
BLAKE2b-256 00e756009c658c95a277e016d3c4292cd01a2a4389d6ca6e4b4a29a817f22e76

See more details on using hashes here.

File details

Details for the file corvus_lang-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: corvus_lang-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for corvus_lang-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4d76cf191f568e8314a018e66875d9793cca4bd073e9f2f21321e6c2c972cf9
MD5 0dc86b3dbe12c792ec68d2f47b4397eb
BLAKE2b-256 045cbe689e7e06285eb4c1667b4dad5ba5503c6d2fe78c572be084664bd60d47

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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