Live data from Hacker News

PG on the cover of Forbes

forbes.com

31–40 of 70 posts

Re: PG on the cover of Forbes

#31
post #24

Earlier quoted context omitted.

> Heh... completely wrong, but I suppose it's the best you can expect a non-techie/math nerd readership to get. Heck, it's probably close to the most you can expect the average programmer to get. How would you explain the Y Combinator to the Hacker News readership?

The Y combinator is a programming construct allowing one to write recursive functions without explicitly calling themselves (unnamed recursive functions): (define Y (lambda (X) ((lambda (procedure) (X (lambda (arg) ((procedure procedure) arg)))) (lambda (procedure) (X (lambda (arg) ((procedure procedure) arg))))))) (define F* (lambda (func-arg) (lambda (n) (if (zero? n) 1 (* n (func-arg (- n 1))))))) (define fact (Y…

I took the liberty of translating this to JavaScript, primarily to help me understand it, but thought I should share:

    // (define Y
    //   (lambda (X)
    //    ((lambda (procedure)
    //       (X (lambda (arg) ((procedure procedure) arg))))
    //     (lambda (procedure)
    //       (X (lambda (arg) ((procedure procedure) arg)))))))
    var Y = function(X) {
        return (function (procedure) {
            return X(function (arg) {
                return procedure(procedure)(arg);
            });
        })(function (procedure) {
            return X(function (arg) {
                return procedure(procedure)(arg);
            });
        });
    }

    //  (define F*
    //   (lambda (func-arg)
    //    (lambda (n)
    //      (if (zero? n)
    //          1
    //          (* n (func-arg (- n 1)))))))
    var F = function(func_arg) {
        return function(n) {
            if (n === 0)
                return 1;
            else
                return n * func_arg(n - 1);
        };
    }

    //  (define fact (Y F*))
    var fact = Y(F);

    //  (write (fact 8))
    console.log(fact(8));

Re: PG on the cover of Forbes

#32
post #22
post #19

Earlier quoted context omitted.

I wouldn't. I barely understand the concept myself. :-) ...but I know it's much more involved than "a program that runs other programs".

afaik it's pretty academic. The only practical application is to allow recursion in languages that don't do recursion which is pretty much none. This is a good description if you're into that sort of thing: http://mvanier.livejournal.com/2897.html The meat of it is that you can 'do' recursion by building up functions that call other functions :/ meh

Wow, hmm.. I worked a MEDITECH a long time ago, and they actually used a programming language, MAGIC, that you couldn't recurse in. It used macro code expansion to take MAGIC code and output into a lower level language and recursion would make it loop infinitely. Maybe at MEDITECH it wouldn't have been so academic.

Edit: Not sure why this got downvoted, but in their internal programming course they talked about the recursion problem explicitly--I'm not making this up, as crazy as it sounds.

If you don't believe me, here is a link to a blog post with someone else mentioning it in the comments:

http://htmlcoderhelper.com/what-is-the-worst-programming-lan...

Re: PG on the cover of Forbes

#34
post #8

Earlier quoted context omitted.

A nice, striking (against the red), somewhat atypical picture of PG. Did the photographer coach to suppress the usual smile?

His eyes are smiling, I bet he's about to crack up.

his left eye makes me happy. i wonder why.

Re: PG on the cover of Forbes

#35
post #22
post #19

Earlier quoted context omitted.

I wouldn't. I barely understand the concept myself. :-) ...but I know it's much more involved than "a program that runs other programs".

afaik it's pretty academic. The only practical application is to allow recursion in languages that don't do recursion which is pretty much none. This is a good description if you're into that sort of thing: http://mvanier.livejournal.com/2897.html The meat of it is that you can 'do' recursion by building up functions that call other functions :/ meh

The "meat" of it is really that (Y F) = (F (Y F)). In other words Y applied to a function F expands to F applied the original expression, so it builds up nested calls of F.

I can't do it justice, but it's definitely much more interesting and even beautiful than "meh". I guess there are always "practical" vs "academic" arguments to be made but I find stuff like the lambda calculus, Y, Church numerals, all really cool.

Re: PG on the cover of Forbes

#37

Earlier quoted context omitted.

> Heh... completely wrong, but I suppose it's the best you can expect a non-techie/math nerd readership to get. Heck, it's probably close to the most you can expect the average programmer to get. How would you explain the Y Combinator to the Hacker News readership?

There have been explanations for the HN readers. Here's one that I'd put in a non-techy newspaper: The Y Combinator is a way to make computer code self-referential without having to introduce names for parts of the code. Or a bit less accurate: The Y Combinator is a clever way to make computer code self-referential.

Non-techy readers would have no idea what "self-referential" means. Probably best to just leave it alone.

Re: PG on the cover of Forbes

#38
post #22

Earlier quoted context omitted.

afaik it's pretty academic. The only practical application is to allow recursion in languages that don't do recursion which is pretty much none. This is a good description if you're into that sort of thing: http://mvanier.livejournal.com/2897.html The meat of it is that you can 'do' recursion by building up functions that call other functions :/ meh

The "meat" of it is really that (Y F) = (F (Y F)). In other words Y applied to a function F expands to F applied the original expression, so it builds up nested calls of F. I can't do it justice, but it's definitely much more interesting and even beautiful than "meh". I guess there are always "practical" vs "academic" arguments to be made but I find stuff like the lambda calculus, Y, Church numerals, all really cool.

Yeah ok, it's sort of interesting as a curiosity. But it's going to be terribly inefficient if used, and doesn't really have any practical application.

I've always been more of a practical "why not just use a loop" kinda guy, so it's probably wasted on me.

Re: PG on the cover of Forbes

#39
post #2

"Y Combinator--a computer term for a program that runs other programs" Heh... completely wrong, but I suppose it's the best you can expect a non-techie/math nerd readership to get. Heck, it's probably close to the most you can expect the average programmer to get. EDIT: And another one... "Graham met Morris, an authority on the Unix computer language"

> Heh... completely wrong, but I suppose it's the best you can expect a non-techie/math nerd readership to get. Heck, it's probably close to the most you can expect the average programmer to get. How would you explain the Y Combinator to the Hacker News readership?

You can find an explanation on Wikipedia too: http://en.wikipedia.org/wiki/Fixed_point_combinator

Re: PG on the cover of Forbes

#40
post #32
post #22

Earlier quoted context omitted.

afaik it's pretty academic. The only practical application is to allow recursion in languages that don't do recursion which is pretty much none. This is a good description if you're into that sort of thing: http://mvanier.livejournal.com/2897.html The meat of it is that you can 'do' recursion by building up functions that call other functions :/ meh

Wow, hmm.. I worked a MEDITECH a long time ago, and they actually used a programming language, MAGIC, that you couldn't recurse in. It used macro code expansion to take MAGIC code and output into a lower level language and recursion would make it loop infinitely. Maybe at MEDITECH it wouldn't have been so academic. Edit: Not sure why this got downvoted, but in their internal programming course they talked about the r…

Why is it an issue though? Recursion is an optional thing some programmers like using. It's not necessary.

edit: rather than downmod me to -1 for stating a fact, why not reply?

Post reply on HN