Puzzlet Seshat Save

Code like an Egyptian

Project README

Seshat is a programming language in Egyptian hieroglyphs. Its goal is to make programming easy for anyone who can read and write Egyptian hieroglyphs.

"Seshat" (๐“‹‡ Zแบ–๊œฃ.t) is the name of an Egyptian goddess. The goddess of writing, architecture, and mathematics, she would definitely be the goddess of programming.

# hello.seshat
๐“น๐“Žก ๐“ž๐“œ๐“Žก ๐“…“ ๐“†“๐“Œƒ๐“‡‹๐“ฉ๐“‹‡๐“…จ๐“‚‹๐“๐“ŽŸ๐“ž๐“ŽŸ๐“ช๐“ง๐“‚ข
# ir=k zแบ–๊œฃ=k แธd-mdw j.nแธ Zแบ–๊œฃ.t Nb.t Wr.t Zแบ–๊œฃ Nb.t Jqd.w grแธฅ
# "Do write: "Hail Seshat, the Great, Mistress of the Script, Mistress of the Builders."
$ node build/lib/seshat.js hello.seshat
๐“‡‹๐“ฉ๐“‹‡๐“…จ๐“‚‹๐“๐“ŽŸ๐“ž๐“ŽŸ๐“ช๐“ง

But seriously, there are upsides about ancient Egyptian programming

Algorithms before antiquity

Among the oldest mathematical texts in human history are Rhind Mathematical Papyrus and Moscow Mathematical Papyrus. They mostly consist of problems and their solutions, and the solutions are written as line-by-line instructions. Like a description of an algorithm, they're very programmatic:

Make 10 heqats of the fat into ro; it shall become 3200.
Make a year into days; it shall become 365.
Divide 3200 by 365; it shall become 8 + 2/3 + 1/10 + 1/2190.
Make this in [haqet and ro notation]; 1/64 [haqet and] 1/3 + 1/10 + 1/2190 ro.

-- from Rhind Mathematical Papyrus Problem 66

x = heqat_to_ro(10)
assert x == 3200
assert days_in_a_year == 365
x = x / days_in_a_year
assert x == 8 + 2/3 + 1/10 + 1/2190
result = ro_to_haqet_and_ro(x)
assert result.haqet == 1/64
assert result.ro == 1/13 + 1/10 + 1/2190

Binary calculations

For multiplications and divisions, Egyptians used a method called "doubling." For example, to calculate 2000 * 5, they simply doubled 2000 until the multiplier reachs high enough for 5, and added things up:

\ 1     2000
  2     4000
\ 4     8000
Total  10000

-- from Rhind Mathematical Papyrus Problem 52

Over 3000 years later, it is similar to how computers multiply numbers every day.

Type systems everywhere

Egyptians used what we call "determinatives" at the ends of words to specify the categories of the meanings of the words. For example, the words ๐“Šข๐“‚๐“‚ป ๊œฅแธฅ๊œฅ "to stand" and ๐“Šข๐“‚๐“‡ค ๊œฅแธฅ๊œฅ "heap, quantity (in mathematics)" share the same spelling ๐“Šข๐“‚ ๊œฅแธฅ๊œฅ, but the determinatives ๐“‚ป and ๐“‡ค tell the meaning and make the words different. Like when we declare variables in typed programming languages.

In Seshat, you might use ๐“‡ค at the end of a variable to indicate it's about the quantity, namely a number variable. Or a papyrus scroll ๐“› for the string variables.

Documentation

TODO

References & Further Readings

The first books

Reimer (2014) is a good introductory book about ancient Egyptian mathematics.

If you are interested in Egyptian hieroglyphs for the first time, McDermott (2001) would be a good starter. Collier & Manley (1998) gives more about grammar and vocabulary.

  • Collier, M. & Manley, B. (1998). How to read Egyptian hieroglyphs: a step-by-step guide to teach yourself. Univ of California Press.
    • at archive.org
    • ใ€Š(๋Œ€์˜๋ฐ•๋ฌผ๊ด€์ด ๋งŒ๋“ ) ์ด์ง‘ํŠธ ์ƒํ˜•๋ฌธ์ž ์ฝ๋Š” ๋ฒ•ใ€‹. ํ•˜์—ฐํฌ ์˜ฎ๊น€. ๋ฃจ๋น„๋ฐ•์Šค, 2005.
  • McDermott, B. (2001). Decoding Egyptian hieroglyphs: How to read the secret language of the pharaohs. Chronicle Books.
    • at archive.org
    • ใ€ŠํŒŒ๋ผ์˜ค์˜ ๋น„๋ฐ€๋ฌธ์ž: ์ด์ง‘ํŠธ ์ƒํ˜•๋ฌธ์ž ์ฝ๋Š” ๋ฒ•ใ€‹. ๊ถŒ์˜์ง„ ์˜ฎ๊น€. ์˜ˆ๊ฒฝ, 2005.
  • Reimer, D. (2014). Count like an Egyptian: a hands-on introduction to ancient mathematics. Princeton University Press.

Language & dictionaries

  • Allen, J. P. (2000). Middle Egyptian: An introduction to the language and culture of hieroglyphs. Cambridge University Press.
  • Budge, E. A. W. (1911). A Hieroglyphic Vocabulary to the Theban Recension of the Book of the Dead: with an index to all the English equivalents of the Egyptian words (Vol. 31). Kegan Paul, Trench, Trรผbner & Co. Ltd.
  • Budge, E. A. W. (1920). An Egyptian Hieroglyphic Dictionary: with an index of english words, king list, and geographical list with indexes, list of hieroglyphic characters, coptic and semitic alphabets (Vols. 1-2). John Murray.
  • Dickson, P. (2006). Dictionary of middle Egyptian in Gardiner classification order.
  • Faulkner, R. O. (1964). A concise dictionary of Middle Egyptian.
  • Gardiner, A. H. (1927). Egyptian grammar: being an introduction to the study of hieroglyphs. 3rd ed. Oxford University Press.
  • Loprieno, A. (1995). Ancient Egyptian: a linguistic introduction. Cambridge University Press.

Online dictionaries

The texts & researches

  • Chace, A. B., Archibald, R. C., Bull, L., Glanville, S. R. K., & Manning, H. P. (1929). The Rhind Mathematical Papyrus. Volume II: Photographs, Transcription Transliteration, Literal Translation. Mathematical Association of America.
  • Clagett, M. (1999). Ancient Egyptian Science: A Source Book (vol. 3). American Philosophical Society.
  • Imhausen, A. (2002). ร„gyptische Algorithmen: eine Untersuchung zu den mittelรคgyptischen mathematischen Aufgabentexten (Vol. 65). Harrassowitz Verlag.
  • Ritter, J. (2002). Closing the Eye of Horus: The Rise and Fall of 'Horus-eye Fractions'. In J. M. Steele & A. Imhausen (Eds.), Under One Sky: Astronomy and Mathematics in the Ancient Near East (pp. 297-323). Ugarit-Verlag.
  • Sethe, K. (1908). Die altรคgyptischen Pyramidentexte nach den Papierabdrucken und Photographien des Berliner Museums, (Vols. 1-2). J. C. Hinrichs'sche Buchhandlung.
  • Struve, W. W. (1930). Mathematischer Papyrus des staatlichen Museums der schรถnen Kรผnste in Moskau: herausgegeben und kommentiert von WW Struve, unter Benutzung einer hieroglyphischen Transkription von BA Turajeff (Quellen und Studien zur Geschichte der Mathematik, Abt. A, Quellen, Band 1). Verlag von Julius Springer.
Open Source Agenda is not affiliated with "Puzzlet Seshat" Project. README Source: puzzlet/seshat
Stars
55
Open Issues
0
Last Commit
7 months ago
Repository

Open Source Agenda Badge

Open Source Agenda Rating