Live data from Hacker News

List out of Lambda

stevelosh.com

41–49 of 49 posts

Re: List out of Lambda

#41
post #34
post #18

I get that JavaScript is a popular language, but burying a fundamental concept under a cluttered and confusing syntax like JavaScript, when it's much cleaner to explain the math using sensibly notation. Ugh. It's nice that Steve is reaching down to his audience, but it would be nice for the audience to step out of their muddy sandbox once in a while.

I have a degree in mathematics from the University of Chicago. Want to talk about self-adjoint algebras of compactly supported continuous functions? I'm your man. I also think teaching this using mathematical notation would be a mistake. People only learn things when they relate in part to something they already know. The original lambda calculus syntax is not only abstract, it was invented before programmable comput…

Programming with nothing is such an awe-inducing article. There was a conference talk by Jim Weinrich (http://www.confreaks.com/videos/1287-rubyconf2012-y-not-adve...) using the same basic concepts. A nice-to-see for all Ruby/FP enthusiasts out there.

Re: List out of Lambda

#42

"If you ignore the practical issues of computers like size, weight, cost, heat, and so on, what do you really need in a programming language?" One instruction https://en.wikipedia.org/wiki/One_instruction_set_computer

Or just two integer variables, from which you can substract one, add one and compare to zero.

Re: List out of Lambda

#43
post #36
post #19

Earlier quoted context omitted.

Losh doesn't use Church numerals, though, he represents numbers as lists. The fact that lists are also represented as functions is a diversion; his number three doesn't represent a function f -> x -> x that returns the threefold composition of its first argument applied to its second.

There must be some confusion here. For "the threefold composition of its first argument applied to its second" the type should be "(x -> x) -> x -> x".

Right, I was (stupidly, it was early!) just using "f" as a shorthand for a function type like x -> x.

Re: List out of Lambda

#44
post #18

I get that JavaScript is a popular language, but burying a fundamental concept under a cluttered and confusing syntax like JavaScript, when it's much cleaner to explain the math using sensibly notation. Ugh. It's nice that Steve is reaching down to his audience, but it would be nice for the audience to step out of their muddy sandbox once in a while.

The point is not that you can represent it better. The point is that you can actually run it. You can't run the original notation (as such, we know languages that are close, of course).

I agree that the terser notation is better if you're just considering the mathematics in isolation. However, I also think that the true power of this kind of mathematics isn't made evident to people until you actually add some integers and make some lists.... from "nothing"... in a language you already know.

It's the same reason he doesn't use lisp or haskell, which are, obviously, vastly more appropriate. The idea is to illustrate something using something people have readily at hand. Once you have the concrete representation of the idea, you can work backwards to whatever notation you desire and forwards again using that notation, understanding that, yes, it has a basis in reality.

It's the same reason people draw 2d graphs to represent machine learning concepts instead of solely relying upon linear algebra notation. Humans are limited in that way: we have to gain some kind of appropriate intuition, and then we can work with the abstractions after that. No one is going to argue that js is an appropriate way to develop the mathematics -- it's just a way to make it more concrete for people, that's all.

Re: List out of Lambda

#45

Earlier quoted context omitted.

I'm having to reach back into the dustbin of my mind, but I seem to recall implementing an object system using only closures at one point. As I recall, it had all of the "normal" features of objects - inheritance, member variables, methods, etc. It was done with closures and the members were accessed in a message-passing style (in scheme, (myobject 'show) for example). Based on that, I think that closures and objects…

Inheritance can be a bit tricky to fit in, as I recall, but it's quite elegant to implement basic classes and objects with just closures.

A very simple and elegant way to handle inheritance is to give each object a pointer to another object -- let's call it "prototype" -- and delegate any failed member variable or method lookups to the prototype. This is how JavaScript's object system works.

Re: List out of Lambda

#46

"If you ignore the practical issues of computers like size, weight, cost, heat, and so on, what do you really need in a programming language?" One instruction https://en.wikipedia.org/wiki/One_instruction_set_computer

You could have run with a one-point basis: https://en.wikipedia.org/wiki/Combinatory_logic#One-point_ba...

Re: List out of Lambda

#48
post #34
post #18

I get that JavaScript is a popular language, but burying a fundamental concept under a cluttered and confusing syntax like JavaScript, when it's much cleaner to explain the math using sensibly notation. Ugh. It's nice that Steve is reaching down to his audience, but it would be nice for the audience to step out of their muddy sandbox once in a while.

I have a degree in mathematics from the University of Chicago. Want to talk about self-adjoint algebras of compactly supported continuous functions? I'm your man. I also think teaching this using mathematical notation would be a mistake. People only learn things when they relate in part to something they already know. The original lambda calculus syntax is not only abstract, it was invented before programmable comput…

Nice to see a fellow Maroon on here!
Post reply on HN