News for hackers. Stuff that matters.
Re:A Brainfuck interpreter written in PostScript by lynx23 on Tuesday December 05, 2023 @09:38AM (#38531299)
The most awesome random submission I ever received was a BrainFuck compiler written in BrainFuck, by hand. Short story: I wrote a bf compiler in Emacs Lisp many many years ago. As a small testcase, I included a BrainFuck compiler in BrainFuck, which was written by a guy who wrote a C-alike to BrainFuck compiler so that he could implement his BF compiler in BF. That was a strange piece of code, about 6 pages of plain BF. A few years later, suddenly, I have this mail in my INBOX: A norwegian guy sent me a BF compiler in BF, written by hand. He was unsatisfied by the existing BF compiler, as it was generated. His implementation was about 6 lines of BF code. And it was a magnitude faster. Hats off to that guy!
Re:A Brainfuck interpreter written in PostScript by lakpan on Tuesday December 05, 2023 @11:49AM (#38533343)
How do you implement a compiler in 6 lines of code, let alone 6 lines of BF code?
Re:A Brainfuck interpreter written in PostScript by matslina on Tuesday December 05, 2023 @01:13PM (#38534743)
Whitespace is ignored in Brainfuck, so just write the compiler in brainfuck and then strip all but 6 newlines.
Re:A Brainfuck interpreter written in PostScript by fouc on Tuesday December 05, 2023 @02:59PM (#38536165)
I think lines should be hard wrapped at around 100 or 120. Linus prefers 100 for example.
Re:A Brainfuck interpreter written in PostScript by lakpan on Wednesday December 06, 2023 @01:17AM (#38540946)
This is such a Brainfuck answer