Transpile "python" programs into brainf*** ascii art
Note: requires cabal-install
- Clone repo
- Open your terminal of choice
- While in repository base (that's the folder with this file in it!), either:
- Run
cabal install
to install the project to your system - Run
cabal run . -- [ARGUMENTS]
to run this project without installing
- Run
For more information, run brainless --help
.
Only a small subset of python has been implemented:
<varname> = <expression>
print(<expression>)
a + b
,a - b
,a * b
,a // b
,a % b
for basic operationsa + b
for string concatenation. Note that creating strings longer than the specified--string-length
(default: 64) is undefined behaviour.a >= b
,a <= b
,a < b
,a >= b
,a == b
for numeric comparison. Also technically defined for string comparison, but there is an unresolved bug in this area.a and b
,a or b
,not a
for boolean logicinput(a)
orinput()
to get a line of user inputchr(a)
to convert an integer into the corresponding character.ord(a)
to get the character code of the start of a string.while <expression>:
andif <expression>
. Make sure to indent by exactly 4 spaces at this time. There is a bug related to nested while/if loops.
- Finish by the end of the hackathon
- Fix bugs to do with nested while loops and/or string comparison
- Add infix operators
- Expand available commands
- Optimise generated code / optimise compile times
- Optimise memory management