Brainfuck is to Turing machines what Lisp is to Lambda calculus. Minimum viable amount of syntactic sugar (and a bit of "semantic sugar" as well, it's nicer to work in bytes than bits) to make it usable as a programming language.
Lambda calculus is just a bit more practical formalism than Turing machines, that's why Lisp is genuinely useful as a programming language, unlike Brainfuck. That doesn't make learning about Turing machines any less useful as a brain teaser exercise.
It's more like what Binary Lambda Calculus is to lambda calculus. See my IOCCC entry
which happens to include a Brainfuck interpreter...
Indeed, the lambda calculus was never meant as a real programming language.
In fact, not even Lisp itself was originally meant as a real programming language! McCarthy invented it as a notation for mathematical proofs, and one of his grad students thought it might make a good language.
Look for the section heading "Catching Up with Math".
In BrainFuck, the "data" (the memory cells being mutated by the program) are completely separate from the code. As a consequence, BrainFuck code cannot self-modify and it has to maintain two pointers (instruction pointer and memory pointer). BrainFuck also allows the instruction pointer to jump arbitrarily far (i.e. from a "]" back to the corresponding "[").
In constrast, a Turing Machine makes no separation between code and data; it just has a tape (the machine's transition table is more like a language's interpreter than a program). Not only can a program modify itself, for many tasks it must; since the tape only advances one cell at a time, moving between two arbitrary cells requires the contribution of all those in between; whenever we traverse a cell, we must also modify it in preparation for any subsequent traversal.
Whilst BrainFuck is certainly a nice idea, I don't think it's the best example of anything in particular.
I wrote up some thoughts on this a few years ago http://chriswarbo.net/blog/2014-12-22-minimal_languages.html
I think you're conflating "Turing machine" with "universal Turing machine".
In a standard Turing machine, the state transition table is the "code". That code could be an interpreter for another language, including for arbitrary Turing machines, or it could be something entirely different. Either way, it's static, just like a Brainfuck program. In fact, the translation from Brainfuck to a Turing machine is trivial: if each cell of the tape is a byte, then each character of the program becomes one state of the machine.
Ahh... it's a work in progress. I should probably add an option to disable my optimization passes, for starters...
There's probably implementations of all of these in all the others out there. I'm just saying Forth is a Turing-style language with LISP-like simplicity and benefits.
I haven't really looked at Forth, is your comment about its "LISP-like simplicity" why is such a perennial favorite amongst language aficionados?
Any recommended readings on the subject(Forth) ?
Yosefk's write-up is the definitive one for me, though, showing an intro, some amazing stuff about it, weird stuff, and reasons for ultimately not going with it. Link:
However, it seems like the page linked in the post is not available anymore.
It's a Quine, a Palindrome and a Null Program all in one!
Back in the day when both memory and clock cycles were very precious, it wasn't unknown to use self-modifying code as a performance optimisation trick. I did it at least once in the late 80s, when I was working on comms software that had to be as fast as possible in order to avoid missing incoming data.
There was a check that needed to be done on every byte - I think it was whether I was now processing graphics characters or not - but the check was taking valuable time, and the value didn't change very often.
So the most efficient way I found to do it was to wait until I got a "switch to/from graphics" byte in the input stream and then update the instruction at a given location to either be "unconditional jump to graphics routine" or a "no operation (NOP)", which passed straight through to the routine for normal characters.
It was a horrible hack, but it worked.
Thankfully, I've not felt the need to even consider this approach for the past 20 years.
I don't think SMC has ever been "relatively mainstream", at least after HLLs gained popularity over Asm. But in Asm, it still has its uses where a full JIT would be far too much overhead.
That's because of all the branch predictors, probably. ;)
It is mainstream now that it is integrated into Java, C#, etc.
It was considered esoteric 20 years ago. Haskell initially had the slogan "avoid success at all costs".
SQL, HTML, CSS were probably esoteric at some point.
Perhaps a more interesting example is the MLs, which have been around far longer than Haskell and seem to be gaining popularity for implementating and transforming other languages (that was their original purpose, after all!).
Scheme's also managed to maintain a minor presence since the 70s, especially in education and as an extension/configuration language.
HTML was regarded as too mundane to be interesting when it first came out - a lot of people working on hypertext at the time (early 90's) regarded it as a simplistic toy.
Five or so years ago it as an esoteric language for statisticians, which had been around forever (especially if you count the predecessor S language).
Now the IEEE ranks it the 5th(!) most important (or something?) language, and it's the fastest growing language on StackOverflow.
That's a pretty amazing change for a language which has few redeeming factors (ha!) as a language, apart from lots of very useful libraries.
Duff's Device comes close. It was born out of a real engineering problem, but spread as esoterica and I'm sure I'm far from the only one to learn it as esoterica and later use it in production.
Hoon is a programming language that uses two-character runes instead of reserved words. It's purely functional and vaguely Lisp-like. It compiles down to a minimal combinator-based virtual machine built entirely out of cons cells and bignums, where the only operator is addition. And yet throughout all of that, it's actually possible (and scarily easy) to code in, and I'm somehow fluent in it. That kinda scares me.
Personally I think it looks like a great opportunity for an interesting weekend.
With GOTO, we can read a section of code and if it contains "GOTO N" then we know the execution will jump to location "N", so we can look up that location and keep reading. We have no idea if any other code will jump into the code we're currently reading, unless we search for "GOTO <location we're reading>".
COMEFROM is the opposite: when we're reading a section of code and we see "COMEFROM N", we know that the code at location "N" will jump to this section. We have no idea if the code we're reading will jump to somewhere else, unless we search for "COMEFROM <location we're reading>".
Despite being invented as a joke, this is very popular in mainstream programming, under the name "exception handling" ;)
I've heard tales of some of his code being absolutely unmaintainable. Guess I was wrong.
> I'd like to see one where the entire code is executed, or one done in Brainf*ck, as well.
I might be wrong, but this seems a really bad example for palindromes.
Aren't all palindrome strings made of `+-.,<>` valid brainfuck programs? I know that this subset is not turing-complete, but I also think that any valid brainfuck program with `` can't be a palindrome, which again would make this language a bad example.
Keep in mind that Malbolge is meant to be awkward, so while (-1, 0, 1) might be more useful, (0, 1, 2) suit Malbolge's perverseness much better, though I doubt that was a conscious decision.
"language designed to be as difficult to program in as possible. The first "Hello, world!" program written in it was produced by a Lisp program using a local beam search of the space of all possible programs."
You gotta give him some benefit of doubt. He has a genuine, diagnosed mental illness. And even if he did say racist, misogynist and other derogatory things, some of it was years ago and he might have changed as a person (and hopefully for the better). The memory of the Internet is sometimes too long.
I gotta agree with him about one thing: computers are best when they have 16 colors (I spend most of my time in xterm with my favorite sixteen colors).
While this charitable impulse is to be admired, I'm not sure "that was a long time ago and he might have changed" is inherently exculpatory.
Check his post history, he's still doing it. (I don't remember his current username otherwise I'd post links)
I think however, it's not just years ago. Wrote some more about this in the comment below ( https://news.ycombinator.com/item?id=12513807 )
The moderators or leaders need above-average talent for such places, though. ;)
As a believer in causality and a bit of chaos, I think we are 100% product of our surrounding and in that all innocent in all behavior.
In my home country (germany) this is luckily somewhat founded in the legislative system. If I'm not mistaken nobody here will get punished for the sake of revenge, but just to protect society. No matter what you do, you deserve the right to live an OK life. If you are are a danger to society its safety might however stand above your freedom of movement.
It's all about prevention through detention and deterrence. I don't believe much in deterrence, but want to keep up the corrective of society and make no exception for the bad behavior of this guy. If I'd address him directly I would aim for a more diplomatic approach tough. In general I want to express that I'm very much against some of his views and found it difficult to promote his work without distancing myself from his behavior and criticizing it.
Not excused, but allowances made. Unless somebody is an actual danger to others, if they exhibit some behaviour they have little or no conscious control over (such as is the case in schizophrenia, Tourette's, &c.), then they deserve at least some leeway. If it's possible for you to consciously work towards controlling such behaviour, then they deserve some leeway, just not as much. But regular assholes don't get a free pass in my book, though. Terry Davis has delusions he can't do much about, and that makes him different from somebody not dealing with schizophrenia, whose problem isn't due to delusions, but attitudes. This is an important difference, regardless of whether you consider free will to be a thing or not.
You might find this episode of the Rationally Speaking podcast interesting, as the guest aligns in some interesting ways with your point of view, and diverges in some even more interesting ones: http://rationallyspeakingpodcast.org/show/rs-163-gregg-carus...
I think it also makes sense to punish the rational criminal harder, because it actually might help, while the delusional person needs another kind of help.
I'm not sure how much you can do about your attitudes, I think freedom of will is an illusion. If you decide to turn your life around and become a good person, what made you do that? What made another one not do that? I think it's, as said, just the consequence of everything that ever happened before.
I sadly can't find the article anymore, in which it said that the illusion of a self and free will is important to stay the same person over time and that only than, someone can be held responsible for something and that society can only work if you have something to fear from doing wrong. In the article it was even mentioned to be proven by some simple evolutionary algorithm.
However, I like your vision even if I find it unrealistically utopian, and I upvoted you for the sentiment "No matter what you do, you deserve the right to live an OK life", which is curiously heartwarming.
About the unrealistic utopia: As said, some of this is fixed in the german law. I think there is a maximum of about 25 consecutive years of jail and of course no death sentence. More jail time is only lawful as detention to protect society for which you have to be diagnosed as mentally ill (highly likely to do very bad things again).
edit: actually 15 years is the german "for life" and you can't get 2x life-sentences at once, even for multiple offenses. There are just a few exceptions extending it to about 23-25 years. In the sentence that caused this law it says, that a human is nothing more than a wreck after 20 years and a longer sentence neither helps resocializing nor protecting the law and that the total psychological destruction would strip the affected of his basic human rights. (german source, no Idea how to deep-link: http://www.servat.unibe.ch/dfr/bv045187.html search for "Wissenschaftliche Untersuchungen" to find the passage)
If I ever start working on an OS as more than a practice exercise, I will have to ask friends and family for an honest assessment of my sanity.
If you put your opinions up on youtube (whether you have a mental illness or not), you open yourself up to public criticism. Maybe 'bigot' is a shitty word in general, and I was being partly facetious - but I've watched a few of the full templeOS youtube videos and they're disturbing - that's just my opinion.