top | item 13139181

Show HN: A partial HTTP server written in brainfuck extended with syscalls

103 points| ajyoon | 9 years ago |github.com

59 comments

order

ww520|9 years ago

I think the best approach for the Brainfuck madness is to write a compiler/transpirer from a high level language (e.g. LOLCODE) to generate Brainfuck code. Then you can write your app in the high level language and show off the generated Brainfuck code.

thenewwazoo|9 years ago

If anyone out there in Internet land is going to do this, please, please select INTERCAL as the high-level language, I implore you.

greglindahl|9 years ago

It's really cute how the author added $ to insert a debugging break into the source. Instead of "debugging by printf", which is a bit tedious in brainfuck, this is driving your debugger by editing the source code. Bravo!

umanwizard|9 years ago

You laugh, but Python works the same way.

autotune|9 years ago

It's fantastic how the author was able to get this up and running, but not the hello world example.

ajyoon|9 years ago

listen...

tlrobinson|9 years ago

This is perhaps the most Hacker News headline ever.

andreaorru|9 years ago

This is madness. Also, has anyone noticed the Brainfuck interpreter is written in assembly?!

Rhinobird|9 years ago

>the Brainfuck interpreter is written in assembly?!

Having reached the lowest level of the machine, they started digging...

jksmith|9 years ago

Is this idiomatic Brainfuck?

cwmma|9 years ago

can we talk about how github has code highlighting supports brainfuck?

I didn't really expect that

kevincox|9 years ago

I was impressed, but then again it's like a 1h project so anyone with an interest can do it.

grabcocque|9 years ago

Please, I have a family. Don't do this.

partycoder|9 years ago

Because the brainfuck syntax is very simple, it's not really hard to generate a valid program from random characters.

The language is also Turing complete.

It is possible to use genetic programming (and other approaches) to generate brainfuck programs without an insane amount of effort.

Eventually the resulting program can be processed to be made more efficient.

le-mark|9 years ago

So we've come to this. At least it's not another javascript framework (ducks).

yoz-y|9 years ago

Baby steps, but we will eventually get to reactive-brainfuck.

mi100hael|9 years ago

I don't know whether to be impressed or scornful that it's interpreted rather than compiled.

ajyoon|9 years ago

I was surprised to learn that this has got to be one of the only languages which is easier to compile than interpret. When compiled the language reduces to basically a single-register assembly with a one-to-one character-to-line ratio. Bracket branching can be extremely easily implemented with jump labels and `test` + `jnz` statements without having to worry about things like parsing and jump table construction at all.

this-dang-guy|9 years ago

So delighted to see this :D I once fail/won with a paper in whitespace. I love the non-traditional programming languages. They're fun, whimsical, and sometimes a nice break.

LOLCode is still my favorite though. I wrote a prime number generator in it for fun :)

raw23|9 years ago

I think the author is a masochist

Pica_soO|9 years ago

The author wrote parts of sauerbraten, he is a cool guy and not afraid of anything.

rui314|9 years ago

Would it be easier to write a HTTP server in C and compile to Brainfuck using ELVM (https://github.com/shinh/elvm)?

ajyoon|9 years ago

Much easier, the equivalent C would be in the area of 15-20 statements