Re: merits of Lisp vs Python



Jon Harrop schrieb:
André Thieme wrote:
Jon Harrop schrieb:
That is already a lot more than a "couple of macros" and it is still a
long way from the functionality provided by the pattern matchers bundled
with any of the languages I listed.
A complete pattern matcher will be several screens full of code, because
it really isn't the easiest thing to do.

The pattern matchers in ML compilers are thousands of lines of code, yes.

I suppose that a good amount of this code is used for efficiency?
And I further suppose that the PM is written in ML itself - so abstract
programming techniques were used that wouldn't be available in low level
langs like Pascal or C, yes?



The good thing is that it can be added to lisp as a library, without changing the sources to the
compiler.

You can get the semantics but not the performance because ML pattern
matchers can leverage the compiler's internal run-time representations of
values.

I see. In Lisp the macro can do compile time optimizations, so a PM
could have a real good performance that should not be too far away.


André
--
.



Relevant Pages

  • Re: merits of Lisp vs Python
    ... long way from the functionality provided by the pattern matchers bundled ... with any of the languages I listed. ... The pattern matchers in ML compilers are thousands of lines of code, ...
    (comp.lang.lisp)
  • Re: Does ANSI Common Lisp have pattern matching?
    ... in languages that support it. ... if statements / pattern matchers and add new branches to handle the new ... That's what dynamic dispatch / OOP is there for to solve this particular ... in CLOS the situation is not that pressing: ...
    (comp.lang.lisp)