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.5.tar.gz (7.5 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.5-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cerona-0.1.5.tar.gz
  • Upload date:
  • Size: 7.5 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.5.tar.gz
Algorithm Hash digest
SHA256 c0bae3354c3fd0ae52e0db5aef67783a238d18000ec5c7ac239f22ae63f8f19a
MD5 c64b0aec46296b0301fb11a53f697916
BLAKE2b-256 61c39e28613f68aa55cf4a5096da290822d406ae474926d1b829dd96e2b27ed2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cerona-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d243793498b983151056e715fd76c395745fa610dd4cb0e630e30af1fb0ccc6b
MD5 bb4e3983c90a02134341b4d3a681de1e
BLAKE2b-256 228f5fa0b69a35b4d0c4fa386ea77ac6497dd8800f580c9acb53524a0c03dd1e

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