Re: Lisp syntax vs. Mathematica syntax
- From: Jon Harrop <usenet@xxxxxxxxxxxxxx>
- Date: Sat, 20 Aug 2005 12:30:07 +0100
josephoswaldgg@xxxxxxxxxxx wrote:
> Mathematica takes a TOTALLY different approach to programming
> abstraction. And I'd hardly consider the resulting dog's breakfast as
> "no problem."
You can write a term-level interpreter for Mathematica just as you can write
an interpreter for any other language. You can write programs in
Mathematica as you would in other languages. It is, after all, evaluated in
basically the same way.
> Look how much punctuation Mathematica introduces to keep "infix"
> notation going.
> ...
Just to clarify, many of the symbols that you've listed are simply infix
functions. You've also omitted a lot of Mathematica's syntax (which is
unusually complicated).
Mathematica can also be very concise. For example, the following squares
each element in a list "l":
#^2&/@l
The OCaml equivalent is:
List.map (fun x -> x*x) l
The C++ equivalent is:
int sqr(int x) { return x*x; }
transform(l.begin(), l.end(), l.begin(), sqr);
OCaml's grammar contains much of the complexity but also a great deal more
(such as the typing of polymorphic variants). To put things in perspective,
my (incomplete) Mathematica grammar was 200LOC and OCaml's grammer is
1,500LOC.
--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.
- Follow-Ups:
- Re: Lisp syntax vs. Mathematica syntax
- From: Jens Axel Søgaard
- Re: Lisp syntax vs. Mathematica syntax
- From: josephoswaldgg@xxxxxxxxxxx
- Re: Lisp syntax vs. Mathematica syntax
- References:
- Re: Very poor Lisp performance
- From: Ulrich Hobelmann
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Förster vom Silberwald
- Re: Very poor Lisp performance
- From: Michael Sullivan
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Hartmann Schaffer
- Re: Very poor Lisp performance
- From: Jamie Border
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Christophe Rhodes
- Re: Very poor Lisp performance
- From: Joe Marshall
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Tayssir John Gabbour
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Joe Marshall
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Ulrich Hobelmann
- Re: Very poor Lisp performance
- From: Jon Harrop
- Lisp syntax vs. Mathematica syntax
- From: josephoswaldgg@xxxxxxxxxxx
- Re: Very poor Lisp performance
- Prev by Date: Re: can anyone offer Lisp job?
- Next by Date: Re: Lisp syntax vs. Mathematica syntax
- Previous by thread: Lisp syntax vs. Mathematica syntax
- Next by thread: Re: Lisp syntax vs. Mathematica syntax
- Index(es):
Relevant Pages
|