Skip to main content

A esolang that doesnt use any tokens or parser

Project description

Cerona

Cerona

Cerona is an unconventional esoteric programming language that takes a radical approach to language implementation: no parser, no lexer, no AST. Instead, it interprets code directly through string manipulation and token evaluation, making it a truly minimalist and experimental language.

Philosophy

Most programming languages follow a traditional architecture:

  1. Lexer → tokenizes source code
  2. Parser → builds an Abstract Syntax Tree (AST)
  3. Interpreter/Compiler → executes the AST

Cerona throws this out the window. It reads your code as raw text, splits it into tokens on-the-fly, and executes commands immediately. This makes Cerona simultaneously primitive and fascinating—a language that lives on the edge between structured programming and pure text processing.

Features

  • Zero traditional compilation phases - no lexer, parser, or AST
  • 🔄 Dynamic variable system - variables are resolved at runtime
  • 🎯 Inline conditionals - if statements with then syntax
  • 🔁 Loops - while and for constructs (implementation in progress)
  • 📦 Functions - define and call functions with parameters
  • 💬 String handling - quote-aware parsing with escape sequences
  • 🧮 Expression evaluation - arithmetic and logic through Python's eval

Installation

pip install cerona

Or install from source:

git clone https://github.com/dreamingcuriosity/cerona-lang.git
cd cerona-lang
pip install -e .

Usage

Create a .cerona file (or any text file) with Cerona code:

set x 10
set y 20
set sum x + y
print sum

if x less y then print "x is smaller"

set name "World"
print "Hello" name

Run it:

python -m cerona.main your_file.cerona

Syntax Guide

Variables

set variable_name value
set x 42
set message "Hello, Cerona!"
set result x + 10

Variables are dynamically typed and evaluated using Python expressions.

Printing

print value1 value2 value3
print x
print "The answer is" answer

Conditionals

if condition operator value then command
if x equals 10 then print "x is ten"
if count greater 5 then set flag "active"

Supported operators:

  • equals / ==
  • notequals / !=
  • greater / >
  • greaterequals / >=
  • less / <
  • lessequals / <=
  • contains - check if right value is in left value
  • in - check if left value is in right value

Functions

func add a b
    set result a + b
    return result
endfunc

call add 5 10

Input

input username "Enter your name: "
print "Hello" username

Comments

Cerona uses shell-style comments:

# This is a comment
set x 10  # Inline comment

How It Works (The Anti-Architecture)

Cerona's execution model is refreshingly simple:

  1. Read the entire source file as a string
  2. Split lines and tokenize with quote awareness
  3. Execute each command immediately by pattern matching on the first token
  4. Resolve variables by looking them up in a dictionary
  5. Repeat until the end of the file

No intermediate representations. No syntax trees. Just raw interpretation.

Example Execution Flow

set x 5
print x
  1. Line 1: Token ["set", "x", "5"] → Store variables["x"] = 5
  2. Line 2: Token ["print", "x"] → Lookup variables["x"] → Output 5

That's it. No compilation, no AST traversal, just direct execution.

Examples

Hello World

print "Hello, World!"

Calculator

input a "Enter first number: "
input b "Enter second number: "
set sum a + b
print "Sum:" sum

Function Example

func greet name
    print "Hello," name "!"
endfunc

call greet "Alice"
call greet "Bob"

Conditional Logic

input age "How old are you? "
if age greater 18 then print "You are an adult"
if age lessequals 18 then print "You are a minor"

Limitations (By Design)

  • No complex parsing - multiline expressions require workarounds
  • Limited error handling - syntax errors may produce cryptic messages
  • No type system - everything is evaluated dynamically
  • Eval-based expressions - arithmetic uses Python's eval() (sandboxed)

These aren't bugs—they're features of Cerona's radical minimalism!

Why Cerona?

Cerona is an experiment in language design minimalism. It asks: "What's the simplest possible way to execute code?" The answer isn't pretty, scalable, or fast—but it works, and it's fascinating to see how far you can get without the traditional compiler pipeline.

Perfect for:

  • 🎓 Learning how interpreters work (by seeing what they usually do)
  • 🧪 Experimenting with unconventional language design
  • 🎨 Esolang enthusiasts and minimalism lovers
  • 🤔 Understanding why parsers and ASTs exist in the first place

Contributing

Contributions are welcome! Whether it's:

  • Adding new commands
  • Improving error messages
  • Writing example programs
  • Fixing bugs

Feel free to open issues or pull requests.

License

See LICENSE file for details.

Acknowledgments

Cerona is an esoteric language experiment. It prioritizes conceptual simplicity over performance, safety, or conventional design. Use at your own risk (and amusement).


"Why parse when you can just... not?" - The Cerona Philosophy

Project details


Download files

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

Source Distribution

cerona-0.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

cerona-0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file cerona-0.1.1.tar.gz.

File metadata

  • Download URL: cerona-0.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.12.1.2 requests/2.32.5 setuptools/80.9.0 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.12.11

File hashes

Hashes for cerona-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7508ed3a796c35a649f82c4c62012696c45da290b92ab58cd0beb97c66fe4c7d
MD5 d8aff35c2950e32516d307539c1a02ea
BLAKE2b-256 4512d638e51970530ca65ddecfb984fc39fd29574e2271d7463f7e670164c266

See more details on using hashes here.

File details

Details for the file cerona-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cerona-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.12.1.2 requests/2.32.5 setuptools/80.9.0 requests-toolbelt/1.0.0 tqdm/4.67.1 CPython/3.12.11

File hashes

Hashes for cerona-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e04800073522419865bfb2c5d0a5d3ca23f268c0da13a3a3ac4a1f1ca8a0692
MD5 93874b2d4ce283e0303d1ed5ec99b81b
BLAKE2b-256 97b360b1a5d5ae9173736352fdc8c2f4fca576235921253e408c3e342b7bcf18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page