|
|
Up |
|
|
  |
Author: Xah LeeXah Lee Date: Jan 22, 2008 01:50
2008-01-22
I've been programing mathematica since 1993, worked as intern at
Wolfram Research Inc in 1995. And since have been coding Mathematica
daily up to 1998, and on and off since then.
I started to learn emacs in around 1997, and use it daily, about 8
hours a day, ever since and still today.
I started to learn lisp in about 1997. Mostly, i red word-for-word, 3
chapters of the book Structure And Interpretation Of Computer Programs
by Harold Abelson et al. (out of 5 chapters total) And, i have read
maybe half of the Scheme lisp spec “Revised(4) Report on the
Algorithmic Language Scheme”. These are all during 1997-1998. However,
at the time i've never really wrote any programs in lisp other than
toy factorial function.
In 2005, i started to casually learn emacs lisp. Because i use emacs
extensively and daily since 1998, thus emacs lisp is quite practical
for me, and i have kept learning it and in fact have wrote quite a few
small scale, but nevertheless practical, programs. (typically less
than a thousand lines of code; for text processing tasks)
--------------
|
| Show full article (6.89Kb) |
|
| | 78 Comments |
|
  |
Author: Pascal CostanzaPascal Costanza Date: Jan 22, 2008 03:58
Xah Lee wrote:
> In Mathematica, there's no such steps of concept. The list
> “List[1,2,3]” is just a list as is. There is no such intermediate
> concept of objects. Everything in Mathematica is just a “expression”,
> meaning the texual code you type.
|
| |
|
| | no comments |
|
  |
Author: Patrick MayPatrick May Date: Jan 22, 2008 05:05
Pascal Costanza p-cos.net> writes:
> Xah Lee wrote:
>> In Mathematica, there's no such steps of concept. The list
>> “List[1,2,3]” is just a list as is. There is no such intermediate
>> concept of objects. Everything in Mathematica is just a
>> “expression”, meaning the texual code you type.
>
> No, "List[1,2,3]" is just a couple of black pixels on the screen.
Are you sure? They appear in a subdued white on mine.
Regards,
Patrick
------------------------------------------------------------------------
S P Engineering, Inc. | Large scale, mission-critical, distributed OO
| systems design and implementation.
pjm@ spe.com | (C++, Java, Common Lisp, Jini, middleware, SOA)
|
| |
| no comments |
|
  |
Author: PillsyPillsy Date: Jan 22, 2008 05:27
On Jan 22, 4:50 am, Xah Lee xahlee.org> wrote:
[...]
> The Mathematica language is very similar to lisp. From a Mathematica
> expert's point of view (me), the first thing that seems odd of lisp is
> the low-level-ness. Perhaps in order of the low level impression:
> 1. The cons business. (lists are made up of cons cells and it is
> necessary for the programer to understand this to write any non-
> trivial lisp program)
This is a *strength* of Lisp over Mathematica. M'ca's underlying list
representation is actually a vector, which means that pushing items
onto the front of a list is quite expensive. A lot of the time M'ca
programs end up using two-element "lists" as conses, giving you
results like:
{a[1], {a[2], {a[3], ...}}}
and you have to gratuitously flatten everything when you're done. It's
just plain annoying.
|
| Show full article (1.45Kb) |
| no comments |
|
  |
Author: Joshua TaylorJoshua Taylor Date: Jan 22, 2008 05:31
On Jan 22, 6:58 am, Pascal Costanza p-cos.net> wrote:
> Xah Lee wrote:
>> In Mathematica, there's no such steps of concept. The list
>> "List[1,2,3]" is just a list as is. There is no such intermediate
>> concept of objects. Everything in Mathematica is just a "expression",
>> meaning the texual code you type.
>
> No, "List[1,2,3]" is just a couple of black pixels on the screen.
>
> Pascal
While I won't make a stand for or against constructor style output of
objects, their use is important in the /design/ of programs. Consider,
for instance, the typical Fibonacci definition:
fib(0) = 0
fib(1) = 1
fib(n) = fib(n-1) + fib(n-2)
A key to understanding the inefficiency of the naive recursive
implementation is seeing the repeated computation:
|
| Show full article (1.61Kb) |
| no comments |
|
  |
Author: Steve HarrisSteve Harris Date: Jan 22, 2008 11:09
> if a function (e.g. "map") that takes another
> function as argument, why would the function require the programer to
> put the apostrophy, why the function itself could be designed to not
> evaluate that argument.)
Because usually the argument is not a literal, but an s-expression
that needs to be evaluated to produce the list.
|
| |
| no comments |
|
  |
Author: Xah LeeXah Lee Date: Jan 22, 2008 21:45
2008-01-22
sometimes its quite frustrating when discussing things in newsgroups.
As most know, newsgroups discussions are characterized by ignorance,
massive confusion, one-upmanship, and in general a showcase of the
loniness of the tech geekers in technological societies ...
but in this particular thread, a contributing factor is that most
people don't know Mathematica to the degree that nobody ever seen one
single line of code in Mathematica, and of the very few who have
actually used Mathematica (maybe in their school days in the computer
lab), most don't have the basic knowledge of programing it.
(Mathematica 6 sells for over 2 thousands dollars i think (check their
web to be sure), and before that version, it's over one thousand
dollars, and i guess it is sold perhaps 10 or hundreds times than
lisps sold by all lisp companies combined)
|
| Show full article (10.66Kb) |
| no comments |
|
  |
Author: Ken TiltonKen Tilton Date: Jan 22, 2008 22:55
Xah Lee wrote:
...maciej made me snip this....
> What prompted me to write this post, is that yesterday i thought a bit
> about lisp's objects, why Mathematica doesn't have it, and realized:
>
> Mathematica, being high-level as it is, essentially merged the concept
> of read-syntax, print-syntax, and objects, into just one concept of
> “What you see is what you get” _Expressions_ (i.e. the code programer
> types). That is, the code is the object, the object is the code. In
> other words, there is no such “internal” concepts as objects. What you
> type is the code, as well as the meaning.
>
> For example, let's say a list:
>
> In lisp:
> (list 1 2 3)
>
> Mathematica:
> List[1,2,3]
|
| Show full article (3.11Kb) |
| no comments |
|
  |
Author: Rainer JoswigRainer Joswig Date: Jan 23, 2008 00:37
In article
v46g2000hsv.googlegroups.com>,
Xah Lee xahlee.org> wrote:
...
I think you are seriously confused when it comes to programming
language models. Don't take that offensive, just as a recommendation
to clear up basic things like: 'expression', 'object', 'process',
'interpretation'. Part of that may come from that Mathematica only
has a weak specification of the core programming language.
> Thanks Rainer and others for correcting some errors about my statement
> of lisp's "list" and "quote" in relation to the read/print syntax.
> (and thanks Rainer for the technical exposition on lisp's...
|
| Show full article (3.67Kb) |
| no comments |
|
  |
|
|
  |
Author: Frank BussFrank Buss Date: Jan 23, 2008 00:40
Ken Tilton wrote:
> Mind you, this all comes down to the question of state. Does Mathematica
> have that concept, or is it purely functional? (not that I am conversant
> with FPL either).
I'm not a Mathematica expert, but sometimes it is useful for solving
equations etc. If you hit F1 on "List" in Mathematic, the help screen says:
| Lists are very general objects that represent collections of expressions.
This means, Mathematica has objects and a list is an object. And you can
modify lists in Mathematica, without modifying other lists with the same
elements, which would be really strange. Functional languages like Haskell
doesn't allow to modify lists (with some exceptions and internally some
operations may be implemented in an efficient modifying way), which makes
it easier to write more bug-free code, if you think long enough to find a
good functional solution, which is more difficult for me sometimes than
writing a non-functional solution.
A Mathematica notebook:
In[1]:=x=List[4,5,6]
Out[1]={4,5,6}
|
| Show full article (1.51Kb) |
| no comments |
|
|
|
|