Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interesting, I tried to convert Z combinator in SKI to this using the lambda calculus example then print out the tree. Untested:

    z = (t (t (t t (t (t (t (t (t t (t (t (t (t (t t)) (t t))) (t (t (t t)) (t t))))) (t (t (t t (t (t (t t (t (t (t t t)) t))) (t t)))) (t (t (t t (t (t (t (t (t t)) (t t)))))) (t t))))) (t t (t (t (t (t (t t))))))))) (t (t (t (t (t t (t (t (t (t (t t (t (t (t t (t (t (t t t)) t))) (t t)))) (t (t (t t t)) t))) (t t (t t))))) (t (t (t t (t (t (t (t (t t (t (t (t t (t (t (t t t)) t))) (t t)))) (t (t (t t t)) t))) (t t (t t))))) (t (t (t t (t (t (t t t)) t))) (t t))))) (t t (t (t (t (t (t t (t (t (t (t (t t)) (t t))) (t (t (t t)) (t t))))) (t (t (t t (t (t (t t (t (t (t t t)) t))) (t t)))) (t (t (t t (t (t (t (t (t t)) (t t)))))) (t t))))) (t t (t (t (t t (t (t (t (t (t t (t (t (t (t (t t (t (t (t t (t (t (t t t)) t))) (t t)))) (t (t (t t t)) t))) (t t (t t))))) (t (t (t t (t (t (t (t (t t (t (t (t t (t (t (t t t)) t))) (t t)))) (t (t (t t t)) t))) (t t (t t))))) (t (t (t t (t (t (t (t (t t)) (t t)))))) (t t)))))))) (t t)))))))
Original tested but unoptimized and also converted using tool:

    var K = a => b => a;
    var S = a => b => c => a(c)(b(c));
    var Z = S(K(S(S(K(S(S(K)(K))(S(K)(K))))(S(K(S(K(S))(K)))(S(K(S(S(K)(K))))(K))))(K(S(S(K))))))(S(S(K(S(S(K(S(K(S))(K)))(S))(K(K))))(S(K(S(S(K(S(K(S))(K)))(S))(K(K))))(S(K(S))(K))))(K(S(S(K(S(S(K)(K))(S(K)(K))))(S(K(S(K(S))(K)))(S(K(S(S(K)(K))))(K))))(K(S(K(S(S(K(S(S(K(S(K(S))(K)))(S))(K(K))))(S(K(S(S(K(S(K(S))(K)))(S))(K(K))))(S(K(S(S(K)(K))))(K))))))(K))))));
https://en.wikipedia.org/wiki/Fixed-point_combinator


This code is so easy to read.


It's equivalent to binary machine code for a procesor with 5 opcodes.

Why would it be readable?


No kidding.. I didn't think parenthesis hell could get worse than Lisp


Well really this language just takes the next logical step by removing all but a single symbol.

The next one would be () = t, to finally get a language consisting solely of parentheses.


Any source code in any programming language can in theory be encoded in unary, requiring only a single symbol (and without any need for extra grouping or whitespace). It's not gonna be efficient, though.


Yeah, I think I'm going to take the author's advice and use Tree Calculus to generate JSON config files. That way I won't need to use a bloated tool with a JSON parser just to output configuration.


Z = \f. (\x. f (\v. x x v)) (\x. f (\v. x x v)) can be much simpler, namely S (S (K (S S (K (S (S K K) (S K K))))) K) (S (K (S S (K (S (S K K) (S K K))))) K)


If you means that it would be like this:

    var Z = S(S(K(S(S)(K(S(S(K)(K))(S(K)(K))))))(K))(S(K(S(S)(K(S(S(K)(K))(S(K)(K))))))(K));
Unfortunately not works with the `count_fn` function from the wikipedia page :(, `too much recursion`.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: