Note
Migrated to https://github.com/OakyMacintosh/declmath
Math as a Scripting thing (the brain is your interpreter > (see -> #{math}; then interpret(it))
)
Okay...you're in a math class and you're a programmer, but, you think math as a scripting language... creating variables in your calculations....
but...you can't just think it as a language with all those formations and other things....
But, i developed a solution...
DeclMath
you can turn this:
into this ...:
x = 12
root(x)
Run the same code on a computer and in your mind, with the MathAsScripting book!
Math in some cases is considered a programming language, but it is less consize and doesn't use any common programming concepts (except variables and functions), but during math classes i structured a little grammar and the basic language concepts adapted to common math concepts
like, the baskara formula can be reformated from this:
to this:
x = frac(-b +/- root(b^2 - 4ac)2a)
await('c', 'a' and 'b')
The DeclMath
language can variate depending on the calculator's (a human or a machine) main language, in human cases you can declare the variation of your choice:
#lang * 'pt_br' # for Portugues do Brasil
#lang * 'pt_pt' # for Portugues de Portugal
#lang * 'en' # for American English
#lang * 'en' -> __british__ # for British English
#lang * 'jp' -> __piing__ # For ジャポネス・ピング
The words in the japonese form of declmath aren't fluent translations, it can't variate.
#lang * 'jp' -> __piing__
# DeclMathの日本語例
ルート(\32)
もし根が32と同じであれば、次の操作を行います。:
印刷(output)
終了
Translated to japonese using Microsoft Translate
You can install the interpreter, get the book to learn it out, or just use the Jupyter Notebook (Distribution Notebooks)
Obviously i'm using the MIT License.