Earth to Sun: When will Java support closures now?  
Author Message
Tor Iver Wilhelmsen





PostPosted: 2004-9-29 20:57:00 Top

java-programmer, Earth to Sun: When will Java support closures now? Vitaly Lugovsky <email***@***.com> writes:

> No. It was added to make source files more readable.

How can something be more readable when anything in effect can be
replaced by a macro? You are perhaps focusing on #include and the
like; but the following is bad:

/* In some header file included somewhere while resolving
a source file */
#define foo fie

/* In the source file - will end up as fie()*/
int foo() {
}

To quote Wikipedia: "The use of preprocessors has been getting less
common as recent languages provide more abstract features rather than
lexical-oriented ones. Indeed, the overuse of the proprecessor might
yield quite chaotic code. In designing a new language based on C,
Stroustrup introduced features such as inline and templates into C++
in an attempt to make the C preprocessor less relevant."

> > Yes, again because they avoid strong typing.
>
> How?

Because the template has no idea whether the type parameter actually
supports the operations used inside it, e.g. a method call. In Java,
you cannot use an operation on a parametrized type unless you declare
that yes, this type shall conform to this interface/class.

> C and C++ are not strictly typed.

Not C, but every resource I've seen on C++ claims it is (by default),
though how strong anything is when it can be cast away as will is a
different question. Maybe you define "strong/strict typing"
differently from the makers of C++ and Java?

> No. The reason is that there are too many monkeys around. Not so
> much humans. Ask yourself - why so much people listens "rap" and
> other popular crap, much more then good jazz or classics? Would you
> list this fact as an argument that rap is better? Popularity is a
> shit. Almost everything that is popular must be a shit.

I am getting the impression "Lisp" is a mis-spelling for "Elitist".
 
Tor Iver Wilhelmsen





PostPosted: 2004-9-29 20:57:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? Vitaly Lugovsky <email***@***.com> writes:

> No. It was added to make source files more readable.

How can something be more readable when anything in effect can be
replaced by a macro? You are perhaps focusing on #include and the
like; but the following is bad:

/* In some header file included somewhere while resolving
a source file */
#define foo fie

/* In the source file - will end up as fie()*/
int foo() {
}

To quote Wikipedia: "The use of preprocessors has been getting less
common as recent languages provide more abstract features rather than
lexical-oriented ones. Indeed, the overuse of the proprecessor might
yield quite chaotic code. In designing a new language based on C,
Stroustrup introduced features such as inline and templates into C++
in an attempt to make the C preprocessor less relevant."

> > Yes, again because they avoid strong typing.
>
> How?

Because the template has no idea whether the type parameter actually
supports the operations used inside it, e.g. a method call. In Java,
you cannot use an operation on a parametrized type unless you declare
that yes, this type shall conform to this interface/class.

> C and C++ are not strictly typed.

Not C, but every resource I've seen on C++ claims it is (by default),
though how strong anything is when it can be cast away as will is a
different question. Maybe you define "strong/strict typing"
differently from the makers of C++ and Java?

> No. The reason is that there are too many monkeys around. Not so
> much humans. Ask yourself - why so much people listens "rap" and
> other popular crap, much more then good jazz or classics? Would you
> list this fact as an argument that rap is better? Popularity is a
> shit. Almost everything that is popular must be a shit.

I am getting the impression "Lisp" is a mis-spelling for "Elitist".
 
sarge_chris





PostPosted: 2004-9-29 21:14:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? Vitaly Lugovsky <email***@***.com> wrote in message news:<cjdkr9$499$email***@***.com>...
> > Java needs to be kept simple to allow small teams of
> > developers to be very productive. Einstein once said, "Things should be
> > as simple as possible, but not simpler".
>
> Please, don't call them "developers". Monkeys. And I will prefer one
> real developer with Lisp to a group of trained Java monkeys with their
> simple toy language.
>
> But, I love simplicity and orthogonality too. It just should be based on
> a different computational model. Simple functional language (like Scheme)
> is much better then any simple imperative OO shit.

Oooo temper temper!

If you want to use an academic language for development that's your
problem.

I'd prefer to use my favourite toy-language to earn lots of money
working on leading-edge, enterprise-scale applications - if that makes
me a monkey, then I'm a happy one.

Lisp! He he, just below COBOL: http://www.tiobe.com/tpci.htm

- sarge
 
 
Carlos Bazzarella





PostPosted: 2004-9-29 22:24:00 Top

java-programmer >> Earth to Sun: When will Java support closures now?

Vitaly Lugovsky wrote:

> Tor Iver Wilhelmsen <email***@***.com> wrote:
>
> >> Preprocessor was not a crap.
> >
> > Yes it was, because it dodges the type system, and makes the code you
> > write not be the code you run. The preprocessor was added to C to make
> > source files smaller
>
> No. It was added to make source files more readable.
>
> >> Templates was not a crap.
> >
> > Yes, again because they avoid strong typing.
>
> How?
>
> > So if you consider C and C++ as not strongly typed, the two features
> > you mentioned are not crap. If you want type safety/strong typing,
> > they are.
>
> C and C++ are not strictly typed. And Java is not strongly typed language
> as well. Haskell is strongly typed. And, I know that you don't know it,
> but - IT HAVE macros. Template Haskell remains strictly typed.
>
> >> Please, don't call them "developers". Monkeys. And I will prefer one
> >> real developer with Lisp to a group of trained Java monkeys with their
> >> simple toy language.
> >
> > Well, .advocacy is perhaps a suitable playground for "my language can
> > beat your language" stuff, but I wish that you Lisp-heads would grow
> > up some day. With a language mostly relegated to dusty academic
> > shelves it's perhaps hard to take that step into the real world.
>
> I know that java monkeys loves to believe in this bullshit. Lisp is not
> an academic language (and it is a sort of outcast in academic world -
> computer scientists loves stong type systems even more then you, so,
> Haskell and ML are academic while Lisp is an industry language).
>
> >> But, I love simplicity and orthogonality too. It just should be based on
> >> a different computational model. Simple functional language (like Scheme)
> >> is much better then any simple imperative OO shit.
> >
> > Which I guess is the reason more systems are built using Java than
> > Scheme.
>
> No. The reason is that there are too many monkeys around. Not so much
> humans. Ask yourself - why so much people listens "rap" and other popular
> crap, much more then good jazz or classics?

This is a matter of taste, nothing to do with popular crap. What was
popular year ago is classic today !!! Think about that for a second.

Rock & Roll in the '60s was the equivalent of Rap today and I see
a lot of older people that still loves R&R.

The thing is, I like all kinds of music from classics, jazz to rap too. Each
one has its reason for being so-called popular one time or another.

Just because you don't like rap, it doesn't make it *shit* as you call it.

> Would you list this fact as
> an argument that rap is better?

You can't compare apples to oranges. Some people like rap, others
don't.

> Popularity is a shit. Almost everything
> that is popular must be a shit.

I guess you also don't like democracy because it is a
popularity contest !!!


Carlos.



>
>
> --
>
> V.S.Lugovsky aka Mauhuur (http://ontil.ihep.su/~vsl)


 
 
Tim Smith





PostPosted: 2004-9-30 5:04:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? In article <email***@***.com>, Tor Iver Wilhelmsen wrote:
>> Preprocessor was not a crap.
>
> Yes it was, because it dodges the type system, and makes the code you
> write not be the code you run. The preprocessor was added to C to make
> source files smaller

Uhm...any language above assembler makes the code you write not be the code
you run, doesn't it?

--
--Tim Smith
 
 
Bruce Lewis





PostPosted: 2004-10-1 10:51:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? Vitaly Lugovsky <email***@***.com> writes:

> I am using your BRL for a big project. And for me speed is a concern -
> the real showstopper is the strings representation. Profiler shows that
> the damned majority of processor time is in the string-append.

This surprises me. The brl macro expands to a lot of (display ...)
expressions rather than (string-append ...). The displays do go to a
string port, since you need a content-length to maintain persistent
connections and let TCP be as fast as it should be. I assumed Kawa's
string ports did not work by string-append, but never checked.

A reimplementation of BRL in a non-Java environment would be
interesting. If you do it with Bigloo, will you publish it?

--
ourdoings.com
It's where your pile of digital photos wishes it could be.
http://ourdoings.com/about.html
 
 
Lothar Kimmeringer





PostPosted: 2004-10-2 1:04:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? On Tue, 28 Sep 2004 01:10:49 +0000 (UTC), Vitaly Lugovsky wrote:

> Java is designed to be understandable by brain-damaged people.
> Closures are too complicated for an average Java coder. The main reason
> why Java is so popular is that it is the simplest language possible.

Very well, so a Java-programmer can focus more on solving the
given problem. My-language-is-better-discusstions suck.


Regards, Lothar
--
Lothar Kimmeringer E-Mail: email***@***.com
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
 
 
mauhuur





PostPosted: 2004-10-2 8:03:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? Carlos Bazzarella <email***@***.com> wrote in message news:<email***@***.com>...

> > No. The reason is that there are too many monkeys around. Not so much
> > humans. Ask yourself - why so much people listens "rap" and other popular
> > crap, much more then good jazz or classics?
>
> This is a matter of taste, nothing to do with popular crap. What was
> popular year ago is classic today !!! Think about that for a second.

Not taste. Quality.

> Rock & Roll in the '60s was the equivalent of Rap today and I see
> a lot of older people that still loves R&R.

Just try to count, what amount of '60s rock'n'roll crap became classics
nowdays. Sure, in any style can be something really talented and marvelous.
Even in rap, probably - history will show, now in tons of crap it's invisible.

> The thing is, I like all kinds of music from classics, jazz to rap too. Each
> one has its reason for being so-called popular one time or another.

Yes. And popularity NEVER means QUALITY. Never.

> Just because you don't like rap, it doesn't make it *shit* as you call it.

Popularity makes it shit.

> > Popularity is a shit. Almost everything
> > that is popular must be a shit.
>
> I guess you also don't like democracy because it is a
> popularity contest !!!

Sure I don't like democracy. How someone without any knowledge in politics,
economics and strategy can judge who is eligible to make decisions in this
areas?!? I am for meritocracy. Want to vote - prove your proficiency. Want
to rule - you have to be really THE BEST. Not be considered by stupid crowds
as "the best", but be really the best.
 
 
mauhuur





PostPosted: 2004-10-2 9:03:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? Tor Iver Wilhelmsen <email***@***.com> wrote in message news:<email***@***.com>...

> > No. It was added to make source files more readable.
>
> How can something be more readable when anything in effect can be
> replaced by a macro? You are perhaps focusing on #include and the
> like; but the following is bad:

You can write a Fortran program in any language. That's true.
But who asks you to write a crap? Use macros to improve readability,
not to mess it up.

What is more readable?

DEBUG( some code )

or

if (My.Configuration.Debug_level > 1) {
some code
}

> To quote Wikipedia: "The use of preprocessors has been getting less
> common as recent languages provide more abstract features rather than
> lexical-oriented ones. Indeed, the overuse of the proprecessor might
> yield quite chaotic code. In designing a new language based on C,
> Stroustrup introduced features such as inline and templates into C++
> in an attempt to make the C preprocessor less relevant."

Right. C preprocessor is a crap. Templates are better. But Java do not even
have a crap like C preprocessor.

Well. We still can use Jatha or AspectJ... They are preprocessors.
You think that sort of preprocessors are not necessary?

> > How?
>
> Because the template has no idea whether the type parameter actually
> supports the operations used inside it, e.g. a method call. In Java,
> you cannot use an operation on a parametrized type unless you declare
> that yes, this type shall conform to this interface/class.

This is a leak in implementation. Not the problem of ideology.

Try Template Haskell for example.

> > C and C++ are not strictly typed.
>
> Not C, but every resource I've seen on C++ claims it is (by default),
> though how strong anything is when it can be cast away as will is a
> different question. Maybe you define "strong/strict typing"
> differently from the makers of C++ and Java?

They can claim whatever they want. Since it allows dynamic typing,
it is not strict. Hashtable filled with java.lang.Object-s can't even
be considered as a strictly typed data structure.

> > No. The reason is that there are too many monkeys around. Not so
> > much humans. Ask yourself - why so much people listens "rap" and
> > other popular crap, much more then good jazz or classics? Would you
> > list this fact as an argument that rap is better? Popularity is a
> > shit. Almost everything that is popular must be a shit.
>
> I am getting the impression "Lisp" is a mis-spelling for "Elitist".

No. Lisp is for industry. For mass industry. But marketoid monkeys prefered
to yell about shit like Java, then all "programming" monkeys uses it, not
because of Java technological supremacy.
 
 
mauhuur





PostPosted: 2004-10-2 9:07:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? email***@***.com (Chris) wrote in message news:<email***@***.com>...

> > But, I love simplicity and orthogonality too. It just should be based on
> > a different computational model. Simple functional language (like Scheme)
> > is much better then any simple imperative OO shit.
>
> Oooo temper temper!
>
> If you want to use an academic language for development that's your
> problem.

Again. Lisp is not an academic language. Stop repeating stupid myths.
Lisp is even an outcast in academic world - they loves strictly typed languages
like ML and Haskell, not dynamic typed multy-paradigm Lisp.

> I'd prefer to use my favourite toy-language to earn lots of money
> working on leading-edge, enterprise-scale applications - if that makes
> me a monkey, then I'm a happy one.

Industry have to realize, that one Lisp programmer will perform much better
(with lesser cost) then a dozen of Java coders.

> Lisp! He he, just below COBOL: http://www.tiobe.com/tpci.htm

And what? Zillions of lemmings can't be wrong? That is your best argument?
 
 
mauhuur





PostPosted: 2004-10-2 9:11:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? Bruce Lewis <email***@***.com> wrote in message news:<email***@***.com>...

> > I am using your BRL for a big project. And for me speed is a concern -
> > the real showstopper is the strings representation. Profiler shows that
> > the damned majority of processor time is in the string-append.
>
> This surprises me. The brl macro expands to a lot of (display ...)
> expressions rather than (string-append ...).

It is not all about brl macro. It is for pregexp-replace and all other string
stuff. What I want is to get rid of strings completely - and to rewrite
the (brl ...) that it will show a list of short strings and chars as one string,
not as list (hm... there is no reason other then debugging to show the text
representation of s-expressions).

> The displays do go to a
> string port, since you need a content-length to maintain persistent
> connections and let TCP be as fast as it should be. I assumed Kawa's
> string ports did not work by string-append, but never checked.
>
> A reimplementation of BRL in a non-Java environment would be
> interesting. If you do it with Bigloo, will you publish it?

Yes, I will. And you can check this approach in CVS of the project
http://dslengine.sourceforge.net/ - in file CBrl.scm.
 
 
mauhuur





PostPosted: 2004-10-2 11:46:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? Lothar Kimmeringer <email***@***.com> wrote in message news:<email***@***.com>...


> Very well, so a Java-programmer can focus more on solving the
> given problem. My-language-is-better-discusstions suck.

No. Java programmer first have to find how to fit the given problem
into narrow constraints of Java possibilities and into an alien OO ideology.

Lisp programmer first will formulate an algebra for the given problem, then
he will convert this algebra to a programming language (which best fits the
problem domain), and then the solution will be trivial. This is much faster
and cheaper then the Java approach.
 
 
Tor Iver Wilhelmsen





PostPosted: 2004-10-2 15:38:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? email***@***.com (Vitaly Lugovsky) writes:

> Right. C preprocessor is a crap. Templates are better. But Java do not even
> have a crap like C preprocessor.

The uses for which the C preprocessor was intended are not present in
Java. There is no need for #if __WIN32__ etc. to enable multi-platform
code. There is no need for it so it is not added. This is something
called "not adding every kitchen-sink feature just because someone
likes it in a different context".

> Well. We still can use Jatha or AspectJ... They are preprocessors.
> You think that sort of preprocessors are not necessary?

Why do you compare these to the C preprocessor? Do you think it's not
possible to like AspectJ if you don't like macros and conditional
compilation? Do you not see that these are completely different
technologies?

> No. Lisp is for industry. For mass industry. But marketoid monkeys prefered
> to yell about shit like Java, then all "programming" monkeys uses it, not
> because of Java technological supremacy.

Yes, the makers of Java succeeded in marketing their technology to
developers. Makers of Lisp, Smalltalk and all the other niche
languages chose not to, and now they (including you) try to compensate
by childishly attacking the winner, in a "sure he won an Olympic
medal, but my dick is bigger" way. You don't win over developers that
way, but I guess you have given up on that, and focus on how exclusive
you are for using that "secret" language.
 
 
Michael N. Christoff





PostPosted: 2004-10-3 4:29:00 Top

java-programmer >> Earth to Sun: When will Java support closures now?
"Vitaly Lugovsky" <email***@***.com> wrote in message
news:email***@***.com...
> >
> > I am getting the impression "Lisp" is a mis-spelling for "Elitist".
>
> No. Lisp is for industry. For mass industry. But marketoid monkeys
prefered
> to yell about shit like Java, then all "programming" monkeys uses it, not
> because of Java technological supremacy.

Exactly what 'mass industries' are you referring to? Are you talking about
'mass industries' that could _theoretically_ use Lisp, or _actual_ 'mass
industries' that do use Lisp?



l8r, Mike N. Christoff



 
 
J鰎n W. Janneck





PostPosted: 2004-10-5 4:43:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? Vitaly Lugovsky wrote:
> Carlos Bazzarella <email***@***.com> wrote in message
[snip]
>> I guess you also don't like democracy because it is a
>> popularity contest !!!
>
> Sure I don't like democracy. How someone without any knowledge in
politics,
> economics and strategy can judge who is eligible to make decisions in this
> areas?!? I am for meritocracy. Want to vote - prove your proficiency. Want
> to rule - you have to be really THE BEST. Not be considered by stupid
crowds
> as "the best", but be really the best.

that position seems to be based on the rather naive assumption that politics
and "ruling" are about finding the "right" or "best" solution to some
problem, rather than being a contest opposing interests of individuals and
their organizations.

apart from being rather ahistorical, it would also seem that it's pretty
much paradoxical---if merit rather than justified interest is what qualifies
for participation, how would the less proficient be persuaded to be ruled by
those more proficient individuals? what would keep them from just kicking
the a**es of the proficient rulers and install any other kind of political
system that gives them a say in what goes on as well? iow, how could your
"meritocracy" be at all a stable political system? (assuming for the sake of
argument it was well-defined in the first place, i.e. there is an objective
measure of what "proficiency" is and how to identify who is "best" at
ruling---which of course there isn't, and hence neither is it.)

-- j


 
 
brintoul





PostPosted: 2004-10-6 1:29:00 Top

java-programmer >> Earth to Sun: When will Java support closures now? email***@***.com (Vitaly Lugovsky) wrote in message news:<email***@***.com>...
> Bruce Lewis <email***@***.com> wrote in message news:<email***@***.com>...
>
>
> Yes, I will. And you can check this approach in CVS of the project
> http://dslengine.sourceforge.net/ - in file CBrl.scm.

Is the Groovy idea of a closure worthwhile?

http://groovy.codehaus.org/Closures