Interpreter for the Shrug Programming Language
Project description
ShrugProgrammingLanguage
Interpreter for the Shrug Programming Language
Shrug is a imperative, dynamically-typed, very very high-level, general-purpose programming language
Example
>> a 10
>> b 11
>>
>> # Arithmetic operations
>> ¯\_(ツ)_/¯ a 3
13
>> ¯\_(ツ)_/¯ "str" "ing"
string
>> ¯\_(ツ)_/¯ a ¯\_(ツ)_/¯ 3
7
>> ¯\_(ツ)_/¯ a ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ b
110
>> ¯\_(ツ)_/¯ a ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ 3
3
>> ¯\_(ツ)_/¯ b ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ 4
3
>>
>> # Comparisons
>> ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ a b
False
>> ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ a ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ b
False
>> ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ a ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ b
True
>>
>> # Conditional statements
>> ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ True
>> "printed"
printed
>> ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ False
>> "not printed"
>> ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ a ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ ¯\_(ツ)_/¯ b
>> "a is less than b"
a is less than b
Usage
Requires Python 3.6+
Install
pip install shrug-lang
Start interpreter
shruglang
To run a file:
cat program.shrug | shruglang
Language spec
Language spec can be found here
Syntax highlighting
Syntax highlighting for sublime can be found here
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shrug-lang-0.1.0.tar.gz
(9.9 kB
view hashes)
Built Distribution
shrug_lang-0.1.0-py3-none-any.whl
(13.8 kB
view hashes)
Close
Hashes for shrug_lang-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e7c47563099c0d184390bf06bb2e4bebe615ec15f24923970595a016d2ee369 |
|
MD5 | d42e047267d24ae80ba28896605e9a0a |
|
BLAKE2b-256 | 0ef878331840215ae9eb61f5f5d5d8eda229f43b8874b4f5e31f726e1ee71ab5 |