Skip to main content

Programming language which only uses alphabetical characters

Project description

abyz

abyz is a joke programming language which only employs alphabetical characters. All variables, functions and classes must be defined with letters from the alphabet. No other symbols such numbers or ()/.,; are allowed. Useful for very limited keyboards, I guess.

abyz is a transpiled programming language, whose transpiler converts the abyz code to python, and runs with python under the hood. Thus, it keeps all the python performance but with a tasty anumerical syntax.

Syntax overview

Here are the key points of the abyz syntax:

  • Only alphabetical letters (from a to z) are considered. Numbers and other symbols like ()/.,; are not allowed.
  • Hence, abyz relies on keywords for different functionalities. For instance:
    • A function in other languages written as f(x) is written in abyz as f argo x argc. Much simpler without these stupid parentheses, isn't?
    • Why writting pi=3.1415 like in most languages when you can just write pi equal threedotonefouronefive in abyz?
  • Identation is mandatory for functions, classes and control structures, in a similar way to python.
  • Spaces can be used to make clear code, but not mandatory, i.e., aequalthreetimestwo is equivalent to a equal three times two (or in other boring languages, a=3*2).

Installation

Install the abyz transpiler with

pip install abyz

Usage

To run an abyz code, just run:

abyz -s name_of_the_code.abyz -x

The available flags are:

  • -s, --source: path to the source abyz code to be run.
  • -o, --output: path to the output transpiled python code.
  • -x, --exec: include to run the output program, otherwise it only transpiles it.

Examples

The following are simple examples to showcase the syntax of abyz. Run them with abyz -s examples/name_of_the_code.abyz -x.

  1. Hello World.
print quot Hello World quot
  1. Compute the area of a circle.
pi equal threedotonefouronefiveninetwo

fun area argo r argc

    a equal pi times r times r
    return a

r equal two

a equal area argo r argc
print a
  1. Compute the n first Fibonacci numbers.
fun fibonacci argo n argc

    if n less zero
        print quot Incorrect input quot

    elif n equalequal zero
        return zero

    elif n equalequal one or n equalequal two
        return one

    else
        return fibonacci argo n minus one argc plus fibonacci argo n minus two argc

n equal nine
print fibonacci argo n argc
  1. Print a fractal Mandelbrot set with ASCII characters, based on this implementation.
fun asciimap argo x argc
    if x less zerodottwofive
        return quotdotquot
    elif x less zerodotfive
        return quotxquot
    elif x less zerodotsevenfive
        return quotOquot
    else
        return quotCquot

fun showarray argo array argc
    for row in array
        out equal quotquot
        for el in row
            out plusequal asciimap argo el argc
        print out

xa equal minus twodotzero
xb equal onedotzero
ya equal minus onedotfive
yb equal onedotfive

maxIt equal twofivefive

imgx equal onetwoeight
imgy equal sixfour

array equal sbrao sbrac
for j in range argo imgy argc
    row equal sbrao sbrac
    for i in range argo imgx argc
        rowdotappend argo zero argc
    arraydotappend argo row argc

for y in range argo imgy argc
    zy equal y times argo yb minus ya argc slash argo imgy minus one argc plus ya
    for x in range argo imgx argc
        zx equal x times argo xb minus xa argc slash argo imgx minus one argc plus xa
        z equal zx plus zy times onej
        c equal z
        for i in range argo maxIt argc
            if absargozargc greater two
                break
            z equal z times z plus c
        array sbrao y sbrac sbrao x sbrac equal i percent four times sixfour slash twofivesix

showarray argo array argc

Result:

Keywords

Here is a comprehensive list of keywords used in abyz and their equivalent in python:

  • argc : )
  • argo : (
  • cbrao : {
  • cbrac : }
  • com : #
  • dot : .
  • elif : elif
  • else : else
  • equal : =
  • if : if
  • for : for
  • fun : def
  • greater : >
  • less : <
  • minus : -
  • or : or
  • percent: %
  • plus : +
  • print : print(
  • quot : '
  • return : return
  • sbrac : ]
  • sbrao : [
  • slash: /
  • times : *
  • while : while

Build from source

You can install abyz from source cloning this repository and running

pip install -e .

or using uv:

uv sync

Contributing

Pull requests are welcome! Feel free to open an issue for bugs, comments, questions and suggestions, or contact me at pablo.villanueva.domingo@gmail.com.

License

MIT

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

abyz-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

abyz-1.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file abyz-1.0.0.tar.gz.

File metadata

  • Download URL: abyz-1.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for abyz-1.0.0.tar.gz
Algorithm Hash digest
SHA256 183571f7f07860005ae30f9dea4e12f7b75f6e6661c6169bf9e7cf51c15f5bde
MD5 683e060058bfdd2dfcd0e1389fe42e08
BLAKE2b-256 50f76b53165e4e8fff12e78b053cd6020486b32242275e1853e630772b614151

See more details on using hashes here.

File details

Details for the file abyz-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: abyz-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for abyz-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 731e1ad71c525e6dba2055f9a79d856428b075d2d6f2d38cea0b77ee0570ee86
MD5 58795c4cdd6f75eba1536a23cef486fa
BLAKE2b-256 a079fec17597ad9da7c121bd05323562fd7b2f48ae12017ffa341051ffa779c2

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