elikaski / BF-it

A C-like language to Brainfuck compiler, written in Python
MIT License
121 stars 11 forks source link

Exclude the return_value from the output if the function return type is void #29

Open NeeEoo opened 3 years ago

NeeEoo commented 3 years ago

Every function called adds

return_value [paramN...] [localN...]

to the cells, even for void functions. So the return_value cell can be omitted, to make the code smaller and faster execution of the code since the pointer doesn't have to move around so much.

This would make side effects if you return in a void function unless the compiler prevents it.