a Point for Pointfree Programming,

50 views
Skip to first unread message

b21...@gmail.com

unread,
Dec 15, 2012, 5:34:27 AM12/15/12
to newspeak...@googlegroups.com
because if the debugger needs variables, the debugger should insert them automatically.
This leads to more concise programs and is especially helpful, if you program on a handheld, with a small screen.
Cheers, Vincent

Gilad Bracha

unread,
Dec 15, 2012, 3:01:34 PM12/15/12
to newspeak...@googlegroups.com
It would of course have been helpful to establish some context here. But maybe this was a point free message ...

Anyone who finds the original message unclear should look up "Point free programming" on their favorite search engine. 

To the substance: these techniques are sometimes useful, but I feel they are abused as often as not. We could have better support for operations on closures such as composition. However, divorcing code from concrete data is not in fact a good idea in general. Currying , for example, is vastly overrated in my view, and doesn't fit well with keyword messages or dynamic typing. So I am not clear how we'd emphasize this in Newspeak, and I doubt if we should.

Frank Shearar

unread,
Dec 15, 2012, 3:19:19 PM12/15/12
to newspeak...@googlegroups.com
On 15 December 2012 20:01, Gilad Bracha <gbr...@gmail.com> wrote:
> It would of course have been helpful to establish some context here. But
> maybe this was a point free message ...
>
> Anyone who finds the original message unclear should look up "Point free
> programming" on their favorite search engine.
>
> To the substance: these techniques are sometimes useful, but I feel they are
> abused as often as not. We could have better support for operations on
> closures such as composition. However, divorcing code from concrete data is
> not in fact a good idea in general. Currying , for example, is vastly
> overrated in my view, and doesn't fit well with keyword messages or dynamic
> typing. So I am not clear how we'd emphasize this in Newspeak, and I doubt
> if we should.

Partial application looks so neat in Haskell (the origin of pointless
programming (I simply cannot resist saying that!)) because under the
hood all functions are already curried. Also, a function's entire name
appears to the left of its arguments. However, Newspeak and Smalltalk
have "delocalised" selectors/function names, where parts of the
function name are interspersed with the arguments to the function.
Point-free programming with anything other than unary selectors would
look very odd.

But even without considering the syntax side of things, point-free
style in Haskell is not universally accepted/admired because it can be
extremely hard to read. The data flow in a computation is entirely
hidden, so the programmer has to connect the dots mentally in an
attempt to reconstruct such flow.

I've written a fair amount of monadic code in Smalltalk (not, alas, in
Newspeak). It certainly makes heavier use of closures than standard
Smalltalk, so I ended up adding things like #compose: to BlockClosure.
The resulting code's easy enough to read, and doesn't require any
additional language machinery: it's just more library code. Vassili
Bykov's written about these kinds of things before, on his 3 + 4 blog,
starting (IIRC) with
http://blog.3plus4.org/2007/03/23/currying-in-smalltalk/.

One could also add #compose: to Symbol, I suppose: (#max compose:
#asSet) value: #(1 1 2 3).

frank

Gilad Bracha

unread,
Dec 15, 2012, 3:28:24 PM12/15/12
to newspeak...@googlegroups.com
Hi Frank,

I fully agree with most of what you have to say. May I quote you on:

"Haskell is the origin of point free programming"?

That is truly inspired :-)

I'm not sure that's true BTW - APL may be the true origin - which emphasizes the relation with (un)readability. It is all a matter of balance and taste. We should use it where it makes sense. I would not support it on symbols - this is inherently reflective and undermines the stratification that we achieve via mirrors.

Frank Shearar

unread,
Dec 15, 2012, 4:47:35 PM12/15/12
to newspeak...@googlegroups.com
On 15 December 2012 20:28, Gilad Bracha <gbr...@gmail.com> wrote:
> Hi Frank,
>
> I fully agree with most of what you have to say. May I quote you on:
>
> "Haskell is the origin of point free programming"?
>
> That is truly inspired :-)

I wish I could claim it as my own! It's called pointless programming
from the language of topology, apparently due to von Neumann:
http://en.wikipedia.org/wiki/Pointless_topology.

frank

> I'm not sure that's true BTW - APL may be the true origin - which emphasizes
> the relation with (un)readability. It is all a matter of balance and taste.
> We should use it where it makes sense. I would not support it on symbols -
> this is inherently reflective and undermines the stratification that we
> achieve via mirrors.

Would you mind expanding on this? Does "it" here refer to the
"blockification" of symbols?

Gilad Bracha

unread,
Dec 15, 2012, 5:07:42 PM12/15/12
to newspeak...@googlegroups.com
On Sat, Dec 15, 2012 at 1:47 PM, Frank Shearar <frank....@gmail.com> wrote:
On 15 December 2012 20:28, Gilad Bracha <gbr...@gmail.com> wrote:
> Hi Frank,
>
> I fully agree with most of what you have to say. May I quote you on:
>
> "Haskell is the origin of point free programming"?
>
> That is truly inspired :-)

I wish I could claim it as my own! It's called pointless programming
from the language of topology, apparently due to von Neumann:
http://en.wikipedia.org/wiki/Pointless_topology.

frank

> I'm not sure that's true BTW - APL may be the true origin - which emphasizes
> the relation with (un)readability. It is all a matter of balance and taste.
> We should use it where it makes sense.

Sorry for the sloppy writing. In the sentence above "it" means point free programming.
 
I would not support it on symbols -

Here likewise, by substitution we get

it on symbols -> point free programming in symbols

which really means supporting what you call blockification of symbols. So, yes, I am against symbol blockification.



--
Cheers, Gilad
Reply all
Reply to author
Forward
0 new messages