Re: Parallel Common-Lisp with at least 64 processors?
- From: Vend <vend82@xxxxxxxxxxx>
- Date: Wed, 25 Jun 2008 07:28:52 -0700 (PDT)
On 24 Giu, 09:29, p...@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
wrote:
Jon Harrop <j...@xxxxxxxxxxxxxxxxx> writes:
Pascal J. Bourguignon wrote:
Well ok. Indeed, lisp has no native pattern matcher. But it has
something better: smooth and easy meta-programming.
Mathematica has both pattern matching and easy metaprogramming. Could a next
generation Lisp also bundle both?
The question is still whether this is something that needs to be done
at the implementation level.
Most of lisp just doesn't need specific implementation support, but
can be implemented directly over a core lisp. (Without going down to
the theorical pure lambda calculus, you could implement CL just with
its 17 special operators, and all the rest implemented above them).
So the point is that if you, as a lisp programmer, feel the need for a
pattern matcher, then you can implement it yourself in lisp as a
library, and it will be as integrated to the language as any other CL
operator, such as CLOS or LOOP for example.
For a counter example, given that there is no (standard) primitive in
CL allowing us to access the underlying OS and FS, we cannot implement
(portably) lisp pathnames and I/O as a library over the OS and FS.
Instead, CL provides support for pathnames and I/O.
But I don't remember you citing any feature of pattern matching that
would need implementation level support. On the contrary, we have
the example of several pattern matcher libraries.
I'm inciting you to write it, because you seem to be almost alone
wanting to have it. The existing pattern matchers are used when they
are needed, but obviously most lisp programmers don't feel the need
for them in all circumstances.
--
__Pascal Bourguignon__
There is a pattern matching library in PLT Scheme.
I used it to implement the performance test example on the Qi website.
It works but it's quite slow (takes about 20 seconds to complete the
test on my Pentium 4 3 Ghz):
(require (lib "match.ss"))
(define simplify
(match-lambda
((op a b) (s op (simplify a) (simplify b)))
(a a)))
(define s
(match-lambda*
(('+ (and m (? number?)) (and n (? number?))) (+ m n))
(('+ 0 f) f)
(('+ f 0) f)
(('+ a ('+ b c)) (simplify (+ (+ a b) c)))
(('* (and m (? number?)) (and n (? number?))) (* m n))
(('* 0 f) 0)
(('* f 0) 0)
(('* 1 f) f)
(('* f 1) f)
(('* a ('* b c)) (simplify (* (* a b) c)))
((op a b) (list op a b))))
(define (tt)
(time (test 10000000)))
(define (test n)
(if (zero? n)
0
(begin (simplify '[* x [+ [+ [* 12 0] [+ 23 8]] y]]) (test (- n
1)))))
.
- Follow-Ups:
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Jon Harrop
- Re: Parallel Common-Lisp with at least 64 processors?
- From: George Neuner
- Re: Parallel Common-Lisp with at least 64 processors?
- References:
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Jon Harrop
- Re: Parallel Common-Lisp with at least 64 processors?
- From: John Thingstad
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Jon Harrop
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Ariel
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Jon Harrop
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Robert Maas, http://tinyurl.com/uh3t
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Jon Harrop
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Patrick May
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Jon Harrop
- Re: Parallel Common-Lisp with at least 64 processors?
- From: George Neuner
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Jon Harrop
- Re: Parallel Common-Lisp with at least 64 processors?
- From: George Neuner
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Jon Harrop
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Pascal Costanza
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Jon Harrop
- Re: Parallel Common-Lisp with at least 64 processors?
- From: Pascal J. Bourguignon
- Re: Parallel Common-Lisp with at least 64 processors?
- Prev by Date: Re: SBCL is now faster than Java, as fast as Ocaml, and getting better
- Next by Date: Re: Parallel Common-Lisp with at least 64 processors?
- Previous by thread: Re: Parallel Common-Lisp with at least 64 processors?
- Next by thread: Re: Parallel Common-Lisp with at least 64 processors?
- Index(es):
Relevant Pages
|
Loading