God's actual programming language.
"My frame was not hidden from you, when I was being made in secret, intricately woven in the depths of the earth. Your eyes saw my unformed substance; in your book were written, every one of them, the days that were formed for me, when as yet there was none of them" [^1]
Genesis is an interpreted, procedural, and Turing-complete Paleo-Hebrew programming language. Diacritical signs are forgone for simplification, though maybe Nikud can be used in prospect as a means for more reserved keywords.
Keywords • Operators • Types • Control Flow • Subroutines • Data Structures • Utilities • FAQ
| 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.
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)
`` - greater than (numbers)
=> - greater than or equal to (numbers)
`= "Seek the Lord while he may be found; call on him while he is near" [^2]
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:
= ׳ = ׳ = ׳ - ׳ = ׳ - ׳ = ׳ - ׳
=׳,=-׳:
--
To accomplish nested operations or anamorphism, it is recommended to do a composition of subroutines.
"'I AM THAT I AM'" [^3]
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.
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.
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.
| 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. | () |
| Evince() | Returns a random Bible quote. | () |
Some calculations:
= ׳ * () * (״ ^ ׳) = (׳/׳) * (׳ * ״ * (״)) = (״) * ()
A subroutine for calculating the energy of an electron in the ``-th orbital of a hydrogenic atom in Joules:
: = ׳ = ((׳ * (׳ ^ ׳)) * ((״ / ׳) * (׳ ^ ׳)) * (((׳ + ׳ * ׳) / (״)) * (׳ ^ (׳ - ׳))) * (׳ - ׳)) * (׳ / ( * ))
--
If you are able to program in this language, I have failed.
"Wherefore, just as sin came into the world through one man, and death through sin, and so death spread to all men because all sinned" [^4]
This suggestion makes me consternated. Genesis will never be object-oriented because the Bible explicitly forbids object worship:
"These prized objects are really worthless. The people who worship idols don’t know this, so they are all put to shame. []Their eyes are closed, and they cannot see. Their minds are shut, and they cannot think. The person who made the idol never stops to reflect, 'Why, it’s just a block of wood! I burned half of it for heat and used it to bake my bread and roast my meat. How can the rest of it be a god? Should I bow down to worship a piece of wood?'" [^5]
[^1]: Psalm 139:13-16 [^2]: Isaiah 55:6-7 [^3]: Exodus 3:14 [^4]: Romans 5:12-13 [^5]: Isaiah 44:9-20
No open issues yet, or sync has not completed.