A discussion about a student assignment I've just set has reminded me of this entertaining IOCCC winner from @Augustsson https://www.ioccc.org/years.html#1996_august …
-
Show this thread
-
The assignment is an exercise in refactoring. Usefully refactoring that C code would be worth more credit than I would ever be allowed to give.
1 reply 0 retweets 3 likesShow this thread -
Replying to @edwinbrady
He won the IOCCC multiple times using the same trick of (manually?) compiling lazy functional code to C :-) I won with a functional graph reduction engine; it’s a good trick!
1 reply 0 retweets 0 likes -
Replying to @fanf
Ooh, where is yours? He gave a talk about his at a dependent types workshop several years ago, partly to encourage us to write programs which did something vaguely practical...
1 reply 0 retweets 0 likes -
Replying to @edwinbrady
http://www.ioccc.org/years.html#1998_fanf … The functional side of it is relatively well documented; the bit I no longer understand is the preprocessor trickery with mismatched brackets and shit that builds the initial expression graph
1 reply 0 retweets 1 like -
Replying to @fanf @edwinbrady
It’s a conventional turner-style SK combinator reduction engine that uses a vaguely monadic io model passing around a token representing the state of the world
1 reply 0 retweets 0 likes -
Replying to @fanf
Oh, very nice. I'm not about to try to work out the preprocessor magic but it's fun to see "conventional" and "IOCCC" in such close proximity.
1 reply 0 retweets 0 likes -
Replying to @edwinbrady
No, the C is not conventional :-) (I broke arm cc with my huge main() because it always ran an O(n^2) register allocator even in the least optimising mode!)
1 reply 0 retweets 1 like
That sounds not unlike the problem I’m currently having with the C that Idris spits out…
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.