35 comments

[ 3.4 ms ] story [ 106 ms ] thread
tldr: brainfuck but each token has been replaced with a different heart-related emoji
If a link to a GH page that has basically 0 info on it as to what this miraculous thing that made it to HN is, is too long to read...
I did the same BF-token replacement thing but made the tokens into a slightly awkward song, https://soundcloud.com/n-gram-music/brainfunk-get-with-the-p... Albeit, more to see if arbitrary pop lyrics could encode programs (they can).
that was awesome! Mind sharing the program encoded in the song?
Thanks! That's the "art." The shasum is of the original program so you can know you've transcribed it correctly. :)
I'm trying _really_ hard not to get nerd sniped by this but I think you're going to win.
tldr: ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ (it says I love you)
Unfortunately your code didn't survive HN, those characters all show as U+2665 BLACK HEART SUIT
Most endearing esoteric programming language yet. Your aunt will love it
I thought this was going to be another OpenSSL bug. I'm glad it isn't.
(comment deleted)
Your heart skipped a beat?
(comment deleted)
That was my first thought as well.
I wish the emoji they selected for > was visibly distinct from the emoji for -, which is also nearly indistinguishable from the emoji for +. It pains me to say this but I think this language might not be ready for prime time.
If languages like this pain you, they're performing as designed.
I think the parent comment was tongue in cheek ;)
oh god. Could you imagine someone actually using this to write a real program?? Get it into production? oh, my eyes are bleeding....
Before clicking the link, I thought this was going to be like Brainfuck but instead of having crazy syntax that fucked with your brain, it would have crazy tooling and yak-shaving that quickly made you lose heart before ever being able to actually get a program to run and deploy.
This impedance matched my brain just enough to now get the point behind brainfuck. You could quite easily write a forth interpreter in it.

Could this help me understand Turing machines? Just checked... nope, they still seem weird.

Turing machines are like brainfuck with goto instead of loops.
A Turing machine is actually similar to brainfuck.

It has a tape (endless array) just like brainfuck does, although rather than integers in each cell, there is a user defined set of symbols. The simplest possible set of symbols would be "0" and "1", although you can have many more, including say a set of 256 integers like brainfuck.

Each "instruction" (state) lets you specify what symbol to write, a "move left" or "move right" command, and what the next instruction will be (goto style), except that you get to specify the symbol to write, the move left or right, and the command to jump to. You specify all of those things independently for each and every possible symbol that might be at the current tape position. You also have the option of specifying no next command, in which case the machine halts.

So to do the equivalent of "+" in brainfuck, you would specifying that is "3" is present you write "4", if "4" is present you write "5", etc. You specify for all of these a "no movement" option if your formulation of Turing machines allow that (otherwise, you translate it to a move right, followed by an extra state that writes back the value read and move left). You specify that for all possible values you read you will jump to the the "next" instruction.

For the equivalent of a "]" instruction, you would specify to write back the symbol you just read, no movement, and if the value you read was a zero, you jump to the "next" instruction, otherwise you jump back to the command right after the corresponding "[" instruction.

You would probably want to design a compact way of specifying this, the mathematical formulation of Turing machines only cares that a mapping exists, not how you chose to specify that mapping. Actually specifying all the mappings explicitly would take up a lot of room, and be hard to understand. This is especially true if you have a lot of distinct symbols that can appear on the tape of your Turing machine.

Unlike brainfuck, a Turing machine has no system for reading input or writing output, except the tape itself. For input you need to prespecify any needed values on the tape, and for output, you read the tape once you reach the end. This means a Turing machine cannot be interactive. You cannot enter input that depends on the what it previously wrote as output. To do interactivity, you instead have a group of Turing machines, where each one stops when they want input, you read the output, and modify the tape to specify the input, and then start the next Turing machine on that tape. (With some clever work, it is possible for it to be the same Turing machine every time, by having a symbol at the current represent the state (instruction) to resume at, having it write a value there before halting, and read that value when starting up, and jump to said state.

I've outlined one approach for handling non-interactive I/O below in brainfuck-esque style below. It is complicated and not super pretty, but it does work.

-----------------------

One useful approach lets you simulate having multiple tapes: one for computation, one i/o. You might interleave cells, so a group of 3 cells consists of one cell for computation purposes, one cell that represents i/o, and a last cell where you can store a value that indicates if this cell cluster is the "origin" one, if this cell cluster represents the current Input position, if it represents the current output position, and if it represents the current computation position. 4 orthogonal flags, so 16 distinct symbols can be used used to indicate any combination of these flags.

Perhaps input uses i/o cells to the right of the origin position, and output uses i/o cells to the left of the origin position (and thus "backwards"), with computation always limiting itself to cell to the right of input position (for simplicity).

Then to implement an output current cell ...

This is a joke. The problem is it's a boring and derivative joke. Brainfuck is 99% of the joke, then Heartfuck goes "haha guys what if instead of <>+-.,[] we used various heart emoji?" and it just isn't nearly as funny as the original joke, Brainfuck. This is less funny than most intentionally-unfunny memes.
Ook is pretty funny though, even if its a trivial BF derivative. Whitespace (use of tab, space, and newline) is also quite funny IMO.

Heart emojis is somewhat uninspired compared to Ook and Whitespace though.

I think the obvious pointlessness is the joke.
As far as Rube Goldberg machines go, taking somebody else's machine and painting it red hardly qualifies for re-examination of the concept by anyone.
It might be fast if implemented on a laser beam instead of tape. (I wonder if it’s technically possible?
Okay, but is HFaaS[1] on the roadmap? I'd ask if there is a PoC of it running Doom, but with all this love Chex Quest might be a more wholesome choice.

[1] - https://zserge.com/posts/bfaas/