Sprunth / Schemoji

Scheme-based programming languages written with emojis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Schemoji

An emoji-based language structured on Scheme's syntax.

examples

Check out the tests folder for Scheme (.scm) and Schemoji (.smoji) equivelent files.

Simple factorial code:

(begin
    (define fact (lambda (n) (if (<= n 1) 1 (* n (fact (- n 1))))))
    (print (fact 10))
)
๐Ÿ”ธ๐Ÿ‘Œ
    ๐Ÿ”ธโœ๏ธ fact ๐Ÿ”ธ๐Ÿ ๐Ÿ”ธn๐Ÿ”น ๐Ÿ”ธโ˜ฏ๏ธ ๐Ÿ”ธ๐ŸŒœ n 1๐Ÿ”น 1 ๐Ÿ”ธ๐Ÿ‡ฝ n ๐Ÿ”ธfact ๐Ÿ”ธโž– n 1๐Ÿ”น๐Ÿ”น๐Ÿ”น๐Ÿ”น๐Ÿ”น๐Ÿ”น
    ๐Ÿ”ธ๐Ÿ™ˆ ๐Ÿ”ธfact 10๐Ÿ”น๐Ÿ”น
๐Ÿ”น

conversion

run convertall.py or src/converter.py to convert between Scheme and Schemoji There's a --prettify flag that, when set, changes the open-close parens to be dialer keycode emojis, representing scope-depth.

to run

e.x. python -m src.run tests/circle_area.smoji

For Scheme, these files are tested against Chicken Scheme.

language rules

The rules are defined in src/mapping.py

python env

using conda: conda create --name schemoji --file env.txt

thanks

Peter Norvig and his wonderful walkthroughs of writing lispy.py. This project uses a lot of code from lispy.py

About

Scheme-based programming languages written with emojis

License:MIT License


Languages

Language:Python 87.7%Language:Scheme 12.3%