7 ms·
A Cover Letter in Brainfuck
- informatimago 12y agoWhat's wrong with a text file? Notice how brainfuck is specified to work on text files, not on PNG files!
- sp332 12y agoCan you embed a text file in the middle of a blog post?
- DatBear 12y ago<pre> anyone?
- cioban 12y agoIf only there was a way of showing text in a blog post...
- adlpz 12y agoWell... yes. You just, literally, paste it there. You can even throw in a <pre> for monospace shock value.
- sp332 12y agoThe formatting is pretty important for understanding this document. Even <pre> is just semantics and doesn't gurantee anything about presentation. Browsers just default to something monospace.
- icebraining 12y agoSure: http://jsfiddle.net/5CT5H/ http://jsfiddle.net/5CT5H/
- TazeTSchnitzel 12y agoiframe? How 90s! <object type="application/brainfuck" data="http://www.over-yonder.net/~gollingj/oldpage/text/limericks.txt" id="text-file"/>
- SonOfLilit 12y agoAuthor here - I found this old PDF in my gmail inbox, and have lost the source long ago. I'll see if I can extract the text out of it.
- seanhandley 12y agoBrilliant, though shame it's regarding entry to the Israeli military.
- JadeNB 12y agoCome on --that sort of political comment doesn't add anything constructive to the discussion.
- JasonFruit 12y agoIf the word "Israeli" were omitted, I don't think anyone would have questioned if it were constructive. I don't know that the extra bit of specificity ruined it, for me, at least.
- SonOfLilit 12y agoIndeed, sad. As a teenager in a country with conscription, you do what you can. Had I had a choice, this letter may have been targeted at Google. For the record, I think conscription is a bad idea for many reasons.
- danparsonson 12y agoThat's great :-) For other teeny DOS BF interpreters, see http://www.hugi.scene.org/compo/compoold.htm#compo6 http://www.hugi.scene.org/compo/compoold.htm#compo6 (1999) - smallest was 98 bytes!
- SonOfLilit 12y agoAt 19 my raw assembly optimization skills weren't even at national level, and we live in a _tiny_ nation. Some people do amazing things with x86 ASM.
- jebblue 12y agoKids may read HN, I'd think that exposing them to serious profanity would violate some countries laws and put HN at grave legal risk.
- sp332 12y agoIf swearing on the internet were illegal, most "user-generated content" sites would be shut down.
- deleted 12y ago[deleted]
- acomjean 12y agoI have questions: Did the letter work? Program and interpreter and letter, but why not let us with X86 machines cut and paste. What did the program do?
- SonOfLilit 12y agoOf course the letter worked in the technical sense. In the business sense - The letter was sent as a PDF to a contact I had, who promised to print it and hand it to the relevant recruiter. I never heard back from them, but I did get accepted somewhere much better, and I have good reasons to suspect there was a man-in-the-middle involved. I'll try and extract the text from this PDF. Of course I lost the source years ago (_in a thunderstorm_, no less).
- joeframbach 12y agoI tried to OCR the letter. The hex, I couldn't get. http://hastebin.com/raw/ogehefofez http://hastebin.com/raw/ogehefofez
- acomjean 12y agoThanks! Thats the source, so that will do nicely.
- SonOfLilit 12y agoI put the sources (including hex) in a gist at the bottom of the post.
- kachnuv_ocasek 12y agoThe first ever Brainfuck program whose source doesn't actually look bad.
- skrebbel 12y agoThat problem has a generic solution: https://github.com/eteeselink/bffmt https://github.com/eteeselink/bffmt
- personjerry 12y agoI think "formatted" is different from "doesn't actually look bad"
- Sir_Cmpwn 12y agoYou may appreciate this (I am the author): https://github.com/SirCmpwn/bf-irc-bot/blob/master/irc-bot.bf https://github.com/SirCmpwn/bf-irc-bot/blob/master/irc-bot.b...
- sheberight 12y agoI found your extra byte! s/confered/conferred/
- amckenna 12y agoThe extra byte he needed to shave off was in the 8086 assembly language brainfuck interpreter (in hex on the right of the letter) so it would fit nicely in a rectangle.
- SonOfLilit 12y agoAuthor here. Due to popular request, I extracted the text from the PDF, it's in a gist at the bottom. A funny (on my account) story: After three days with little sleep, the last half-day spent finding just one more byte to remove so it fits in a nice rectangle[1], I was finally done. I sent the complete .asm to Oded Margalit, an IBM researcher who organizes the CodeGuru programming competitions in Israel, and he immediately responded "I can shave 5 bytes off". It turns out instead of the "quit" system call all the books tell you to write: ;;; the program has finished quit: mov ah, 04ch ; quit with return code mov al, 0 int 021h You can just put a "ret", and DOS loads an address containing these commands to the bottom of your stack so it works. You had to see my reaction. [1] it was supposed to be 32x13 characters at the bottom, after it was done I decided to make it 8x52 characters on the right because it looked better. Had I known I would do it, I could've gone to sleep much earlier...
- outworlder 12y agoI guess CP/M did that, and that's why MS-DOS did it as well.
- unwind 12y agoI love it how the OS does the obviously right thing (at least to my eyes, returning from the application's main() function equivalent makes 100% perfect sense), but people who have obviously spent a b*ttload of time with these things are still surprised. Not sure if it's irony, or just tragic. Good story though, thanks!
- SonOfLilit 12y agoIt's maybe the right thing, but not the obvious thing. In the context of DOS assembly language programming, the only obvious thing is "nothing". DOS is barely an OS, it's mostly a library of function calls. DOS does nothing most of the time, so you expect it to do nothing all the time. At the time I didn't yet spend a lot of time doing DOS assembly language programming, but since then I did, and had I heard about this for the first time today, I would be really surprised.
- 12y ago
- maerF0x0 12y agoMy guess is that most HR people would see that and think "Troublemaker", Next.. But, then again, maybe you dont want to work for them anyways.
- SonOfLilit 12y agoI was so much of a special case at the time that they would do that anyway. I needed to take a gambit that would have some probability of failing at the gatekeeper, but would yield rewards proportional to risk. And of course _I didn't send it to an HR person_. I don't understand why would a programmer ever send his CV to an HR person. My CV always gets passed to a programmer who can read it and see my value, he passes it on to his team lead, who knows he wants _me_ and lobbies HR on my behalf. Works way better.
- SonOfLilit 12y agoIn fact, two weeks ago I had to take a similar gambit. Here is what I sent this time (to a large group of alumni of the unit I served in). I got a few offers, but I'm still open to propositions: My CV in one sentence: "Ask anyone in 8200." I'm busy with my venture (spreading code literacy as wide as literacy), so I can only help you at 30% capacity or for a short period. I'm looking for the project where my experience and entrepreneur mindset would bring the most value. Hire me to prototype your new product, automate your workflow, refactor your MVP into a maintainable architecture, research new technology, fix the bug you gave up on, mentor your juniors, or just join your team. I take full responsibility for my work. This is especially valuable in organizations where the bottleneck for R&D is management attention. Does it describe you? To summarize, I won't solve every problem you have, but I may be able to solve one, without taking up precious manager time. I'm also available for consulting. Cheers, Aur P.S. My hobby is to join companies for 1-2 days. Any such job offer would be accepted automatically עד גמר המלאי [while supplies last - AS]. Need something done but your developers are crunching? Need a really simple MVP? Want a second pair of eyes on your design? I can probably deliver. Ask me. I shine with Python and C, programmed professionally in C#, Ruby, Haskell, C++, Java, Javascript, and x86 assembly language, and learn fast. I write unit tests for my hobby projects.
- greg7mdp 12y agoThis is brilliant!
- dreamweapon 12y agoSo you were expecting IDF human resource types to have a sense of humor?
- SonOfLilit 12y agoNo, just IDF technologist types.
- esseti 12y agoso, what does the program do?
- SonOfLilit 12y agoWhy don't you paste it in an online Brainfuck interpreter and find out? :-)
- deleted 12y ago[deleted]
- adestefan 12y agoYou get bonus points if you find a 32-bit Windows machine and use DEBUG to load in the interpreter. It's like a modern day copy of BYTE.
- amckenna 12y agoFor those wondering what the program does: TL;DR - The program writes a Brainfuck program that writes the text you inputted. Pretty neat First copy the text of the letter (excluding the x86 interpreter in hex on the right, or in the case of the gist, at the bottom) and run it through an online Brainfuck interpreter. Supply ASCII text input such as "A" and run the program. It will output another Brainfuck program. If you then run the outputted program through the Brainfuck interpreter you will get the same ASCII text. So if you run the code extracted from the letter: +++++++++[<+++++>-],[[-<--.++<+>>(]<+.-<[->.<]>>,] If input an 'A' the output is: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.----------------------------------------------------------------- which if run returns an 'A' Online interpreter - http://nayuki.eigenstate.org/page/brainfuck-interpreter-javascript http://nayuki.eigenstate.org/page/brainfuck-interpreter-java...
- TheLoneWolfling 12y agoHmm... It would be interesting to do something similar, but optimizing for output code size. For example, I'm pretty sure that the following is one of the shortest representations of "A" in BF, although it doesn't clean up after itself. -[+>+<[+<]>]>+.