Skip to main content

Greyalien Language (Prototype)

CI PyPI TestPyPI

This is a prototype implementation of the Greyalien language concept: a new, experimental programming language designed to surpass traditional systems languages in clarity and safety.

This ZIP includes:

  • SPEC.md – Greyalien v0 conceptual language design.
  • SPEC_V0.md – the subset spec implemented by this interpreter.
  • GREYALIEN_CORE.md – core design principles.
  • GREYALIEN_VISION.md – long-term vision and roadmap.
  • compiler_architecture.md – high-level architecture for a future native Greyalien compiler.
  • LICENSE – MIT license.
  • CONTRIBUTING.md – contribution guide.
  • CHANGELOG.md – release notes.
  • RELEASE.md – release checklist.
  • ROADMAP.md – v0.2 scope and priorities.
  • TRIAGE.md – issue triage guide.
  • Makefile – release helper targets.
  • greyalien/ – a minimal Greyalien interpreter implemented in Python for a small v0 subset.
  • examples/ – runnable .grl programs.

Note: The interpreter is intentionally small. It runs a Greyalien subset with functions, conditionals, loops, records, lists, match expressions, enums, imports, arithmetic, booleans, and printing. It is meant as a working playground, not a production compiler.

A minimal static type checker for Int, Bool, and String runs before execution and reports type errors.

What's new in v0.3.0

  • match expressions, enums, and enum payloads.
  • Module imports with a minimal loader.
  • Conformance fixtures and parser fuzz coverage.

Unreleased (main branch)

  • Scoped module namespaces (imports require qualification, e.g. math.add(...)).
  • Explicit exports (export { ... }) control module visibility.
  • Exported enums are type-only; variants must be listed explicitly.
  • Enum payload bindings in match patterns (for example, Some(x)).
  • Module-qualified enum types in annotations (for example, colors.Color).

Requirements

  • Python 3.9+

Install from PyPI

python -m pip install greyalien-prototype

Create a file hello.grl:

fn main() {
  print("Hello from Greyalien!");
}

Run it:

greyalien run hello.grl

Install from source

python -m pip install -e .

Then run:

greyalien run examples/hello.grl

Running examples

From the directory where you unpack the ZIP:

python -m greyalien.cli examples/hello.grl

Or with the unified CLI:

python -m greyalien run examples/hello.grl

You should see:

Hello from Greyalien!

Another example:

python -m greyalien.cli examples/math.grl

Or:

python -m greyalien run examples/math.grl

Expected output:

Result is 42

Module example with qualified enum types:

python -m greyalien run examples/modules/type_qual_demo.grl

Expected output:

red

Logic example:

python -m greyalien.cli examples/logic.grl

For-loop example:

python -m greyalien.cli examples/for_demo.grl

Typed example:

python -m greyalien.cli examples/typed.grl

Record example:

python -m greyalien.cli examples/records.grl

List example:

python -m greyalien.cli examples/list_demo.grl

Match example:

python -m greyalien.cli examples/match_demo.grl

Enum example:

python -m greyalien.cli examples/enum_demo.grl

Enum payload example:

python -m greyalien.cli examples/enum_payload_demo.grl

Module/import example:

python -m greyalien.cli examples/modules/module_demo.grl

Running tests

python -m unittest discover -s tests

Maintainer notes

  • Issue triage flow and labels: TRIAGE.md
  • Label definitions live in .github/labels.yml and sync via the Label Sync workflow

Type checking only

python -m greyalien check examples/typed.grl

CLI quick reference

greyalien <file.grl>
greyalien run <file.grl>
greyalien check <file.grl>
greyalien ir <file.grl>
greyalien --all-errors <file.grl>
greyalien run --all-errors <file.grl>
greyalien check --all-errors <file.grl>
greyalien --version
greyalien --help

CLI help example

greyalien --help
Usage:
  greyalien <file.grl>
  greyalien run <file.grl>
  greyalien check <file.grl>
  greyalien ir <file.grl>
  greyalien --all-errors <file.grl>
  greyalien run --all-errors <file.grl>
  greyalien check --all-errors <file.grl>
  greyalien --version
  greyalien --help

Options:
  --all-errors  Show all parse errors instead of the first.

Parse error diagnostics

Use --all-errors to report every parse error in one run:

greyalien check --all-errors examples/for_demo.grl

Subset supported by the interpreter

  • Optional module declaration (ignored at runtime):

    module main
    
  • Function definitions:

    fn main() {
      print("Hello");
    }
    
    fn add(a, b) {
      return a + b;
    }
    
  • Optional type annotations (checked before execution):

    fn add(a: Int, b: Int) -> Int {
      return a + b;
    }
    
    fn main() {
      let x: Int = 1;
      print("x = " + x);
    }
    

    Type errors include line/column locations where available.

  • let bindings inside functions:

    fn demo() {
      let x = 10;
      let y = x * 2;
      print(y);
    }
    
  • set assignments to update existing bindings:

    fn demo() {
      let count = 0;
      set count = count + 1;
    }
    
  • while loops:

    fn demo() {
      let i = 0;
      while i < 3 {
        print(i);
        set i = i + 1;
      }
    }
    
  • for loops over integer ranges:

    fn demo() {
      for i in 0..10 by 2 {
        print(i);
      }
    }
    

    Use start..end for exclusive ranges or start..=end for inclusive ranges. Add by step to control the step size.

  • break and continue inside loops:

    fn demo() {
      for i in 0..10 {
        if i == 2 { continue; } else { print(i); };
        if i == 5 { break; } else { 0; };
      }
    }
    
    fn demo() {
      let i = 0;
      while true {
        set i = i + 1;
        if i == 2 { continue; } else { 0; };
        if i == 4 { break; } else { 0; };
      }
    }
    
  • return statements in functions.

  • Expressions:

    • Integer literals: 1, 42
    • String literals: "hello"
    • Boolean literals: true, false
    • Record literals: {x: 1, y: 2}
    • List literals: [1, 2, 3]
    • Unary operators: -expr, !expr
    • Binary operators: +, -, *, /, ==, !=, <, <=, >, >=, &&, ||
    • Field access: expr.field
    • Indexing: expr[index]
    • Parentheses: (expr)
    • if expressions: if cond { expr; } else { expr; }
    • else if is supported as sugar for else { if ... }
  • Function calls: name(arg1, arg2)

  • Built-in print(...) for output.

Types supported by the checker: Int, Bool, String, Unit.

Anything else will result in a parse or runtime error.

Example Greyalien program

module main

fn main() {
  let a = 40;
  let b = 2;
  let result = a + b;
  print("Result is " + result);
}

This runs on the interpreter and prints:

Result is 42

Enjoy experimenting with Greyalien!

Metadata

Release files for greyalien-prototype 0.3.1

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

Source distribution (sdist)

Source distribution for greyalien-prototype 0.3.1
File Size Uploaded
greyalien_prototype-0.3.1.tar.gz 50.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for greyalien-prototype 0.3.1
File Interpreter ABI Platform
greyalien_prototype-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 82.9 kB

Release files / greyalien_prototype-0.3.1.tar.gz

Download URL greyalien_prototype-0.3.1.tar.gz
Size 50.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8de7c4758879ab5158563017734942cb8324e5052729c83749744a26aa2a1ac3
BLAKE2b-256 checksum
How to use checksums
51bef8a0b81af6431254446408407b02248ea7039336a88071835ddee9fc2ebb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.

Transparency log

Release files / greyalien_prototype-0.3.1-py3-none-any.whl

Download URL greyalien_prototype-0.3.1-py3-none-any.whl
Size 32.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4564b3de1d716dc1ecf9a69389852a9fb5dd1e61fb982dac2fe0bfb3017911a
BLAKE2b-256 checksum
How to use checksums
8de5533a9c8403daca281cff4475ca2ca29aaffbf296097a26115c562a0e5d6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

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