Esoteric Polish Notation Evaluation Language
Project description
epnel
A simple esoteric and lispy programming language without parentheses.
description
operators
Each operator takes two arguments: (expression, expression). They work the way you would expect.
+
- addition-
- subtraction*
- multiplication/
- division<
- comparison (lower than)>
- comparison (bigger than)|
- alternation (or)^
- disjunction (xor)&
- conjunction (and)=
- equation (is equal to?)
Comparison operators return boolean types.
Logical operators work either on number's bits or booleans.
conditionals
Conditional takes three arguments: (test, then, else). If "test" evaluates to True, then the "then" branch is executed. Otherwise the "else" branch is executed.
?
- conditional
assignments
The first argument for each assignment operator is a name. Names are also expressions and will be evaluated before assignment. The only restriction is that you can't bind to any reserved keywords.
.
- variable assignment,
- function assignment:
- number reassignment
The variable assignment takes two arguments: (name, expression). "Expression" is evaluated and it's value is bound to the name.
The function assignment takes three arguments: (name, definition, expression). "Definition" is an expression, which isn't evaluated until the "name" is called. Whenever a call to "name" appears it will evaluate the function definition expression and return it's new value. "Expression" is the return value of the function assignment.
Assignments bind values or expressions to names. This means you can also change the behaviour of numbers.
Number reassignment takes only one argument and returns a value of it's argument's value. Similar functionality is attributed to "dereference" in some languages. The argument is interpreted as if it's value was typed straight in place of this assignment.
Number reassignment reassigns to itself a number corresponding to the value of it's name.
booleans
You can produce booleans using comparison operators. True is equal to 1 and False is equal to 0. The boolean primitive evaluates to False (and is immutable).
!
- boolean (false)
numbers
or as some would say: literals
decimals
Decimal numbers are composed of digits or passed around as variables. The default value for any variable is zero: 0 or False.
names
The variable name can be anything which is not a language keyword. If name is an expression it is evaluated and the result is used as a literal name. You can use the assignment to bind names with values.
expressions
Expressions are evaluated either to numbers or booleans. Everything is an expression.
inspiration
Polish Notation was the inspiration to write this language, therefore I named the language "epnel".
E - Esoteric
P - Polish
N - Notation
E - Evaluation
L - Language
installation
You can simply use:
$ pip install .
wishlist
Some things that might be nice to have:
- compiler to C
license
GNU GPLv3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file epnel-0.0.3.tar.gz
.
File metadata
- Download URL: epnel-0.0.3.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de02e51562542a349573e31c30645b975ebb518c1171f6fce5554ac17cfbccfb |
|
MD5 | 4de27c2cbd77c7b1a11ad284d4ba202e |
|
BLAKE2b-256 | b69267642a02781e6191e21c26530ec2f3d36debbfe4f9dda2892569f5c849e0 |
File details
Details for the file epnel-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: epnel-0.0.3-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e269633326423409f5ec51f6a9cf2d14a93a836af677e5fd76fbb21363ea40b6 |
|
MD5 | 8c5a10bc11c93a03b0b3ff7103b8e255 |
|
BLAKE2b-256 | 193cc26026d2a0e0c8ffe0155c3c42d7ac5d5f081d0f1fc7ccd2a7a871ab521f |