Re: Is anything easier to do in java than in lisp?
From: Kristian Elof Sørensen (elof_at_image.dk)
Date: 05/04/04
- Next message: adam connor: "Re: Is anything easier to do in java than in lisp?"
- Previous message: Kenny Tilton: "Re: Is anything easier to do in java than in lisp?"
- In reply to: RobertMaas_at_YahooGroups.Com: "Is anything easier to do in java than in lisp?"
- Next in thread: Edi Weitz: "Re: Is anything easier to do in java than in lisp?"
- Reply: Edi Weitz: "Re: Is anything easier to do in java than in lisp?"
- Reply: RobertMaas_at_YahooGroups.Com: "Re: Is anything easier to do in java than in lisp?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 04 May 2004 02:11:30 +0200
RobertMaas@YahooGroups.Com wrote:
> After many years of using LISP, I'm taking a class in Java and finding
> the two roughly comparable in some ways and very different in other
> ways. Each has a decent size library of useful utilities as a standard
> portable part of the core language, the LISP package, and the java.lang
> package, respectively. Both have big integers, although only LISP has
> rationals as far as I can tell. Because CL supports keyword arguments,
> it has a wider range of string search utilities etc. where :key and
> :test and :start :end etc. are parametric instead of fixed or
> special-cased here but not there. The only major differences I see are
> speed and interactivity:
>
> Speed comparisons on FreeBSD Unix:
>
> javac or java takes appx. 24 seconds to start up the first time, then
> is virtually instant subsequent times within a short time span.
> However even on immediate re-runs, javac takes between 2 and 7 seconds
> to compile a very small file (23 lines total, only 10 lines of actual
> code).
Thats one of the reasons why java programmers have been using the jikes
compiler instead for the most recent 6-7 years ,-)
The other reason is that it produces much more informative error
messages than javac does.
Five years ago when my work machine was a 400 MHz PII with an EIDE
drive, jikes could compile 1 MB of java source per second including
start up time. It has bloated a bit since then, but it is still rare to
see a compilation taking more than 0,2 seconds for a handfull of smaller
files.
http://www-124.ibm.com/developerworks/oss/jikes/
> CMUCL takes appx. 2 seconds to start up the first time, then is
> virtually instant subsequent times within a short time span.
> Recompiling a 33-line file runs so blindly fast that even with
> *error-output* diverted to bit sink so as to suppress listing of each
> function compiled, its limited only by 19200 bps printout of the return
> value.
> (let ((*error-output* (make-broadcast-stream))) (compile-file
"tabsp.lisp"))
> #p"/home/users/rem/JavaWork/tabsp.x86f"
I have the same experience.
> You need to re-start java every time you want to compile and every time
> you want to run what you compiled, you can't just leave the jvm running
> and load tasks into it. Consequently, if you go away from java for a
> minute to edit the source to recompile it, etc., then you're back to 24
> seconds start-up again when you want to compile what you edited, a
> royal pain! By comparison, you can stay in CMUCL and do almost
> everything there, so you don't have to suffer even the two-second
> first-time-start ever again during a session.
What takes 24 seconds to restart?
J2EE application servers can take from many seconds to several minutes
to restart even on the fastest machines you can buy (which is one good
reason to steer clear of J2EE), but plain old java takes but a fraction
of a second.
> Interactivity: In CL (and virtually any LISP since the original), you
> can sit in a read-eval-print loop composing and trying one line of code
> at a time, storing the results of correct computation in global
> variables to feed into the next step of composing&trying. By
> comparison, in java you have to switch back and forth between editing
> the source of not just what you want to test but a whole test rig
> around it to make a "complete program", compiling that "complete
> program" to bytecode, and running that "complete code" just to see if
> you got one line of new code correct. Comparing the instant feedback
> when typing one new LISP form into the R-E-P, against the 24+ second
> turnaround to try one new line of java code, LISP is a *big* winner!
The read-eval-print way of hacking is the single largest productivity
enhancer I have found in CL as compared to java. It is a real joy to
work this way.
Other benefits I have found in CL as compared to java:
Passing functions around with or without capturing variables with ease.
Doing this in java is so painfull that I only do it if I _have_ to.
Optional arguments and keyword arguments.
macros
CLOS dispatches on the type of the instance where java dispatches on the
type of the reference. Yippiiiiiiiii!!!!!! No more casting all over the
place, no more double-dispatch, no more "ohh when we get the
template-look-alike-crutches everything will be less painfull" - why on
earth does java do it the way it does?
Built in assertations, as compared to the add-on in later versions of java.
The condition system does everything java exceptions does and then 10x
more. Restart a condition etc.
> So I ask, is there any particular kind of task where java has an
> advantage over LISP? The only thing I can think of is networking. I've
> heard that java has networking built into the language, things like
> sockets, TCP/IP, HTTP, etc., whereas they aren't part of CL per se and
> need to be supplied by various vendors on the side. So is this true,
> that java is better than CL for networking stuff? Also, is there any
> other area where java beats CL?
GUI
Anything that needs kernel threads. In CL land only Franz and SBCL has
kernel threads for Linux and only Franz and Lispworks have them for
windozz. The others either have no threads at all, or only have threads
simulated within a process. Without kernel threads you loose an elegant
way of spreading an application over several cpu's among other things.
Anything that needs to be installed at dozen, hundreds or thousands of
end users pc's and upgraded periodically. Lispworks has a nize start
with the deliver system that turns your lisp application into a single
executabel file that can be distributed to end users without the need
for anything else. Administrative tools to make distribution and
installation easy both for single installations and for the admin that
needs to upgrade a few thousand desktop pc's before the users come into
work the next day, are lacking.
web stuff. The CL web stuff consists of production ready products that
are roughly where php, mod_perl, jsp etc. were around 1998, and of
interesting new ideas such as using continuations to capture state
instead of the well known session-, global-, request-scopes that only
exist in
Kristian
- Next message: adam connor: "Re: Is anything easier to do in java than in lisp?"
- Previous message: Kenny Tilton: "Re: Is anything easier to do in java than in lisp?"
- In reply to: RobertMaas_at_YahooGroups.Com: "Is anything easier to do in java than in lisp?"
- Next in thread: Edi Weitz: "Re: Is anything easier to do in java than in lisp?"
- Reply: Edi Weitz: "Re: Is anything easier to do in java than in lisp?"
- Reply: RobertMaas_at_YahooGroups.Com: "Re: Is anything easier to do in java than in lisp?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|