For those of you who like this stuff, the "J Incunabulum" will probably be really interesting. It's an early draft of a J interpreter, written in J-styled C.
Also, unlike Brainfuck, unlambda, lolcode, malborge, etc., J and related languages are used for real work. They're just really dense, like regular expressions for vector/matrix math.
This is a really interesting piece of code. The style of C programming looks unreadable for the uninitiated, but is in fact very close to what in do in mathematics. I will try to play with this style myself (not for working code, of course).
It's very old, pre-K&R C. It segfaults for me, too, in ga.
It got me interested in the language, but rather than trying to rewrite it, I decided to go through "J For C Programmers" (http://www.jsoftware.com/help/jforc/contents.htm) on my lunch breaks. The APL language family has several interesting ideas, the fanatically terse syntax is just the first one everybody notices.
Considerably less fun to toy around with now that the only way to get a non completely crippled version is to pay megabucks (or work at a company that develops in it). If I'm wrong, please please clue me in...
It's a one-page draft of an interpreter for a subset of a language, by one of the main designers involved with it, written to the initial designer. It's written in C, but idiomatically written as closely to the language as possible. Having comments would be pretty strange, honestly.
Agreed. I think it's atrocious C style, it just makes sense for people who write J natively to style the C that way in a context where it will be understood.
The 'J-styled C' reminds me of how the original Bourne shell was written with ALGOL syntax in C using cpp macros, and implements a language with ALGOL-flavored syntax.
You could compile to brainfuck, treating it as a very simple virtual machine. It's just simplified to the point of being incredibly inefficient, like factoring Church-encoded numbers with Prolog's unification, rather than using its built-in mathematical primitives.
(Whether the bf compiler was actually written or just generated by compiling to bf is neither here nor there.)
Well, with an increasing version system, you can never tell when you're finished. Is version 3 FINAL the final version, or is some new maintainer going to come make version 4 anyways? If you iterate toward 0, your final product can be awib-0, and you'd be hard pressed to find a new version number without further confusing the three people who got what you were going for.
I don't want to sound offensive, but do wonder what is the purpose of this exercise? Is there any problem this project is solving? Or is it 'just' for educational purpose?
Writing a brainfuck interpreter in a language is a good way to size it up. Unlike "hello world", it actually gives you a meaningful impression of how string handling, data structures, etc. work. It's not hard, but it's just enough to work up a sweat -- like a web-programmer writing a blogging engine or a wiki to try out a web framework. (If it is hard in the language, that should also tell you something.)
Yeah but that doesn't explain why one would write a brainfuck interpreter in brainfuck.
Day 163: Project complete. Strength nearly gone. Must.. complete... evaluation.... Data structures, godawful... string handling, non-existent... writing a brainfuck interpreter, gigantic pain in the ass.... Conclusion: this better get me laid. Oh sh.. signal lost
I think it is quite an amazing feat to write in brainfuck at all (to me it means you have both too much time on your hands and that you grok turing machines), to write a self-hosted compiler (ok, a brainfuck to C translator) is a very neat hack.
If that doesn't work for you think of it as art. Not everything has to have a direct purpose.
Because they can, you can't, and you will never understand it even given all the source code.
Also nice ascii art.
Its not educational, its b0w b3f0r3 m4h sk1llz!
I must also agree with one of the posts here... It is art. Its geek art but it really is art. Judges who say source code is not art should also admit michalengelo was just some asshole who put grafitti on some holy buildings.
>> Judges who say source code is not art should also admit michalengelo was just some asshole who put grafitti on some holy buildings.
> Michelangelo's frescoes were commissioned. I utterly fail to see why anyone should admit they were graffiti.
The negatives confuse the sentence, but that was his point. Michelangelo's works were not graffiti, and similarly source code should be considered art, even if it is geek art.
http://code.google.com/p/awib/source/browse/builds/awib-1.0r...