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 asf argo x argc. Much simpler without these stupid parentheses, isn't? - Why writting
pi=3.1415like in most languages when you can just writepi equal threedotonefouronefivein abyz?
- A function in other languages written as
- 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.,
aequalthreetimestwois equivalent toa 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.
- Hello World.
print quot Hello World quot
- 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
- 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
- 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:elifelse:elseequal:=if:iffor:forfun:defgreater:>less:<minus:-or:orpercent:%plus:+print:print(quot:'return:returnsbrac:]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
Metadata
Release files for abyz 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| abyz-1.0.0.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| abyz-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.6 kB
Release files / abyz-1.0.0.tar.gz
| Download URL | abyz-1.0.0.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
183571f7f07860005ae30f9dea4e12f7b75f6e6661c6169bf9e7cf51c15f5bde
|
|
BLAKE2b-256 checksum How to use checksums |
50f76b53165e4e8fff12e78b053cd6020486b32242275e1853e630772b614151
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.2
|
Release files / abyz-1.0.0-py3-none-any.whl
| Download URL | abyz-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
731e1ad71c525e6dba2055f9a79d856428b075d2d6f2d38cea0b77ee0570ee86
|
|
BLAKE2b-256 checksum How to use checksums |
a079fec17597ad9da7c121bd05323562fd7b2f48ae12017ffa341051ffa779c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.2
|