Genesis
Paradigm(s) | Procedural, Imperative |
---|---|
Designed by | Elon Litman |
Appeared in | 2022 |
Memory system | Cell-based |
Dimensions | One-dimensional |
Computational class | Turing complete |
Major implementations | Genesis Interpreter |
Influenced by | The Bible |
File extension(s) | .π€ |
Genesis π€ is an interpreted, procedural, and Turing-complete diacriticless Paleo-Hebrew programming language.
Valid Keywords
Lexeme | π€ Equivalent(s) |
---|---|
π€π€π€π€ | |
Print Line | π€π€π€π€π€ |
Declare/Initialize Variable | π€π€π€π€ |
Declare Subroutine | π€π€ π€π€π€π€π€ |
If | π€π€ |
Then | π€π€ |
While | π€π€π€ π€ |
For | π€π€π€ π€ |
For Each | π€π€π€ π€π€π€ |
Sleep | π€π€π€ |
Consecrate | π€-π€-π€ |
The `π€-π€-π€` keyword, meaning literally "to consecrate" or "to purify," denotes when the scope of a subroutine or loop terminates.
Operations, Punctuation Elements, & Identifiers
Java-style syntax and precedence are preserved for most operators:
`+` - addition (numbers, strings)
`-` - subtraction (numbers)
`/` - division (numbers)
`*` - multiplication (numbers)
`^` - power (numbers)
`=` - assignment (numbers, strings)
`==` - logical equals (numbers, strings)
`=!` - not equal to (numbers, strings)
`<` - less than (numbers)
`>` - greater than (numbers)
`=>` - greater than or equal to (numbers)
`=<` - less than or equal to (numbers)
`&&` - logical and (booleans)
`||` - logical or (booleans)
However, the associativity of most operators is from right-to-left:
π€π€π€π€ π€π€ = π€Χ΄π€ - π€Χ³ // 23
Identifiers can be represented by alphanumeric text (including `_`) and do not have to start with an alphabetic character.
- Note*: To enable Paleo-Hebrew in the console, enable a TrueType font such as "Courier New."
Data Types & Literals
Genesis is weakly and dynamically typed, so casting between primitives is handled implicitly by the interpreter. There are three data types:
1. Number
- Encompasses `Bytes`, `Shorts`, `Integers`, `Longs`, `Doubles`, and `Floats`.
2. Boolean
- Supports literals `π€π€π€` or `π€π€π€`, which correspond to `True` or `False`, respectively.
3. String
- Delimited by quotation marks, e.g. `"!π€π€π€ π€ π€π€ π€π€"`.
The Paleo-Hebrew alphabet may have used gematria to denote cardinal values, although there is only evidence of this on the Samaria Ostraca and Dead Sea Scroll 4Q252. This quasi-decimal isopsephic number system is adopted for a lack of an academic consensus.
In this paradigm of numerology, there is no notation for zero, and the numeric values for individual letters are added together. Each unit (`1`, `2`, ..., `9`) is assigned a separate letter, each tens (`10`, `20`, ..., `90`) a separate letter, and the first four hundreds (`100`, `200`, `300`, `400`) a separate letter. The later hundreds (`500`, `600`, `700`, `800`, and `900`) are represented by the sum of two or three letters representing the first four hundreds. To represent numbers from `1,000` to `999,999`, the same letters are reused to serve as thousands, tens of thousands, and hundreds of thousands. Biblical pseudepigrapha use these transformations extensively. Standard (normative value) encoding per the conventional affine Mispar Hechrachi method of gematria is as follows:
Header text | Header text | Header text |
---|---|---|
Decimal | Hebrew | π€ Glyph |
1 | Alep | π€ |
2 | Bet | π€ |
3 | Gimel | π€ |
4 | Dalet | π€ |
5 | He | π€ |
6 | Waw | π€ |
7 | Zayin | π€ |
8 | Het | π€ |
9 | Tet | π€ |
10 | Yod | π€ |
20 | Kaf | π€ |
30 | Lamed | π€ |
40 | Mem | π€ |
50 | Nun | π€ |
60 | Samek | π€ |
70 | Ayin | π€ |
80 | Pe | π€ |
90 | Sade | π€ |
100 | Qop | π€ |
200 | Res | π€ |
300 | Sin | π€ |
400 | Taw | π€ |
Gershayim `Χ΄` (U+05F4 in Unicode, and resembling a double quote mark) (sometimes erroneously referred to as merkha'ot, which is Hebrew for double quote) are inserted before (to the right of) the last (leftmost) letter to indicate that the sequence of letters represents a gematric sequence of at least two Hebrew numerals (e.g., `28` β `π€Χ΄π€` and `5782` β `π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€π€Χ΄π€`).
Similarly, a single geresh `Χ³` (U+05F3 in Unicode, and resembling a single quote mark) is appended after (to the left of) a single letter in the case where a number is represented by a single Hebrew numeral (e.g. `100` β `π€Χ³`).
Control Flow
The standard suite of loop constructs is supported. An iterative implementation for generating the first ten terms of the Fibonacci sequence using a `π€π€π€ π€` loop is formulated as an example:
π€π€π€π€ π€π€π€π€ = π€Χ³ π€π€π€π€ π€π€π€π€ π€ = π€Χ³ π€π€π€π€ π€π€π€π€ = π€Χ³ - π€Χ³ π€π€π€π€ π€π€π€π€ = π€Χ³ - π€Χ³ π€π€π€π€ π€π€π€π€ = π€Χ³ - π€Χ³ π€π€π€ π€ π€π€π€π€ <= π€π€π€π€: π€π€π€π€π€ π€π€π€π€ π€π€π€π€ = π€π€π€π€ π€ + π€π€π€π€ π€π€π€π€ π€ = π€π€π€π€ π€π€π€π€ = π€π€π€π€ π€π€π€π€ = π€π€π€π€ + π€Χ³ π€-π€-π€
The following `π€π€π€ π€` loop prints out the first ten natural numbers:
π€π€π€ π€ π€π€π€π€=π€Χ³,π€π€π€π€>=π€Χ³,π€π€π€π€=π€π€π€π€-π€Χ³: π€π€π€π€π€ π€π€π€π€ π€-π€-π€
To accomplish nested operations or anamorphism, it is recommended to do a composition of subroutines.
Subroutines
Functions in Genesis are declared using the `π€π€ π€π€π€π€π€` keyword. Being void and non-parameterized, however, they are actually subroutines. There is recursion insomuch that making a self-referential call from within a subroutine is possible, but there is no means to exit that recursion to express the irrevocable danger of pride and egoism. This design follows the contention that recursion, as Peter Deutsch identified, is divine and not encompassed by the domain of human programmers, as evidenced by God identifying himself recursively. Genesis will never be object-oriented because the Bible explicitly forbids object worship. To call on a subroutine, use the reference name with which it was defined. The following subroutine `π€π€π€π€ π€` approximates the gravitational force of a 290-gram KJV Compact Ultraslim Bible one meter from a 70-kg human being:
π€π€π€π€ π€π€ π€ = (π€Χ³ / (π€Χ³ ^ π€Χ΄π€)) * (π€π€π€Χ΄π€ / π€Χ³) π€π€π€π€ π€π€ π€π€ = π€Χ΄π€ / π€Χ³ π€π€π€π€ π€π€π€ = π€Χ³ π€π€π€π€ π€π€π€π€ = π€Χ³ π€π€ π€π€π€π€π€ π€π€π€π€ π€: π€π€π€π€ π€π€π€π€π€ π€ = (π€π€ π€ * π€π€ π€π€ * π€π€π€) / (π€π€π€π€ * π€π€π€π€) π€π€π€π€ π€π€π€π€π€ π€ π€-π€-π€ π€π€π€π€ π€
Other examples can be found in the respository.
Data Structures
Genesis provides fixed-length untyped array data structures. Curly braces are used to initialize arrays, and elements can be accessed or mutated through square bracket index operators:
π€π€π€π€ π€π€π€π€ = {π€Χ³, π€Χ³, π€Χ³} π€π€π€π€[π€Χ³/π€Χ³] = π€π€π€ π€π€π€ π€π€π€ π€π€π€π€π€, π€π€π€π€: π€π€π€π€π€ π€π€π€π€π€ π€-π€-π€
As denoted, `π€π€π€ π€` or `π€π€π€ π€π€π€` looping an array will yield its values.
Math Library & Native Utilities
Function | Description | π€ Equivalent(s) |
---|---|---|
Sqrt(#) | Returns the correctly rounded positive square root of a number value. | π€π€ π€π€(π€) |
Sin(β ) | Returns the trigonometric sine of an angle. | π€π€π€(π€) |
Cos(β ) | Returns the trigonometric cosine of an angle. | π€π€ π€(π€) |
Tan(β ) | Returns the trigonometric tangent of an angle. | π€π€(π€) |
ToDegrees(C) | Converts an angle measured in radians to degrees. | π€π€(π€) |
ToRadians(β ) | Converts an angle measured in degrees to radians. | π€π€(π€) |
Absolute(#) | Returns the absolute value of a number value. | π€π€π€(π€) |
Log(#) | Returns the natural logarithm (base *e*) of a number value. | (π€)π€π€ π€ |
Exp(#) | Returns Euler's number *e* raised to the power of a number value. | (π€)π€π€π€π€ |
Ulp(#) | Returns the size of an ulp of the argument. | (π€)π€π€ π€π€ |
PI() | Returns Ο rounded to double precision. | ()π€π€π€ |
Random() | Returns a number value greater than or equal to 0.0 and less than 1.0. | ()π€π€π€ |
Some calculations:
π€π€π€π€ π€π€π€ = π€Χ³ * π€π€π€() * (π€Χ΄π€ ^ π€Χ³) π€π€π€π€ π€π€π€ π€π€ = (π€Χ³/π€Χ³) * (π€Χ³ * π€Χ΄π€ * π€π€π€(π€Χ΄π€)) π€π€π€π€ π€π€ = π€π€ π€π€(π€Χ΄π€) * π€π€π€() π€π€π€π€π€ π€π€π€ π€π€π€π€π€ π€π€π€ π€π€ π€π€π€π€π€ π€π€