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.2.tar.gz (6.6 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.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cerona-0.1.2.tar.gz
  • Upload date:
  • Size: 6.6 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.2.tar.gz
Algorithm Hash digest
SHA256 572340d54fc9a6efaad14cc6c37b9222da30e5cd5f6d1844e1db4a2a74a789f5
MD5 cc3c66c467355bc68a5d5049b2f2dc7a
BLAKE2b-256 c00cd25e710f743f5854bc2e2ab0988208c697dc9aeb5dc07b2297070a645e23

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cerona-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 467be04fd39c3077123e25844d6df8d243a4818c39ebbacb03d66d0e29b085c3
MD5 a8061e58d93c8a262e5e9bde0086e19d
BLAKE2b-256 2a46f50495f9507d30d2b6b83c1eff0161d9e09e56de759870fdc6ef47218e22

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