Home

Awesome

Genesis 𐀁

Open Source Love svg2

"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.

<p align="center"> <img src="https://img.shields.io/badge/Platforms-win%20%7C%20linux%20%7C%20osx-lightgrey" /> <!--<img src="https://img.shields.io/powershellgallery/p/DNS.1.1.1.1" />--> <a href="https://github.com/elonlit/Genesis/blob/master/LICENSE"> <img src="https://img.shields.io/badge/license-HOLY--LICENSE-yellow" /> </a> </p> <p align="center"> <a href="#valid-keywords">Keywords</a> β€’ <a href="#operations-punctuation-elements--identifiers">Operators</a> β€’ <a href="#data-types--literals">Types</a> β€’ <a href="#control-flow">Control Flow</a> β€’ <a href="#subroutines">Subroutines</a> β€’ <a href="#data-structures">Data Structures</a> β€’ <a href="#math-library--native-utilities">Utilities</a> β€’ <a href="#faq">FAQ</a> </p>

Valid Keywords

Lexeme𐀁 Equivalent(s)
Printπ€„π€ƒπ€π€Ž
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)<br /> - - subtraction (numbers)<br /> / - division (numbers)<br /> * - multiplication (numbers)<br /> ^ - power (numbers)<br /> = - assignment (numbers, strings)<br /> == - logical equals (numbers, strings)<br /> =! - not equal to (numbers, strings)<br /> < - less than (numbers)<br /> > - greater than (numbers)<br /> => - greater than or equal to (numbers)<br /> =< - less than or equal to (numbers)<br /> && - logical and (booleans)<br /> || - logical or (booleans)<br />

However, the associativity of most operators is from right-to-left:

<pre dir="rtl" align="right"> 𐀄𐀂𐀃𐀓 𐀐𐀅 = π€ŠΧ΄π€‡ - 𐀄׳ // 23 </pre>

Identifiers can be represented by alphanumeric text (including _) and do not have to start with an alphabetic character.

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:

DecimalHebrew𐀁 Glyph
1Alep𐀀
2Bet𐀁
3Gimel𐀂
4Dalet𐀃
5He𐀄
6Waw𐀅
7Zayin𐀆
8Het𐀇
9Tet𐀈
10Yod𐀉
20Kaf𐀊
30Lamed𐀋
40Mem𐀌
50Nun𐀍
60Samek𐀎
70Ayin𐀏
80Pe𐀐
90Sade𐀑
100Qop𐀒
200Res𐀓
300Sin𐀔
400Taw𐀕

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

"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:

<pre dir="rtl" align="right"> 𐀄𐀂𐀃𐀓 π€Œπ€Žπ€π€“ = 𐀉׳ 𐀄𐀂𐀃𐀓 𐀓𐀀𐀔𐀅𐀍 = 𐀀׳ 𐀄𐀂𐀃𐀓 𐀔𐀍𐀉𐀄 = 𐀀׳ - 𐀀׳ 𐀄𐀂𐀃𐀓 𐀃𐀋𐀐𐀒 = 𐀀׳ - 𐀀׳ 𐀄𐀂𐀃𐀓 π€†π€Œπ€π€‰ = 𐀀׳ - 𐀀׳ 𐀁𐀏𐀅𐀃 𐀃𐀋𐀐𐀒 <= π€Œπ€Žπ€π€“: π€„π€ƒπ€π€Žπ€‡ 𐀔𐀍𐀉𐀄 π€†π€Œπ€π€‰ = 𐀓𐀀𐀔𐀅𐀍 + 𐀔𐀍𐀉𐀄 𐀓𐀀𐀔𐀅𐀍 = 𐀔𐀍𐀉𐀄 𐀔𐀍𐀉𐀄 = π€†π€Œπ€π€‰ 𐀃𐀋𐀐𐀒 = 𐀃𐀋𐀐𐀒 + 𐀀׳ 𐀒-𐀃-𐀔 </pre>

The following 𐀏𐀁𐀅𐀓 loop prints out the first ten natural numbers:

<pre dir="rtl" align="right"> 𐀏𐀁𐀅𐀓 π€Œπ€Žπ€π€“=𐀉׳,π€Œπ€Žπ€π€“>=𐀀׳,π€Œπ€Žπ€π€“=π€Œπ€Žπ€π€“-𐀀׳: π€„π€ƒπ€π€Žπ€‡ π€Œπ€Žπ€π€“ 𐀒-𐀃-𐀔 </pre>

To accomplish nested operations or anamorphism, it is recommended to do a composition of subroutines.

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.

<!--- > "*For if, after they have returned from the defilements of the world by the knowledge of the Lord and Savior Jesus Christ, they are again entangled in them and are overcome, the last state has become worse for them than the first*"-->

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:

<pre dir="rtl" align="right"> 𐀄𐀂𐀃𐀓 π€Šπ€…π€‡ = (𐀀׳ / (𐀉׳ ^ 𐀉״𐀀)) * (π€•π€“π€ŽΧ΄π€† / 𐀒׳) 𐀄𐀂𐀃𐀓 𐀕𐀅𐀓𐀄 = 𐀊״𐀈 / 𐀒׳ 𐀄𐀂𐀃𐀓 π€€π€ƒπ€Œ = 𐀏׳ 𐀄𐀂𐀃𐀓 π€Œπ€“π€‡π€’ = 𐀀׳ 𐀐𐀅𐀍𐀒𐀑𐀉𐀄 𐀇𐀉𐀁𐀅𐀓: 𐀄𐀂𐀃𐀓 𐀄𐀇𐀉𐀁𐀅𐀓 = (π€Šπ€…π€‡ * 𐀕𐀅𐀓𐀄 * π€€π€ƒπ€Œ) / (π€Œπ€“π€‡π€’ * π€Œπ€“π€‡π€’) π€„π€ƒπ€π€Ž 𐀄𐀇𐀉𐀁𐀅𐀓 𐀒-𐀃-𐀔 𐀇𐀉𐀁𐀅𐀓 </pre>

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:

<pre dir="rtl" align="right"> 𐀄𐀂𐀃𐀓 π€Œπ€Žπ€π€“ = {𐀀׳, 𐀁׳, 𐀂׳} π€Œπ€Žπ€π€“[𐀈׳/𐀈׳] = 𐀔𐀒𐀓 π€π€π€…π€“π€Šπ€‹ π€€π€‹π€Œπ€π€ˆ, π€Œπ€Žπ€π€“: π€„π€ƒπ€π€Žπ€‡ π€€π€‹π€Œπ€π€ˆ 𐀒-𐀃-𐀔 </pre>

As denoted, 𐀏𐀁𐀅𐀓 or π€π€π€…π€“π€Šπ€‹ looping an array will yield its values.

Math Library & Native Utilities

FunctionDescription𐀁 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:

<pre dir="rtl" align="right"> 𐀄𐀂𐀃𐀓 π€”π€ˆπ€‡ = 𐀃׳ * 𐀐𐀉𐀉() * (𐀉״𐀁 ^ 𐀁׳) 𐀄𐀂𐀃𐀓 π€Œπ€”π€…π€‹π€” = (𐀀׳/𐀁׳) * (𐀄׳ * π€ŽΧ΄π€ƒ * π€Žπ€‰π€(π€ŒΧ΄π€„)) 𐀄𐀂𐀃𐀓 𐀒𐀋 = 𐀔𐀅𐀓𐀔(π€ŽΧ΄π€ƒ) * 𐀓𐀍𐀃() π€„π€ƒπ€π€Žπ€‡ π€”π€ˆπ€‡ π€„π€ƒπ€π€Žπ€‡ π€Œπ€”π€…π€‹π€” π€„π€ƒπ€π€Žπ€‡ 𐀒𐀋 </pre>

A subroutine for calculating the energy of an electron in the <i>𐀍</i>-th orbital of a hydrogenic atom in Joules:

<pre dir="rtl" align="right"> 𐀐𐀅𐀍𐀒𐀑𐀉𐀄 𐀀𐀍𐀓𐀂𐀉𐀄: 𐀄𐀂𐀃𐀓 𐀍 = 𐀁׳ 𐀄𐀂𐀃𐀓 𐀂𐀀𐀅𐀋 = ((𐀂׳ * (𐀉׳ ^ 𐀇׳)) * ((𐀉״𐀀 / 𐀉׳) * (𐀉׳ ^ 𐀆׳)) * (((𐀔׳ + 𐀔׳ * 𐀉׳) / (𐀕״𐀒)) * (𐀉׳ ^ (𐀅׳ - 𐀌׳))) * (𐀀׳ - 𐀁׳)) * (𐀀׳ / (𐀍 * 𐀍)) π€„π€ƒπ€π€Ž 𐀂𐀀𐀅𐀋 𐀒-𐀃-𐀔 𐀀𐀍𐀓𐀂𐀉𐀄 </pre>

FAQ

Why not use Modern Hebrew?

If you are able to program in this language, I have failed.

Why are you running an interpreted language over an interpreted language?

"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

Why not make an object-oriented language?

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

Footnotes

  1. Psalm 139:13-16 ↩

  2. Isaiah 55:6-7 ↩

  3. Exodus 3:14 ↩

  4. Romans 5:12-13 ↩

  5. Isaiah 44:9-20 ↩