it's a language called ELAR which support elementary arithmetic.
ELAR's sytanx like lisp, having four buildin function: add, subtract, multipy, divide.
npx elar
yarn install -g elar
if not knowing what to do, please run npx elar --help
, it will provide some example and explaination.
> elar
> ? (add 1 (divide 2 (multipy 4 2) ) )
# 1.5
you can use run
command to exec file which content match the ELAR grammer.
elar run example/example.elar
there are three article to help you step by step to building the same language. But I writing by Chinese, but many code snapshot which will help you.
- Build own your language —— Tokenize
- Build own your language —— Parse
- Build own your language —— Evaluate
Think...