User:Slereah/Arithmetica

From Esolang
Jump to navigation Jump to search

Here be a draft for Αριθµητικών :

Αριθµητικών is an esoteric programming language based on the arithmetical notation of the eponymous book by Diophantus.

The notation is the following :

  • Small case letters : Greek numerals (up to 999). Every term must have one on the right. The 0 uses the Hellenistic zero, ō
  • Μ : Monad, used for constants.
  • ς : Αριθµός, the variable for one-variable functions.
  • ΔΥ, ΚΥ, ... : For one-variable functions, powers of the variable. Δ (δύναµις) to square, Κ (κύβοv) to cube, and combinations of the form (1)(2) for ς to the power of (1)+(2), such as ΔΔΥ (δυναµοδύναµις) for 4, and so on.
  • Fractions are expressed by a/b = ab, or aον for 1/a. Inverse are expressed with a superscript χ. 1/x is ςχ, 1/x² is ΔχΥ and so on.
  • Multiple variables are expressed by aου. The first variable would be αου, the second βου and so on.
  • (1)(2) for (1) + (2). For instance, ςαΜε means x + 5
  • (1)↑(2) for (1) - (2) (The closest symbol is actually GREEK ACROPHONIC HERMIONIAN TEN, but most fonts do not display it).
  • (1) µερ (2) to divide (1) by (2).
  • (1) επί (2) to multiply (1) by (2).
  • εάν (c) τότε (1) αλλιώς (2) for if (c) then (1) else (2)
  • (1) ισ (2) is (1) = (2), which evaluates to either true or false (looking for translations)
  • ἕκθ : Used for function definition. ἕκθ [function name] [function]. Functions are called by [function name] [arg1] [arg2] ... [arg n-1] καί [arg n]

It is a functional language that uses the numbers available at the time, integers and fractions. Negative numbers, such as 1-2 (Μα↑Μβ) will return the error ἀδύνατος (impossible).