how does lisp compare to apl?
I read an mazing apl faq and it sounded like many descriptions of lisp
it said the brevity is power because u can make shorted programs and
control complexity
how does it stack up to lisp?
I want to learn programmign but can't focus due to my desire to pick
most powerful tool but also something practical not theoretical.
help!
gavino wrote:
> how does lisp compare to apl?
You may find some answers in this thread:
http://groups.google.de/group/comp.lang.lisp/browse_frm/thread/574bcf953913f3f5/92c1d9806ac3a7a7
APL like language are very powerful. You should try both. J is a free APL
like language:
http://www.jsoftware.com/
For Common Lisp I suggest to start with the trial edition of LispWorks or
Allegro Common Lisp or http://www.gigamonkeys.com/lispbox/ , if you like
Emacs.
--
Frank Buss, ··@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
I've used both APL and Lisp quite extensively [*] and love(d) them
both. Others have pointed you to comparisons, but there is one very
good reason no to bother with APL (or J, it's recent reincarnation):
It's deader than a doornail. No one uses it (them) anymore. It (they)
has (have) been superseded by other languages -- esp. MatLab. If you
want to learn a useful (although very painful) mathematical programming
language, learn MatLab, not APL/J.
'Jeff
[*] Indeed, both inside and out: I was head of the project that wrote
Univac's APL implementation! Univac is even more dead now than APL.
········@gmail.com wrote:
> I've used both APL and Lisp quite extensively [*] and love(d) them
> both. Others have pointed you to comparisons, but there is one very
> good reason no to bother with APL (or J, it's recent reincarnation):
> It's deader than a doornail. No one uses it (them) anymore.
Come on now, shake your head. It's a large world out there.
APL is alive and better than ever. The premier commercial development
interpreter is Dyalog APL, www.dyalog.com. It is constantly improving
and enhancing the interpreter.
Dyalog APL has a full fledged IDE, native GUI, multithreading, complete
support for OOP and .NET, and too many more enhancements (tail
recursion, closure, etc) to Ken Iverson's original invention to mention
here.
Many small to medium size (and highly profitable) companies are built
on it.
It is used by every major investment and commercial bank in the world,
either directly or indirectly, .... and not in legacy apps.
ps. The only obvious anomalous result in the above is "J Code" - J is,
of course, particularly problematic being highly confusable. And
indeed, there appear to be a bunch of other concepts called "j code(s)"
that have nothing to do with the J programming language.
········@gmail.com wrote:
> Don't take my word for it;
Why would I take your word for anything, when you don't write what you
mean ;)
You said APL is dead, no one uses it. You meant APL is unpopular.That
this would be a relevant criteria for whether or not to learn a
particular language is rather surprising coming from this group. (I'd
be willing to bet that in a hundred years, there will be people
programming in Lisp and APL and not Java.)
Clearly APL is not dead, there are people using it, the development of
it has not stagnated, and there are up-to-date professional
interpreters available.
What do you want me to take your word for, that APL is unpopular? What
a brilliant observation. Hold on, I'll alert the media!
Joe Marshall wrote:
> ········@gmail.com wrote:
<snip>
> > > NIL
>
> I grabbed this from
> http://www.digitalmars.com/d/archives/digitalmars/D/32010.html
> They searched for `written in <language>'
>
> PHP 2,190,000
Wow, that's impressive.
Especially considering the searchs I did below:-
Results 1 - 10 of about 3,860,000 for "written in english". (0.15
seconds)
Results 1 - 10 of about 321,000 for "written in spanish". (0.11
seconds)
Dare I mention that this particular google feature is rather unreliable.
> Dare I mention that this particular google feature is rather unreliable.
That's the least of the issues, which is why (a) I did multiple
phrases, and (b) I said that my analysis was (to put it as positively
as possible) heuristic and statistical -- meaning: Probably mostly
wrong! :-)
[Although it's interesting and scary too see how much code it takes to
approximate a whole google tool (google trends -- although I'd have to
wrap another loop around it to go across time). Google's sort of like
fifty ten-line lisp programs (or one line APL programs! :-), mapped
over a giant centralized database, each with a fancy name and icon, a
bad ajax interface, and piled hugh with advertising. Amazing what you
can make a zillion dollars for these days.]
BTW, not beyond self-criticism, one of the things that is great about
APL is select/compress, which would have helped here in my above code:
...
;; Ugh: 123,456,789! Is there a better way to
;; remove these????
(coerce (loop for c across numstring
unless (char-equal #\, c) collect
c) 'string)
...
In APLisp this is (I don't know how to do the J chars, so I'll just
write it out in made-up Lisp list comprehensions):
(compress (maparray #'(lambda (char) (char-equal #',
char))
mystring) mystring)
Or (more APL-like, though still wrong, since I don't know J):
(#\a == mystring)/mystring
Of course, I could always just trivially defun compress in about 1.5
lines of lisp....
... but I digress! :-)
········@gmail.com <········@gmail.com> wrote:
> BTW, not beyond self-criticism, one of the things that is great about
> APL is select/compress, which would have helped here in my above code:
>
> ...
> ;; Ugh: 123,456,789! Is there a better way to
> ;; remove these????
> (coerce (loop for c across numstring
> unless (char-equal #\, c) collect
> c) 'string)
> ...
(remove #\, numstring)
--
Juho Snellman
········@gmail.com <········@gmail.com> wrote:
> Juho Snellman wrote:
>> (remove #\, numstring)
>
> Nice if this would work, but it does not work. Try it!
Could you expand on that? I don't know how you want it to work, but it
does the same thing as the expression you posted.
(let ((numstring "123,456,789"))
(assert (equal (coerce (loop for c across numstring
unless (char-equal #\, c)
collect c) 'string)
(remove #\, numstring))))
--
Juho Snellman
Juho Snellman wrote:
> ········@gmail.com <········@gmail.com> wrote:
> > Juho Snellman wrote:
> >> (remove #\, numstring)
> >
> > Nice if this would work, but it does not work. Try it!
>
> Could you expand on that? I don't know how you want it to work, but it
> does the same thing as the expression you posted.
>
> (let ((numstring "123,456,789"))
> (assert (equal (coerce (loop for c across numstring
> unless (char-equal #\, c)
> collect c) 'string)
> (remove #\, numstring))))
Actually, you're right; I'm completely wrong. I have no idea what I was
thinking but I seem to have faked myself out somehow into thinking that
I needed all that crap. Duh; Sorry.
Rob Thorpe wrote:
> Joe Marshall wrote:
> > ········@gmail.com wrote:
> <snip>
> > > > NIL
> >
> > I grabbed this from
> > http://www.digitalmars.com/d/archives/digitalmars/D/32010.html
> > They searched for `written in <language>'
> >
> > PHP 2,190,000
>
> Wow, that's impressive.
>
> Especially considering the searchs I did below:-
> Results 1 - 10 of about 3,860,000 for "written in english". (0.15
> seconds)
> Results 1 - 10 of about 321,000 for "written in spanish". (0.11
> seconds)
>
> Dare I mention that this particular google feature is rather unreliable.
I suspect that the result is extrapolated from the density of the hits
for finding the first ten results (i.e., it probably stopped looking
after it got the first ten or so results, looked at how much data it
had to sift through, and estimated how many more hits it would get if
it sifted through the entire data set).
"Joe Marshall" <··········@gmail.com> writes:
> I grabbed this from
> http://www.digitalmars.com/d/archives/digitalmars/D/32010.html
> They searched for `written in <language>'
>
> PHP 2,190,000
> Java 1,820,000
> C 1,560,000
> Perl 1,150,000
> C++ 836,000
> Python 681,000
> C# 344,000
> Fortran 209,000
> Visual Basic 204,000
188,400 CL+Lisp+Scheme
> Ruby 120,000
> Delphi 90,000
Lisp 77,400
> Common Lisp 72,000
Pascal 64,000
Scheme 47,000
But the real problem is that this doesn't count the number of programs
written in each language, but the number of _copies_ that are used on
the web, for PHP, Java and Perl.
Otherwise, you'd be forgetting the 200,000,000 copies of MS-Windows
written (mostly?) in C, not counting the 3,000,000,000 copies of GSM
phone software written (mostly?) in C too?
--
__Pascal Bourguignon__
William James wrote:
> (define (hits language word)
> (regex "(?i)results <b>1</b>.*? of about <b>([\\d,]+)"
> (get-url (string "http://www.google.com/search?hl=en&q=%22"
> language "%20" word "%22")))
> (int (replace "," $1 "")))
>
> (dolist (word '(programming programmer programs code))
> (println "\n" (title-case (string word)) ":\n")
> (dolist (x
> (sort (map (lambda (language) (list (hits language word) language))
> '(csh javascript shell haskell snobol basic
> fortran cobol apl j lisp c++ java mathematica
> ocaml perl python matlab))))
> (println (format "%-13s%8d" (string (last x)) (first x)))))
>
> ;; newLisp
MatzLisp (Ruby):
require 'open-uri'
google = "http://www.google.com/search?hl=en&q=%22"
puts %w(
programming programmer programs code
).
map{ |word|
[
"\n#{ word.capitalize }:\n\n",
%w(
csh javascript shell haskell snobol basic
fortran cobol apl j lisp c++ java mathematica
ocaml perl python matlab
).
map{ |language|
[
open( "#{ google }#{ language }%20#{ word }%22" ){ |f|
f.read }[ /Results <b>1.*? of about <b>([\d,]+)/, 1].
delete(",").to_i ,
language
]
}.sort.map{|a| format( "%-13s%8d", a.last, a.first) }
]
}
--
Do you really think people in 1000 years want to be
constrained by hacks that got put into the foundations of
Common Lisp because a lot of code at Symbolics depended on
it in 1988? --- Paul Graham
On 30 Aug 2006 12:34:26 -0700, "William James" <·········@yahoo.com>
tried to confuse everyone with this message:
> open( "#{ google }#{ language }%20#{ word }%22" ){ |f|
> f.read }[ /Results <b>1.*? of about <b>([\d,]+)/, 1].
<snip similar line noise>
Thanks. You just reminded me why I decided against learning Ruby
(MatzLisp? looks more like MatzPerl to me).
--
|Don't believe this - you're not worthless ,gr---------.ru
|It's us against millions and we can't take them all... | ue il |
|But we can take them on! | @ma |
| (A Wilhelm Scream - The Rip) |______________|
Timofei Shatrov wrote:
> On 30 Aug 2006 12:34:26 -0700, "William James" <·········@yahoo.com>
> tried to confuse everyone with this message:
>
> > open( "#{ google }#{ language }%20#{ word }%22" ){ |f|
> > f.read }[ /Results <b>1.*? of about <b>([\d,]+)/, 1].
> <snip similar line noise>
>
> Thanks. You just reminded me why I decided against learning Ruby
> (MatzLisp? looks more like MatzPerl to me).
>
"#{google}#{language}%20#{word}%22"
is a more concise and clearer version of lisp's:
(format-to-string "~a~a%20~a%22" google language word)
(more clear is subjective but I think it is easier to understand when
you don't have to match each ~a with value in corresponding position)
open(x){| f | ... } # return value of last statement in block is
return value of this calls.
is basically:
(with-open-file (f x) ... ) ;; return value of last form in body
is return value of this calls.
Without any need to use macro.
s[i] is widely known as getting element at index. s[/regexp/] is
basically grepping using regular expression.
This is very basic idiom of Ruby and I don't see how
/Results <b>1.*? of about <b>([\d,]+)/
is harder to understand than.
"(?i)results <b>1</b>.*? of about <b>([\\d,]+)"
So to be honest, I think both Lisp and Ruby version has about the same
amount of clarity.
> --
> |Don't believe this - you're not worthless ,gr---------.ru
> |It's us against millions and we can't take them all... | ue il |
> |But we can take them on! | @ma |
> | (A Wilhelm Scream - The Rip) |______________|
William James wrote:
> ········@gmail.com wrote:
...
> (int (replace "," $1 "")))
...
What's this? It's not CL. [Not the $1, I know that THAT is... I mean
this usage of replace doesn't seem anything like CL. Is it some
personal library function?]
········@gmail.com wrote:
> William James wrote:
> > ········@gmail.com wrote:
> ...
> > (int (replace "," $1 "")))
> ...
>
> What's this? It's not CL. [Not the $1, I know that THAT is... I mean
> this usage of replace doesn't seem anything like CL. Is it some
> personal library function?]
It's newLisp. "Replace" has two meanings in newLisp, one for strings,
another for lists.
Rob Thorpe wrote:
> ········@gmail.com wrote:
> > William James wrote:
> > > ········@gmail.com wrote:
> > ...
> > > (int (replace "," $1 "")))
> > ...
> >
> > What's this? It's not CL. [Not the $1, I know that THAT is... I mean
> > this usage of replace doesn't seem anything like CL. Is it some
> > personal library function?]
>
> It's newLisp. "Replace" has two meanings in newLisp, one for strings,
> another for lists.
Oh. I'm sure that there are threads dating back to infinity and beyond
about this, but it seems to me that "new" Lisps should be upward
compatible from CL. ... Okay... Never mind.
gavino wrote:
> how does lisp compare to apl?
>
> I read an mazing apl faq and it sounded like many descriptions of lisp
>
> it said the brevity is power because u can make shorted programs and
> control complexity
>
> how does it stack up to lisp?
AFAIK, APL's features are easily added to Lisp but not vice-versa. So Lisp
is better as a general purpose programming language.
> I want to learn programmign but can't focus due to my desire to pick
> most powerful tool but also something practical not theoretical.
Yes, there are lots of wildly different languages out there. You'll need to
learn at least one from each paradigm if you want to become a good
programmer...
--
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists
Jon Harrop wrote:
>
> Yes, there are lots of wildly different languages out there. You'll need to
> learn at least one from each paradigm if you want to become a good
> programmer...
Um, no. Only needed if you want to become a knowledgeable, lettered
programmer. *Good* programmers are defined by most of the industry as
those who can spew out a lot of code on time, on budget. Plenty of
people only know 1 language and are "good" by that metric.
Over the past 2 years I've studied a lot of languages and also some
compiler theory. It did not make me a better programmer. It did make
me a more knowledgeable programmer. Getting my hands dirty with build
systems made me a better programmer, because it added "scripting
mentality" to my repertoire. That's something I needed, given my low
level ASM optimization background and tendency towards premature
optimization. I am much better at "just getting things working" now
than I was 2 years ago.
Cheers,
Brandon Van Every
"gavino" <········@yahoo.com> writes:
> APL's features can be ADDEd to lisp?
> !!
> HOW?
> what the!
This just shows how poorly you understand APL, Lisp, and programming
in general. How about this: Propose by posting to this newsgroup a
feature of APL that is not available in Common Lisp, and start your
stopwatch. Come back in two hours and see how many Common Lisp
implementations of that feature are already posted.
gavino wrote:
> Really?
> Can common lisp use memory mapped files?
Does the standard define it: No.
Can most implementations do it: Yes.
Is it used in at least one production Lisp app: Yes.
"gavino" <········@yahoo.com> writes:
> Really?
> Can common lisp use memory mapped files?
Can APL? I asked you to name a specific APL feature that you don't
believe is in Lisp. "[Using] memory mapped files" is not at all
specific.
Ari Johnson wrote:
> "gavino" <········@yahoo.com> writes:
>
> > Really?
> > Can common lisp use memory mapped files?
>
> Can APL? I asked you to name a specific APL feature that you don't
> believe is in Lisp. "[Using] memory mapped files" is not at all
> specific.
Much as I understand where you are coming from, and I agree that memory
mapping files isn't a good example (as it's more of an implementation
feature than a part of the language spec, although these blend into one
another), implementing APL's automatic n-dimension matrix hacming
operations would be difficult (although obviously not impossible) in
Lisp, or any other language. Of course, you could start by saying:
Assume we have an n-dimensional matrix mapping package ... but that
obviously would not be fair.
Another interesting and under-appreciated (by anyone but APL
programmers) is that it had a true eval (because it is a true
interepreter!), and true macros -- indeed, it is the langauge closest
to Lisp (IMHO) in this regard! What makes Lisp macros possible is that
the syntax of the language is trees, which is the same as the basic
data structure (plus eval, and/or a compiler). The same is true of APL:
The syntax is operators all strung together in a vector, and the basic
data structure is vectors (or, more generally, arrays). As a result,
one can actually write quite elegant APL macro functions that create
and then eval the APL code. (Of course there are no compiler macros
because there's not compiler!) They're not quote as general as Lisp --
there is some waco syntax in APL, but we used to use this all the time
to write cool and unusual APL (that did competely un-understandable yet
amazing things)!
Like I said before, I actually loved APL and miss it. It had an
elegance approaching that of Lisp (although in the domain of matrices,
not lists).
"gavino" <········@yahoo.com> wrote:
>I want to learn programmign but can't focus due to my desire to pick
>most powerful tool but also something practical not theoretical.
> help!
The most powerful tool should be your brain -- which doesn't seem to
be the sharpest avocado in the garden!
--
Regards,
Casey