bf to Lua Compiler
supernicejohn 09 Jul 2016
This is probably what I should have submitted to CCJam, but Oh well.
bf to Lua Compiler
is a compiler I wrote because I wanted to do some experiments with the esoteric language brainfuck. i got the idea when someone linked the site esolangs.org, this person deserves credit, but I have forgotten who it was =/ (Tell me please! I want to thank you!)
This isn't the best or most efficient compiler since it sometimes leaves very redundant code, but the compiler filesize is only 999 bytes! (according to CC, 1.02KB according to pastebin...), and there's a minified version with only 882 bytes.
Feel free to one up me by writing more efficient or compact code, (since the original was 240 bytes) as a challenge.
The basic syntax:
No screenies, this just takes arguments in the shell.
Usage/Download:
Let me know if you find any bugs with my implementation, for comparison an online Interpreter can be found at https://copy.sh/brainfuck/
NOTE: My implementation does not print the alphabetical equivalent to a number, it just prints a number.
Please tell me if there is anything you would like to see change, suggestions or bugs.
Edited by supernicejohn, 09 July 2016 - 11:03 PM.
bf to Lua Compiler
is a compiler I wrote because I wanted to do some experiments with the esoteric language brainfuck. i got the idea when someone linked the site esolangs.org, this person deserves credit, but I have forgotten who it was =/ (Tell me please! I want to thank you!)
This isn't the best or most efficient compiler since it sometimes leaves very redundant code, but the compiler filesize is only 999 bytes! (according to CC, 1.02KB according to pastebin...), and there's a minified version with only 882 bytes.
Feel free to one up me by writing more efficient or compact code, (since the original was 240 bytes) as a challenge.
The basic syntax:
Spoiler
An example program:
Spoiler
No screenies, this just takes arguments in the shell.
Usage/Download:
Spoiler
Let me know if you find any bugs with my implementation, for comparison an online Interpreter can be found at https://copy.sh/brainfuck/
NOTE: My implementation does not print the alphabetical equivalent to a number, it just prints a number.
Please tell me if there is anything you would like to see change, suggestions or bugs.
Edited by supernicejohn, 09 July 2016 - 11:03 PM.
sci4me 09 Jul 2016
Nice work! I have also done this, so, I guess I may as well share it: https://github.com/sci4me/lbf
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
supernicejohn 10 Jul 2016
sci4me, on 09 July 2016 - 11:54 PM, said:
Nice work! I have also done this, so, I guess I may as well share it: https://github.com/sci4me/lbf
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
sci4me 10 Jul 2016
supernicejohn, on 10 July 2016 - 12:18 AM, said:
sci4me, on 09 July 2016 - 11:54 PM, said:
Nice work! I have also done this, so, I guess I may as well share it: https://github.com/sci4me/lbf
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
Thanks!
Try running the mandelbrot set generator program (https://raw.githubus...r/progs/mand.bf) or the towers of hanoi program (https://raw.githubus.../progs/hanoi.bf)
supernicejohn 10 Jul 2016
sci4me, on 10 July 2016 - 12:23 AM, said:
supernicejohn, on 10 July 2016 - 12:18 AM, said:
sci4me, on 09 July 2016 - 11:54 PM, said:
Nice work! I have also done this, so, I guess I may as well share it: https://github.com/sci4me/lbf
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
Thanks!
Try running the mandelbrot set generator program (https://raw.githubus...r/progs/mand.bf) or the towers of hanoi program (https://raw.githubus.../progs/hanoi.bf)
sci4me 10 Jul 2016
supernicejohn, on 10 July 2016 - 12:38 AM, said:
sci4me, on 10 July 2016 - 12:23 AM, said:
supernicejohn, on 10 July 2016 - 12:18 AM, said:
sci4me, on 09 July 2016 - 11:54 PM, said:
Nice work! I have also done this, so, I guess I may as well share it: https://github.com/sci4me/lbf
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
My compiler does not output to a file, it just runs the compiled bf code with loadstring.
It also does a few basic optimizations.
Thanks!
Try running the mandelbrot set generator program (https://raw.githubus...r/progs/mand.bf) or the towers of hanoi program (https://raw.githubus.../progs/hanoi.bf)
They're good tests for your bf programs. Can use them to test for correctness and speed.
InternetUnexplorer 13 Jul 2016
Haha, funny that. I'm currently making a Lua to bf compiler. Fun stuff, isn't it?