8 ms·
Show HN: A partial HTTP server written in brainfuck extended with syscalls
- le-mark 10y agoSo we've come to this. At least it's not another javascript framework (ducks).
- yoz-y 10y agoBaby steps, but we will eventually get to reactive-brainfuck.
- Artemix 10y agoAnd maybe a brainfuck framework to develop cross-platform apps
- Cyph0n 10y agoI've already filed a patent for BaaS (Brainfuck as a service), so don't even think about it guys. I'm in it for the long run ;)
- nickpsecurity 10y agoThat's funny because I already had this patent describing: "Combination of Brainfuck with paper mediums for transmission to location for processing, storage, distribution, and archiving of said combinations." If you made a Brainfuck patent, you need to write me a check.
- qwertyuiop924 10y agoI can verify: he mentioned it in the thread on the sigtbd parallel brainfuck CPU paper (and yes, that was real: you can look it up).
- qwertyuiop924 10y ago...Wait, wrong patent. Nevermind. Still funny though.
- nickpsecurity 10y agoYou should've left off the correction. Now I can't supeona you for the trial in East Texas.
- qwertyuiop924 10y ago...Well than you'd sue me when I testified accurately on the stand, and that would hardely be ideal, now would it?
- ifdefdebug 10y agoOk but first we should rewrite the kernel in brainfuck. No, really.
- foota 10y agoWaiting for serverless brainfuck
- nickthemagicman 10y agoAll someone has to do is write a JS->brainfuck transpiler and we could have this.
- this-dang-guy 10y agoHow about one where style pages via bf->js->sass->css
- nickthemagicman 10y agoI mean yeah but this is javascript. Only 3 phases of transpilation is for noobs. brainfuck->typescript->es6->via babel->es5->postCss plugins->sass->css->transpiled to react components->transpiled to an Angular 2 project->to webcomponents->transpiled to ArnoldC language->transpiled to a Turing complete Shopify liquid template-> commonjs and browserified->rails sprocket pipeline->then piped to /dev/null It's not easy being a Javascript Ninja/Rockstar.
- this-dang-guy 10y ago/Slowclap :D
- msiggy 10y agothe pipe to /dev/null made it all worth it
- hobofan 10y agoI'd really like to see that. I'm eager to build a small program that takes style offenses like nested ternary operators and replaces them with a still functional brainfuck equivalent, to highlight how anoying that style of programming is to read.
- nickthemagicman 10y agoThats hilarious lol Or some of those rediculously dense ruby one liners could fit the bill too.
- andreaorru 10y agoThis is madness. Also, has anyone noticed the Brainfuck interpreter is written in assembly?!
- Rhinobird 10y ago>the Brainfuck interpreter is written in assembly?! Having reached the lowest level of the machine, they started digging...
- nickthemagicman 10y agoLol and assembly is more readable.
- autotune 10y agoIt's fantastic how the author was able to get this up and running, but not the hello world example.
- ajyoon 10y agolisten...
- mi100hael 10y agoI don't know whether to be impressed or scornful that it's interpreted rather than compiled.
- ajyoon 10y agoI 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.
- QuercusMax 10y agoIt's pretty freaking easy to interpret, as well... I implemented an interpreter in Go (which I had never used before) in an hour or so; most of the time spent was learning the two languages (Go and BF). I should start asking interview candidates to write a BF interpreter...
- gregmac 10y agoIsn't leaving comments or whitespace in brainfuck code considered bad form?
- ajyoon 10y agoThere is a minified version here if you're into that kind of thing https://github.com/ajyoon/systemf/blob/master/examples/http/minified_server.bf https://github.com/ajyoon/systemf/blob/master/examples/http/...
- forgotmyacc 10y agolol
- forgotmyacc 10y agolol
- raw23 10y agoI think the author is a masochist
- Pica_soO 10y agoThe author wrote parts of sauerbraten, he is a cool guy and not afraid of anything.
- lmurray 10y agoDo you play? I spent ages on that game. Any word on why that would mean he isn't afraid of anything?
- Pica_soO 10y agoI played the banabread fork- and tried to mod the engine once to make Turmalin, a sort of team-deathmatch meets 3d-tetris game. https://springrts.com/phpbb/download/file.php?id=6378 https://springrts.com/phpbb/download/file.php?id=6378 The not being afraid of going unconventional ways refers to the levels of sauerbraten being stored in octrees. This is quite tough too edit if you are used to 3dsmax and blender. Actually that was too much effort- thus the project never came to be- but the way its stored and accessed, is blazingly fast and effective. One has to admire this skills.
- mappu 10y ago> Any word on why that would mean he isn't afraid of anything? http://knowyourmeme.com/memes/pretty-cool-guy http://knowyourmeme.com/memes/pretty-cool-guy
- greglindahl 10y agoIt'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 10y agoYou laugh, but Python works the same way.
- greglindahl 10y agoI was laughing in a good way, it's always cool to see not only the "thing" but how it was debugged. As for python, I debug it by adding print() statements. No debugger involved. If there's a way to insert debugger breakpoints in the source, I'm unaware of it.
- deepanjanroy 10y agoI recently learned you can do a similar thing with C/C++ too. Programmatically raise a SIGINT when running under gdb, and gdb will intercept that signal, at which point you can step through the code.
- therein 10y agoYeah, in Windows you have the `DebugBreak/__debugbreak()` function [0]. For POSIX you have `raise(SIGTRAP)` or gcc you have `__builtin_trap()` which actually has some caveats. [1] [0] https://msdn.microsoft.com/en-us/library/windows/desktop/ms679297(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ms6... [1] https://stackoverflow.com/questions/173618/is-there-a-portable-equivalent-to-debugbreak-debugbreak https://stackoverflow.com/questions/173618/is-there-a-portab...
- grabcocque 10y agoPlease, I have a family. Don't do this.
- bweitzman 10y agoWhy call it systemf? That name is already taken: https://en.wikipedia.org/wiki/System_F https://en.wikipedia.org/wiki/System_F
- ww520 10y agoI 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 10y agoIf anyone out there in Internet land is going to do this, please, please select INTERCAL as the high-level language, I implore you.
- hood_syntax 10y agoI put in a vote for Malbolge
- nfd 10y agoOoh, or the highest-level language, Homespring. http://xeny.net/Homespring http://xeny.net/Homespring
- hood_syntax 10y agoI kind of want to implement that now...
- jksmith 10y agoIs this idiomatic Brainfuck?
- cwmma 10y agocan we talk about how github has code highlighting supports brainfuck? I didn't really expect that
- kevincox 10y agoI was impressed, but then again it's like a 1h project so anyone with an interest can do it.
- rui314 10y agoWould it be easier to write a HTTP server in C and compile to Brainfuck using ELVM (https://github.com/shinh/elvm https://github.com/shinh/elvm)?
- ajyoon 10y agoMuch easier, the equivalent C would be in the area of 15-20 statements
- this-dang-guy 10y agoSo 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 :)
- partycoder 10y agoBecause 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.
- tlrobinson 10y agoThis is perhaps the most Hacker News headline ever.