Re: [dev] Conversation with Anselm R. Garbe of suckless.org

From: Szabolcs Nagy <nszabolcs_AT_gmail.com>
Date: Wed, 16 Sep 2009 13:58:39 +0200

On 9/16/09, Frederic DUBOIS <fdubois76_AT_gmail.com> wrote:
> 2009/9/16 Uriel <lost.goblin_AT_gmail.com>:
>> On Wed, Sep 16, 2009 at 12:03 AM, frederic <fdubois76_AT_gmail.com> wrote:
>>> I'm pretty sure that if C featured closures, Anselm would cleverly use
>>> them
>>> and
>>> make an even more simple, customizable and elegant dwm.
>>
>> I'm pretty sure that if C featured closures, Anselm and many others
>> would promptly and cleverly hang themselves with them.
>>
>
> This is slightly ambiguous. Do you mean:
> - that they would hang themselves in despair? In that case, why do you think
> so?
> - that they would hang themselves by accident? In that case, you
> consider that a dangerous features be offered. But then, I would argue
> that pointers are as dangerous as closures.
>

i'd argue that closures don't mix well with the c style of programming

eg if you add closures then you'd need anonymous functions then you'd
start writing in the functional style passing around functions then
you'd need memory management to clean up the return values and
arguments (so you can write print(sum(map(atoi,
split(read(filename)))))) and of course exception handling as return
values have different purpose, not to mention multiple return values
and sometime polymorphism is required as well with a bit more powerful
type system with possible runtime dispatch oh and don't forget about
module systems...

it seems to me that c is a fairly closed design with a simple mental
model, pointers are dangerous but fit into this model closures would
make it a bit more convoluted with little additional gain

if you need closures then a new language design is needed and you'd
probably end up with a lisp or ml like language which is not good for
managing flat memory spaces but useful in other areas..
Received on Wed Sep 16 2009 - 11:58:39 UTC

This archive was generated by hypermail 2.2.0 : Wed Sep 16 2009 - 12:00:03 UTC