From: Alessio Stalla
Subject: C# vs Lisp
Date: 
Message-ID: <713fbb2e-8950-4ded-bd1b-b1243ee0400b@h11g2000yqb.googlegroups.com>
A couple of days ago I attended a presentation about LINQ in C# (an
integrated DSL for querying both databases and in-memory data with the
same syntax). During the presentation the speaker mentioned that the
C# compiler can construct "expression trees" out of "lambda
expression" and pass those trees to user code, which can - at runtime
- do stuff based on the tree. The tree can also be compiled, yielding
a closure.

So, fellow Lisp hackers, our beloved language is threatened in its
absolute superiority by a Java rip-off from M$!

This is Lisp:

(let* ((be '(expt 2.0 3.0))
       (le `(lambda () ,be)))
  (print (funcall (compile nil le))))

This is C# (taken from MSDN, http://msdn.microsoft.com/en-us/library/bb882536.aspx):

---------------
// The expression tree to execute.
BinaryExpression be = Expression.Power(Expression.Constant(2D),
Expression.Constant(3D));

// Create a lambda expression.
Expression<Func<double>> le = Expression.Lambda<Func<double>>(be);

// Compile the lambda expression.
Func<double> compiledExpression = le.Compile();

// Execute the lambda expression.
double result = compiledExpression();

// Display the result.
Console.WriteLine(result);

// This code produces the following output:
// 8
-------------

We're doomed!!! :D

Ale

From: Rainer Joswig
Subject: Re: C# vs Lisp
Date: 
Message-ID: <be9fc9b7-915d-4cc5-b9e0-ddef435323f0@y19g2000yqy.googlegroups.com>
On 17 Jul., 14:39, Alessio Stalla <·············@gmail.com> wrote:
> A couple of days ago I attended a presentation about LINQ in C# (an
> integrated DSL for querying both databases and in-memory data with the
> same syntax). During the presentation the speaker mentioned that the
> C# compiler can construct "expression trees" out of "lambda
> expression" and pass those trees to user code, which can - at runtime
> - do stuff based on the tree. The tree can also be compiled, yielding
> a closure.
>
> So, fellow Lisp hackers, our beloved language is threatened in its
> absolute superiority by a Java rip-off from M$!
>
> This is Lisp:
>
> (let* ((be '(expt 2.0 3.0))
>        (le `(lambda () ,be)))
>   (print (funcall (compile nil le))))
>
> This is C# (taken from MSDN,http://msdn.microsoft.com/en-us/library/bb882536.aspx):
>
> ---------------
> // The expression tree to execute.
> BinaryExpression be = Expression.Power(Expression.Constant(2D),
> Expression.Constant(3D));
>
> // Create a lambda expression.
> Expression<Func<double>> le = Expression.Lambda<Func<double>>(be);
>
> // Compile the lambda expression.
> Func<double> compiledExpression = le.Compile();
>
> // Execute the lambda expression.
> double result = compiledExpression();
>
> // Display the result.
> Console.WriteLine(result);
>
> // This code produces the following output:
> // 8
> -------------
>
> We're doomed!!! :D
>
> Ale

If C# were a car it would look like this:

  http://i195.photobucket.com/albums/z23/shah-ber-naq/weird-car-wings.jpg

With sufficient thrust it would even fly.
From: fortunatus
Subject: Re: C# vs Lisp
Date: 
Message-ID: <e5da06df-e182-4b4e-be70-206b124b3509@c1g2000yqi.googlegroups.com>
At OOPSLA a couple years ago I heard Anders Hejlsberg himself refer to
LINQ as a monad!
From: Zach Beane
Subject: Re: C# vs Lisp
Date: 
Message-ID: <m3hbxbct6q.fsf@unnamed.xach.com>
fortunatus <··············@excite.com> writes:

> At OOPSLA a couple years ago I heard Anders Hejlsberg himself refer to
> LINQ as a monad!

At OOPSLA in Montreal? The most memorable thing I heard from him there
was "You can't write any bloody tools for dynamic languages!"

Zach
From: A.L.
Subject: Re: C# vs Lisp
Date: 
Message-ID: <pi0165ppi4m1q6ivui08dfdva53e2dd4o2@4ax.com>
On Fri, 17 Jul 2009 05:39:21 -0700 (PDT), Alessio Stalla
<·············@gmail.com> wrote:
 
>// This code produces the following output:
>// 8
>-------------
>
>We're doomed!!! :D
>

He, he... Taking into account the amount of commercial code that is
being written in Lisp, your future is bright!

A.L.
From: Alessio Stalla
Subject: Re: C# vs Lisp
Date: 
Message-ID: <e71bd303-77f3-4b54-b275-1663af116b9b@g31g2000yqc.googlegroups.com>
On Jul 17, 3:54 pm, A.L. <········@aol.com> wrote:
> On Fri, 17 Jul 2009 05:39:21 -0700 (PDT), Alessio Stalla
>
> <·············@gmail.com> wrote:
> >// This code produces the following output:
> >// 8
> >-------------
>
> >We're doomed!!! :D
>
> He, he... Taking into account the amount of commercial code that is
> being written in Lisp, your future is bright!

Given the trend I see in mainstream languages, indeed in the not so
far future most "commercial code" will be written in Lisp - though an
infix, statically typed, horribly verbose Lisp instead of CL...

A.

> A.L.
From: A.L.
Subject: Re: C# vs Lisp
Date: 
Message-ID: <p44165pa4c6iksoirjjbcp9rivon9va68i@4ax.com>
On Fri, 17 Jul 2009 07:32:56 -0700 (PDT), Alessio Stalla
<·············@gmail.com> wrote:

>On Jul 17, 3:54�pm, A.L. <········@aol.com> wrote:
>> On Fri, 17 Jul 2009 05:39:21 -0700 (PDT), Alessio Stalla
>>
>> <·············@gmail.com> wrote:
>> >// This code produces the following output:
>> >// 8
>> >-------------
>>
>> >We're doomed!!! :D
>>
>> He, he... Taking into account the amount of commercial code that is
>> being written in Lisp, your future is bright!
>
>Given the trend I see in mainstream languages, indeed in the not so
>far future most "commercial code" will be written in Lisp -

In your imagination only

A.L.
From: ok
Subject: Re: C# vs Lisp
Date: 
Message-ID: <8dbf110c-ccc9-4417-900a-b3a76cb217aa@s31g2000yqs.googlegroups.com>
On 17 Lug, 14:39, Alessio Stalla <·············@gmail.com> wrote:
> LINQ, C#: We're doomed!!! :D

No, please not please.
That's unfair.
Like David versus Goliath.

There's simply no chance for that super rich, super huge, gigantic,
muscled, monolithic walking mountain...

Repeat after me:
Long Live Goliath!!
(He'll need it.)
From: A.L.
Subject: Re: C# vs Lisp
Date: 
Message-ID: <toc165p4cpaf4ni9rmp946phtqjin7lkso@4ax.com>
On 17 Jul 2009 16:56:13 GMT, ···@zedat.fu-berlin.de (Stefan Ram)
wrote:

>Alessio Stalla <·············@gmail.com> writes:
>>We're doomed!!! :D
>
>  Possibly one can put it this way:
>
>  The success of a computer language depends on
>
>    - how much Lisp it contains and on
>    - how well it is able to hide this.

Idiot?...

A.L.
From: Patrick May
Subject: Re: C# vs Lisp
Date: 
Message-ID: <m21vodh7a3.fsf@softwarematters.org>
···@zedat.fu-berlin.de (Stefan Ram) writes:
> Alessio Stalla <·············@gmail.com> writes:
>>We're doomed!!! :D
>
>   Possibly one can put it this way:
>
>   The success of a computer language depends on
>
>     - how much Lisp it contains and on
>     - how well it is able to hide this.

     I just sent that to all my Java-head colleagues (with attribution,
of course).  If you get any verbose hate mail, it's probably from them.

Regards,

Patrick

------------------------------------------------------------------------
http://www.softwarematters.org
Large scale, mission-critical, distributed OO systems design and
implementation.  (C++, Java, Common Lisp, Jini, middleware, SOA)
From: Frank Buss
Subject: Re: C# vs Lisp
Date: 
Message-ID: <g5oyvbgh1q9w.1bppxnqvaayxk$.dlg@40tude.net>
Stefan Ram wrote:

>   Possibly one can put it this way:
> 
>   The success of a computer language depends on
> 
>     - how much Lisp it contains and on
>     - how well it is able to hide this.
> 
>   However, now that you have publicly put C# near
>   Lisp, C# might be in decline from now on.

You can do this with C++, too (but without the compile expression). See
e.g. Boost and STL for closures and binary expressions as first-class
values. But the syntax is even more complicated than the C# example. This
doesn't influence the popularity of C++.

Nowadays the success of a computer language depends on how easy it is to
use it and how many sample programs and libraries are available (there will
be more libraries, if it is easy to use :-) There are some exceptions, like
C, which is not so easy to use, but still popular, because there is so much
C code already available and there are C compilers for nearly all computer
hardware.

Some things for a successful language:

imperative programming style
It seems to me that this programming style is more natural for humans.
That's the way the world works: There is one step, the next step depends on
the previous step and so on. More abstract concepts, like functional
programming, is more complicated, at least if you are not a mathematician.
If other programming styles are possible at the same time, it can help the
popularity, too. The natural way to use Lisp is not to write long functions
with lots of setfs. If you do this, Lisp are more cumbersome than other
languages.

safe language and unique implemenation
In Lisp there are some things undefined, e.g. take a look at the CLHS:
there are more than 200 paragrphs which contain the word "undefined", most
of the time meaning "undefined behavior". The behavior for some
syntactically correct code depends on the implementation or on the phase of
the moon. More popular languages, like Java or Python, have one popular
implemenation and nearly no undefined behavior, which means if you manage
to get your code compiled and it works once for some given input, it works
all the time.

large community and many sample code and libraries
This is mostly a consequence of the previous points, but some advertising
and sponsoring of big companies helps, too, e.g. as you can see for the
.NET languages and Java. And if there are many programmers for a language,
companies use it, because the risk that another programmer can't maintain a
program is low, if the original programmer left the company. Simple
languages helps for this aspect, too.

-- 
Frank Buss, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: Pascal J. Bourguignon
Subject: Re: C# vs Lisp
Date: 
Message-ID: <87my71c9ii.fsf@galatea.local>
Frank Buss <··@frank-buss.de> writes:
> imperative programming style
> It seems to me that this programming style is more natural for humans.
> That's the way the world works: There is one step, the next step depends on
> the previous step and so on. 

Only for the stressed psychotics.  Read http://the-programmers-stone.com/about/


> More abstract concepts, like functional
> programming, is more complicated, at least if you are not a mathematician.
> If other programming styles are possible at the same time, it can help the
> popularity, too. The natural way to use Lisp is not to write long functions
> with lots of setfs. If you do this, Lisp are more cumbersome than other
> languages.

Not for sane humans.  See above URI and 
http://the-programmers-stone.com/about/neuroscience-questions
Lisp is verb-oriented, and caters well to sane people.

-- 
__Pascal Bourguignon__
From: Frank Buss
Subject: Re: C# vs Lisp
Date: 
Message-ID: <vlnc99mk4k5o$.iz3l5hiev9vi.dlg@40tude.net>
Pascal J. Bourguignon wrote:

> Frank Buss <··@frank-buss.de> writes:
>> imperative programming style
>> It seems to me that this programming style is more natural for humans.
>> That's the way the world works: There is one step, the next step depends on
>> the previous step and so on. 
> 
> Only for the stressed psychotics.  Read http://the-programmers-stone.com/about/

Thanks, this is an interesting article, albeit a bit longish. But it
doesn't say anything about imperative programming. In fact on the second
page:

http://the-programmers-stone.com/about/neuroscience/

the author writes about the first mode of the prefrontal cortex, with a low
level of background excitation and localized areas of high excitation:

| An interesting aspect of focussed attention is that when we are using it, 
| we can always say what the next step is, before we perform it.

This sounds very much like imperative programming :-)

The important things are written later: Try to imagine the whole program in
your head and the consequences when changing something or implementing
something new in a holistic way, trying out different thing in your head
and thinking about the consequences. You can't do this, if your stress
level is too high. I think it doesn't really matter if you use structured
imperative programming, object oriented programming or other styles. But
maybe you are right and imperative programming can be used even if you are
stressed, but being not very much productive in this case.

> Not for sane humans.  See above URI and 
> http://the-programmers-stone.com/about/neuroscience-questions
> Lisp is verb-oriented, and caters well to sane people.

This doesn't mean that successful languages are verb-oriented. If the Hopi
language and Native Americans were successful, they would be not a minority
group living in reservations today.

-- 
Frank Buss, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: Pascal J. Bourguignon
Subject: Re: C# vs Lisp
Date: 
Message-ID: <873a8sdbt5.fsf@galatea.local>
Frank Buss <··@frank-buss.de> writes:

> Pascal J. Bourguignon wrote:
>
>> Frank Buss <··@frank-buss.de> writes:
>>> imperative programming style
>>> It seems to me that this programming style is more natural for humans.
>>> That's the way the world works: There is one step, the next step depends on
>>> the previous step and so on. 
>> 
>> Only for the stressed psychotics.  Read http://the-programmers-stone.com/about/
>
> Thanks, this is an interesting article, albeit a bit longish. But it
> doesn't say anything about imperative programming. In fact on the second
> page:
>
> http://the-programmers-stone.com/about/neuroscience/
>
> the author writes about the first mode of the prefrontal cortex, with a low
> level of background excitation and localized areas of high excitation:
>
> | An interesting aspect of focussed attention is that when we are using it, 
> | we can always say what the next step is, before we perform it.
>
> This sounds very much like imperative programming :-)

Yes.  Packers are more apt to imperative programming.


> The important things are written later: Try to imagine the whole program in
> your head and the consequences when changing something or implementing
> something new in a holistic way, trying out different thing in your head
> and thinking about the consequences. You can't do this, if your stress
> level is too high. I think it doesn't really matter if you use structured
> imperative programming, object oriented programming or other styles. But
> maybe you are right and imperative programming can be used even if you are
> stressed, but being not very much productive in this case.

This kind of reasoning ("meditating" I would say) is done more easily
with other paradigms, such as declarative programming.


>> Not for sane humans.  See above URI and 
>> http://the-programmers-stone.com/about/neuroscience-questions
>> Lisp is verb-oriented, and caters well to sane people.
>
> This doesn't mean that successful languages are verb-oriented. If the Hopi
> language and Native Americans were successful, they would be not a minority
> group living in reservations today.

You must specify the criteria of success! :-) And again, this is very
on topic.  What's the success of Lisp?  Not to be mainstream...  Are
we not a minority group living in reservations today?  Even worse,
there's not really concentrations of lispers, we have to move
worldwide to concentrate (next meeting in Hamburg
http://weitz.de/eclm2009/).

-- 
__Pascal Bourguignon__