Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > the necessity of Lisp's Objects?
User Name
Password
REGISTER NOW! Mark Forums Read




Reply Bookmark and Share
11 8th February 19:02
john thingstad
External User
 
Posts: 1
Default the necessity of Lisp's Objects?



Pć Wed, 23 Jan 2008 06:45:51 +0100, skrev Xah Lee <xah@xahlee.org>:

I think you are mixing up object's and object oriented programming.
Calling atomic entities in a language objects predates object oriented
programming.
For the first 30 years or so there was no support for object oriented
programming in lisp.
Object oriented programs are data driven. That is the
functions/procedures/methods/messages (whatever) all relate to the object.
This is what I will assume you mean.

Correct me if I am wrong, but the support for windows programming in
mathematic seems weak.
Sure you have the tree based display subsystem in the notebiook but it
works essentially to format a document. In particular it is processed
sequentially. (like HTML)

This brings me to one of the weaknesses of relational logic. It is not
just in pattern matching and logic programming but also in relational
databases by the way. It is awkward to represent one to may and many to
many relationships.

The data flow in a windows app mens you can wander from one state to
another at random.
This is very difficult to implement with a relational data model.
Thus even languages like Prolog have implemented objects. If for no other
reason than to facilitate writing windows interfaces.

There are problems for which object orientation is the simplest mode.
Lisp is a multi paradigm language. So it supports procedural to-down
programming, bottom up programming and object oriented programming.
There is no style guides in Lisp and probably as many opinions about the
right way of writing Lisp programs as there are people.

For instance Rainer Josvig does most of his work using the CLOS system,
while I am much more reluctant to use it.

For the record describing the Mathematica language as a form of Lisp seems
wrong to me.
Sure it inherits is idea of storing data in trees and using prefix syntax
from Lisp. The essential difference to me is how it handles functions.
Mathematica has relations not functions. So in order to see what code to
call you have to search the database and find which of the definitions
makes the closest match. Like in Prolog order left to right and top to
down is important.

--------------
John Thingstad
  Reply With Quote


 


12 8th February 19:02
john thingstad
External User
 
Posts: 1
Default the necessity of Lisp's Objects?



Pć Wed, 23 Jan 2008 13:54:32 +0100, skrev John Thingstad
<jpthing@online.no>:

That should be classes.

--------------
John Thingstad
  Reply With Quote
13 8th February 19:02
jon harrop
External User
 
Posts: 1
Default the necessity of Lisp's Objects?


Windows is Mathematica's native platform. Other platforms (like Linux) have had missing features.

Notebooks also typeset code and maths and provide interactive graphics.


Notebook cells can be evaluated out of order and, indeed, they are typically
evaluated and edited manually in any order with a few "initialization"
cells that get called once before everything else.


I don't believe Mathematica's language would be inherently bad for
application programming, although it lacks an expressive static type system
like OCaml. However, in the absence of static typing you need huge support
for debugging and unit testing frameworks which Mathematica has also lacked
(although I believe it is now being addressed).

and term rewriting (macros).


Well, rewrite rules.

Equivalently in Lisp, people can and do redefine random stuff and things at
run-time. As they say "where will the program counter go next? Who
knows...". That is the same problem of "rats nest" programs, IMHO.

Incidentally, the Mathematica expression:

{1, 2, 3}

is actually an array/vector rather than a linked list. A true list would be:

{1, {2, {3, {}}}}

Mathematica has very little support for lists and is rather ill-suited to
handling them, e.g. it segfaults from stack overflow after an order of
magnitude fewer recursions than any other language I know.

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u
  Reply With Quote
14 8th February 19:02
ken tilton
External User
 
Posts: 1
Default the necessity of Lisp's Objects?


Haha, sure, it is the same, but is it the same same? Lisp's is nothing
to take lightly:

file:///C:/Program%20Files/acl81/ansicl/glossary/s.htm#symbol

But I digress. Your example does not demonstrate sameness until we also see:

Can do? Bingo bongo, I mean.

kt


--
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
in the evening, die content!"
-- Confucius
  Reply With Quote
15 8th February 19:02
xah lee
External User
 
Posts: 1
Default the necessity of Lisp's Objects?


Hi Kenny!

「If I say (eq (list 1)(list 1)) in Lisp I get nil, aka, nope, they are
not EQ, EQ being the test for object identity. (They happen also not
to be EQL, just EQUAL (the one that digs into structure)).

What happens in Mathematica?
」

In[5]:=
Equal[List[1],List[1]]

Out[5]=
True

This is the beauty of mathematica. Simple, easy to understand. What
you see is what you get. No behind the scenes stuff.

「The advantage to me in Lisp is that I can have two lists starting
with the same textual expression and they will, well, be two different
lists, not one.」

This is exactly the point of confusing, behind-the-scenes lang model,
i mean. Depending on the language, they can get quite convoluted. (in
particular, Java, with its access specifiers, constructors, objects,
arrays, references etc.)

「I can mutate one without mutating the other, holding references to
each in different places, and then see different lists when those two
places are compared, or (the flip side) see "the same" list even when
the contents of the list have changed. ie, I might have two Lisp
"places" bound to the same list and want changes to be visible
regardless of the binding.」

Note here that Mathematica language programing doesn't have any
concepts of momeries, pointers, or references in any way. So, this
means, you can't like change one entity and expect some other entity
will also be changed mysteriously or magically.

Remember, everything is textual, “what u see is what get”, thinking it
as a formal mathematics system. (formal means FORMal. The word
“formal” is a example of bad/mutated terminology that creates endless
confusion)

Kenny 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). If not, sure all list[1,2,3]s can be collapsed into
one, no need for object identity, there it is, list[1,2,3]. But in
Lisp
we can have two variables bound to the same list:

(setf x (setf y (list 1 2 3))

...and then (delete 2 y) and see the result in x because x is "/the
same/ list as y", it is /not/ "the list of 1, 2, and 3".

Is that necessary? It is what it is, which is different than
Mathematica
it seems, but I do not see an interesting issue here.
」

Excellent example to illustrate the issue. I'd pick on your
characterization about this being stateful vs not-stateful. What the
behind-the-scenes hard-linked kinda thing is basically modeled on a
state machine kinda thinking. (actually, more just because it's easy
to implement)

Mathematica does not use “behing the scenes” lang model but you can
assign vars in Mathematica and change it later in your program. The
Mathemtica programing culture is more like “whatever works”, in this
sense a lot like Common Lisp as contrasted to Scheme lisp.

In Mathematica, if you want the behavior as of hardlinking 2 behind-
the-scene things, just assign them to the same var... like this:

In[25]:=
data={1,2,3};
x := data;
y := data;

In[28]:=
data=Delete[data,2]

Out[28]=
{1,3}

In[29]:=
x

Out[29]=
{1,3}

In[30]:=
y

The “:=” is syntax shortcut for “SetDelayed[]”, while “=” is “Set[]”.
The difference, is that the Set evaluate the rhs before assignment,
while SetDelayed evaluate the rhs only when it is called.

In my 2 decades of progaming experiences, with 5+ years of geometry
programing and 5+ years in web application development and unix sys
admin, expert at several languages, i don't think there is a instance
where i needed 2 things to be linked in some hard way. And, whenever a
lang support such a idea, it usually just hamper the use of the
language. (one example is unix file system's hardlinks)

Basically, i think the concept of linking things is one of those easy-
to-implement paradigm that just gets rooted in the early time of
computing, when hardware (as well as software techs) are rather
primitive. Over time, these types of paradigms gets shifted and
eliminated. (e.g. dynamic/lexical scope, pointers vs so-called garbage-
collection, primitive statics typing (a la C, Java) vs dynamic typing
(lisp,perl,python,php, ruby, javascript ...on and on) or typing with
inference (haskell) or no types and mathematical types (Mathematica))

People unfamiliar with ultra high level languages such as Mathematica
(or perhaps haskell too), can understand this “what u see is what u
get” by comparing to dynamic and lexical scope. Lexical scope, in a
sense, is of the model “wysiwyg”, while dynamic can be likened to
“behind the scenes happenings”. The behavior of Mathematica expression
is wysiwyg, while lisp's expressions with its “objects” is “behind the
scenes happenings”. Also, the “behind the scenes” style are often the
brainless of the two to implement, that's why they are everywhere. But
as i repeated quite a few times, as computer langs throughout the past
2 decades, we see a progress towards higher level with less and less
these behind-the-scenese lang model kinda langs.

Kenny wrote:
「No beauty either way, just different.」

There is much beauty far beyond lisp, Kenny.

I get frustrated seeing how people truly are moronic in comparison to
me, having no idea what i'm talking about while i fully understand
what they are talking about. In the past few years i began to reckon
that i'm just a genius, whose views are maybe 30 years into the future
beyond the average computer scientists or industrial programers. (a
bit scary to say this myself, i know.)

In this particular thread, i claim, that high level langs of the
future is getting rid of the “behind the scenes” lang model, as i have
repeatedly voiced it in this thread. When i posted my first post, i
had some reservations, thinking that lisp's objects concept are
perhaps necessary in some way for the lang's area of applications. Now
having seen the many replies and have thought more about it, i more
inclined to think it's simply another baggage of 1970s computing era,
and probably can be eliminated without effecting the power of the lang
in any way.

--------------

I don't like to write short replies... but there are messages going on
in this thread that's going wild... i'll address a few shortly here.

John Thingstad is going wild stating that i confused “object” in OOP
with “lisp's objects”. I have absolutely no idea how he construed
that, honestly, absolutely no idea. In fact in one of my post i
specifically, explicitly, stated that the 2 shouldn't be confused.
Possibly he replied to Rainer's writings thinking it was mine.

The Jon Harrop character, although very informative, tends to spew
taunting remarks selling his stuff. He's throwing a few bad mouthing
of Mathematica, i may or may not retort. (one about how Mathematica
doesn't have some beautiful static typing as his love OCaml, the other
has some technical merits about how mathematica's “list” isnt “true
lists” but “vectors”. (very computer scientist-moronic, use of
jargons))

The Rainer Joswig character, is a silly one. He replied to my
messages, telling me to do some simple computations in Mathematica and
pointing out some Mathematica documentation to me, as to demonstrate
some of his points. Did he miss the fact that i'm the world's top
expert of Mathematica? Or is that not believed? If he belived, at
least, that i have like 10 years of experience of actually programing
in Mathematica, how could he think in such a way as if i didn't
understand some detail in the manual? So, to infer further, perhaps
any disagreement in our post must be attribute to other causes than my
not understanding some aspect of Mathematica?

Rainer's posts, are often like this. Perhaps it's his personality or
way of communication or thinking pattern.

----

... sometimes i think perhaps i should be nicer to people or
something. Oh well, the depths and mysteries and questions of life and
living and cosmos...

Xah
xah@xahlee.org
∑ http://xahlee.org/

☄
  Reply With Quote
16 10th February 04:12
ken tilton
External User
 
Posts: 1
Default the necessity of Lisp's Objects?


I do find things like C++ pretty scary in this respect, mostly because
of that whacky syntax. I am just not sure mutable state is
necessarily confusing. I suppose (but am prepared for rectification) you
are OK with slots of structs and classes (does Mathematica have such
things?) being mutable, such that a change to a slot of an instance is
visible from any reference that might be held to that instance. And I
surmise also you do not consider this magic nor even behind-the-scenes?
If so (and again I understand you might not in fact agree so far), then
all we have in Lisp is that our lists (and other things other than
numbers and characters) also have object identity, so if there are
multiple references to the same thing they all change together, like an
in-memory database if you will.

Now if I am wrong and you do find mutable state in general confusing,
well, I guess many agree with you, namely the entire FP community. And
even I agree: the functional paradigm is a huge win for transparency and
program correctness. I just never enslave my self to good principles
like FP, I always reserve the right to do what I want, shucks, even use
tagbody-go in moments of weakness.

Well, the c.l.l savages always ridicule me on this, but one /does/ have
to master the cons to do well with Lisp. And I guess you are right, many
a noob (all?) trips over Lisp lists early on. Hell, I have always
maintained Lisp lists should be explained this way: there is no such
thing as a list, there are just conses with cars and cdrs.

And?:

Out[30]=
{1,3}

I guess so, since it seems no diff than x. Can I go the other way,
Delete[x,2] and see it back in data? Or has x become like a symbol-macro for data? Anyway...


And once it is called? What if you had evaluated x /first/ and seen
1,2,3 and /then/ deleted 2. Would a second evaluation of x still return
1,2,3? If it returns 1,2, then := in a sense gives one the same thing as
object identity, except (and this may be an advantage, if I want to
achieve this behavior I must remember to use :=. ie, if I now want to
have z refer to the same list, I must say z := x.


I do it all the time. Lists are a very powerful data structure and with
a full suite of list-processing functions such as CL has one can go
quite far with them without getting into structs and classes. This works
especially well inside functions where it is not all that hard to keep
track of what is in each position in a list one dashes off on the fly.


But if we cannot mutate lists we lose expressive power. Lisp programs
that always copy structure cannot scale beyond toy size. So mutable
state is not there just to confuse people, it extends the language (so,
yes, there is more to be learned).


OK, but if one thinks of dynamic scope as up the stack instead of behind
the scenes, it is not so scary. Mind you, this means using special
variables with discipline, only ever binding them in let clauses.


I wish I knew more about FP, it sounds like you would prefer that to the
extra mental housekeeping we Lispers take for granted (and sometimes screw up).


You are right, it has been too long since I dropped this URL: http://www.tilton-technology.com/cello-shot-06.jpg


I have not read much of the thread, but you are not going to change the
audience, all you can change is Xah. (No, it is not easy changing
oneself, either, but unlike changing others it is remotely possible.)
The change you can make is simply to continue only those subthreads you
find worthwhile, which may well be the null set. I think you already do
this with the hysterical Greek chorus that always screeches "Troll!" at
you, just do the same with exchanges you do not find intellectually stimulating.

No, mutable lists rock and are one of the great bits of genius behind
Lisp, the idea that the singly-linked list is an incredibly versatil
data structure. To have that and all the list-processing functions just
sitting there at ones fingertips while dashing off little algorithms is
simply huge, explaining Greenspun's Tenth (the replication of Lisp in other HLLs).


If it helps, what I notice is the character-orientation of your summary.
eg, What happens if my last sentence instead was, "That summary is
character-oriented?" You and I just disappeared, and the chance of
interpersonal conflict diminishes. On those rare occasions when I am not
actively making trouble here, I sometimes go back and rewrite so all the
pronouns disappear. Fascinating exercise.

Ironically, that is hard for you because you are /too/ social an animal.
The sociopath feels no connection to others and so can charm them into
doing anything. Your thin skin (a great metaphor, btw) leaves you no way
to keep people out, no way to shrug off those whose e-company you do not
enjoy. In a sense, by reacting strongly to others you make their
problems your problem, in that you cannot be comfortable as long as they
are jerks. Not a recipe for contentment.

There are billions of people on this planet, put your energy into those
you enjoy, not so much into those you do not. When your will weakens,
well, hey, what's a killfile for?

You worried above about being a genius, here's something you might like.
I got the idea from a bumper sticker, so you know it's good: "If you
think you can do anything, try sailing." Made relevant, nothing is
harder or more rewarding for folks like us than getting along with
others. So if you think you are a genius, Xah, figure out how to get
along with folks on Usenet. I'll give you a headstart from your roots:
"Win without fighting."

kt

--
http://www.theoryyalgebra.com/

"In the morning, hear the Way;
in the evening, die content!"
-- Confucius
  Reply With Quote
17 10th February 04:12
frank buss
External User
 
Posts: 1
Default the necessity of Lisp's Objects?


Looks like this does a deep copy in Mathematica.

Methematica prints {4,5,6} at this point. Maybe this is what Xah Lee means.

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
  Reply With Quote
18 10th February 04:12
kaz kylheku
External User
 
Posts: 1
Default the necessity of Lisp's Objects?


If this concept is only described in the Mathematica documentation
then an expression is not really /in/ Mathematica.

It's just something that you type which becomes a behavior in
Mathematica, but otherwise has no (programmer-accessible)
representation.

I.e. List[1, 2, 3] causes something to happen, but is itself not an
entity.

According to you, anyway. If you understand Mathematica as well as you
do Lisp, then I'd take all that with a grain of salt. Maybe there is a
way to quote List[1, 2, 3] to get it as data, only you haven't figured it out.


Not giving the programmers access to the data structure which
represents the program source is simply a myopic limitation. A myopic
limitation doesn't give rise to a higher level language.

You need the source code as an object if you want to extend the
compiler with user-defined code to handle new syntax by transforming
it to existing syntax (e.g. Lisp macros).

Note that in compiled Lisp systems, the object representation of a
program can ``go away''. It's needed during the source code processing
steps, including macro expansion. When all of that is done, the
representation of a program becomes machine language. Of course, any
literal constants in the program, including quoted pieces of its list
structure, become run-time data.

So if we have:

(defun foo()
'(1 2 3))

when we compile it, the list (defun foo () '(1 2 3)) goes away; it is
not necessary to retain it in the compiled image. The list (1 2 3)
however will be represented somewhere in that image as static data,
just like a numeric or string literal. The function FOO will be
translated to some little piece of machine code which calculates the
effective address of that data (i.e. the reference to the first cons
cell of (1 2 3)) and returns it.

This is analogous to the C language:

/* this ``while'' appears in the compiled image */
char *str = "while";

/* this ``while'' doesn't */
while (1) { /* ... */ }

One is quoted to become literal data, one isn't.
  Reply With Quote
19 11th February 13:28
xah lee
External User
 
Posts: 1
Default the necessity of Lisp's Objects?


This reply is long, at over 5 thousand words. It is separated into 3
posts.

-------------

because of that whacky syntax. I am just not sure mutable state is
necessarily confusing. I suppose (but am prepared for rectification)
you are OK with slots of structs and classes (does Mathematica have
such things?)»

struct as in C's “record” data type? Classes as in Java? Mathematica
doesn't have these things. For Class, it depend on what you mean. As a
language's data type, no. As a function that contains data ond inner
functions one can implement in just about any well designed lang, yes.

Kenny wrote:
«being mutable, such that a change to a slot of an instance is visible
from any reference that might be held to that instance. And I surmise
also you do not consider this magic nor even behind-the-scenes? If so
(and again I understand you might not in fact agree so far), then all
we have in Lisp is that our lists (and other things other than numbers
and characters) also have object identity, so if there are multiple
references to the same thing they all change together, like an in-
memory database if you will. »

As i repeated many times now, programing in Mathematica does not have
any concept of memory, reference, pointer, WHATSOEVER. There is NO
behind-the-scene memory, object, abstract storage location, where some
other entities “reference” to it.

As i repeated many times, one can think of Mathematica as graph-
rewriting, term-rewriting, symbol-sequence transformation, or a formal
system. Where, the formal here means mathematical _formalism_ (lookup
in wikipedia, folks!). Or, think of it as lisp's concept of “forms”
that are used everywhere in emacs lisp documentation, it is
essentially the principal concept one needs to understand for lisp's
macros. So, practically speaking, one could think of Mathematica
language as if it is programing in lisp using macros and nothing but
macros. (So, if you think of this way, you'll see what i mean by no
“behind the scene”, a wysiwyg model of language. I repeat, think of it
as pure lisp macro and form programing. _Textual_. No “behind the
scenes” stuff! WHAT YOU SEE IS WHAT YOU GET! _Textual_. No “behind the
scenes” stuff! WHAT YOU SEE IS WHAT YOU GET! _Textual_. No “behind the
scenes” stuff! WHAT YOU SEE IS WHAT YOU GET! _Textual_. No “behind the
scenes” stuff! WHAT YOU SEE IS WHAT YOU GET!)

Of course, despite my profuse talking, i guess it is nigh impossible
to convey the idea unless one actually start to program or spend a few
hours in Mathematica. In analogy, imagine yourself trying to preach
the gospel of lisp to Java programers. You can spend hours and few
thousands words, on some concept that's so crystal clear and basic to
you, but the Java guy wouldn't be able to comprehend it. (and if the
Java person happens to be a hotshot or have years of industrial
experience, or if you happen to not kiss their asses (why should
you?), he'll deem you a fucking troll)

The thought has come to my mind to write a few pages of tutorial of
mathematica for lisp programers. Written in a way such that every
mathematica construct has a exact analogous counter part in lisp, in
both syntax and semantics, so that the tutorial actually also
functions as a fun-oriented lisp programing excursion. (in fact, if
you are a lisp expert, you can consider yourself already half of a
Mathematica expert. (lisp's major concepts of fully functional nested
syntax, forms, macros, lambda, lists, function application are just
about the same set of fundamental ideas in Mathematica, almost token
for token identical except few syntax quirks or when we get into hairy
stuff of evaluation model exhibited in lisp as “quote”, “eval” ... or
in Mathematica as Hold[], HoldForm[], Evaluate[], ReleaseHold[]...)
For any seasoned lisper, if you actually just spend 1 month studying
Mathematica, you can boast 1 year of Mathematica experience in your
resume. And if you code Mathematica for 1 year, you can boast being a
Mathematica expert. (in this regard of Lisp/Mathematica, its the same
with Perl/PHP, Scheme/Common Lisp, and probably similar with Java/C#,
due to, their intimacies))

In many of my post about lisp here in 2007, often i have hoped that my
discussion may lead to the discourse of hows and technicalities of a
writing lisp extension that emulates Mathematica. (am ambivalent in
leading into this direction since if successful, will piss off Stephen
Wolfram (robbing his business), possibly entail legal issues, and i
myself am not ready to gratuitously offer my services to lisp
community given the way lisper MORONS reacted to my criticisms and
amidst the fucking militant OpenSource collectivism ambiance)

Lisp can actually relatively easily do it, emulating the full
Mathematica's systematic list/tree extraction/manipulation functions
(getting rids of the cons problem for good), as well getting rid of
the lisp “behind the scenes” object concept with some practical
benefits, a full automatic code formatter (beyond emacs current
offerings) that get rid of the endless manual “how you should indent
parens” once for all (as in the benefit transparently offered by
Python), and also layer on top of sexp a infix notation while
maintaining absolutely the full sexp benefits, and even more, if lisp
experts are interested in spending now quite a lot energy, go as far
as making lisp a full 2D Mathematical notation display system, and a
notebook system (think of it as a language feature so powerful that
the SOURCE CODE actually transparenly functions like a Word Processor
file format that can contain structures and images).

But before any of the above discussions can sprout, it is already shot
down by the army of sensitive and clueless lisper morons. Guarding
their ways in high anxiety, dismissing the FREQUENT and PERSISTANT
criticisms of lisp (many of these criticisms are from renowned lisp
luminaries), and kept thinking somehow that a language designed 40
years ago are destined to be perpetually perfect. (meanwhile
grudgingly witnessing facts that relative fucking stupid langs like
Perl, Python, PHP, Java, Ruby, born and rose beyond lisp's combined
applications in its entire history) Many old lispers still fancy that
lisp is the only unique, all-powerful, all-living creature that rule
all languages.

This is a social and psychological problem of lisp mainly caused by
the old timers. Besides fixing problems of the lisp the language
proper, other problems and possible solutions such as frequent
complain of its libraries are similarly thwarted and smiten.

Whenever there's a new lisp, such as dylan or the vapourwear arc,
there's a high sentiment of hate-love brouhaha. All Common lispers are
anxious and giddy, throwing mixed remarks of excitment and
belittlement. The Scheme Lispers live in a fantasy world of their own,
simultaneously wishing for popularity and aloofness, culminating in
the R6RS fuckup in late 2007. (if my chances of becoming a Common
Lisper anytime soon is 1%, my chances to become a Scheme lisper is
0.01%, by sheer will.)

(this post continues in the next post)

Xah
xah@xahlee.org
∑ http://xahlee.org/

☄
  Reply With Quote
20 11th February 13:28
xah lee
External User
 
Posts: 1
Default the necessity of Lisp's Objects?


(this post the 2nd part continuation from previous one)

well, I guess many agree with you, namely the entire FP community. And
even I agree: the functional paradigm is a huge win for transparency
and program correctness. I just never enslave my self to good
principles like FP, I always reserve the right to do what I want,
shucks, even use tagbody-go in moments of weakness. »

KENNY!! IT'S NOT A QUESTION OF MUTABILITY! Mutability — another
computer “scientist-moron” jargon. What you mean by mutability? As i
have repeatedly explained in different contexts in posts here, opaque
jargons beget confusion. By mutability, do you mean ultimately the
ability to reference to the same memory address exhibited in lisp as
lisp objects? By mutability do you mean Haskell's prevention of a
variable being assigned twice?

As i tried to explain in previous message... regarding Mathematica, if
by mutability you mean pointers/references/behind-the-scene-objects,
then No, mathematica doesn't have any of such notions. If by
mutability you mean whether a variable can have its values changed,
then yes, Mathematica do.

The “mutable/mutability/immutable” is another fucking jargon that
refuse to die precisely because it's a fucking moronic imprecise and
gaudy jargon. It has different meanings as applied to data types,
languages, language models, computational models. Every tech geeker
latches onto it their own conception and brandish it to no ends.

Note here, as i have also repeated in different posts in the past,
that among Mathematica's over 1 thousand pages of manual, containing
fucking over 1 thousand build-in functions, with maybe a few hundred
advanced mathematical functions that only a few handful mathematicians
in the world understands their meaning, and containing all the fucking
fancy constructs exhibited by jargons such as lambda, HOF (higher
order function), fucking first class citizens, fucking fuck you
“closures”, mutabilatilabilalilaty, M'm'mmmmacros, the over 1 thousand
pages of Mathematica manual doesn't mention any of these fucking shit
terms and is extremely easy to read and understand. (i happened to
have read the over 1 thousand pages of mathematica manual word for
word from cover to cover 3 times during 1990s in different years)

Kenny wrote:
«Well, the c.l.l savages always ridicule me on this, but one /does/
have to master the cons to do well with Lisp. And I guess you are
right, many a noob (all?) trips over Lisp lists early on. Hell, I have
always maintained Lisp lists should be explained this way: there is no
such thing as a list, there are just conses with cars and cdrs.»

Exactly. When will these lispers die?

When?

------------------------------------

In[25]:=
data={1,2,3};
x := data;
y := data;

In[28]:=
data=Delete[data,2]
Out[28]=
{1,3}

In[29]:=
x
Out[29]=
{1,3}

In[30]:=
y
Out[30]=
{1,3}

Kenny wrote:
«Can I go the other way, Delete[x,2] and see it back in data?»

No, not in the above. Remember, in Mathematica, everything is textual,
or copies. All functions return copies. There's no such thing as some
“object” that lives in some ether space that if changed effects others
entities “pointing/referencing” to it. There is no concept of
reference/pointer/memory whatsoever. Again, think of programing only
using lisp's macros. It's all about form changing. What you see is
what you get. WYSIWYG.

Kenny wrote:
«Or has x become like a symbol-macro for data?»

Yes. If i understand you correctly, yes.

Xah wrote:
「The “:=” is syntax shortcut for “SetDelayed[]”, while “=” is
“Set[]”. The difference, is that the Set evaluate the rhs before
assignment, while SetDelayed evaluate the rhs only when it is called.」

Kenny wrote:
«And once it is called? What if you had evaluated x /first/ and seen
1,2,3 and /then/ deleted 2. Would a second evaluation of x still
return 1,2,3? If it returns 1,2, then := in a sense gives one the same
thing as object identity, except (and this may be an advantage, if I
want to achieve this behavior I must remember to use :=. ie, if I now
want to have z refer to the same list, I must say z := x.»

Yes.

Again, if a programer actually want the behavior of certain things
linked together, you can do it just as one can in any well-designed
lang. (For example, in lisp, you can program the hard link behavior
without resorting to lisp's default objects concepts) The concept of
linked behavior as exhibited by langs that come with the “behind-the-
scenes” “language model” is essentially having the variables defined
in terms of another variable, since the hard link concept is basically
just references pointing to the same memory address.

I'd be happy to show how it can be done in Mathematica if you provide
lisp code of certain linked behavior you want.

-------------------------------------

The thing to understand here is high-level-ness. It seems to me,
programers accustomed to compiled languages as well as lispers, have a
extremely difficult time understanding the concept of computer
language as a textual interface to computation. In particular,
compiler writers or those acquainted with compiler knowledge, are
spectacularly incapable in understanding this because their brain has
been permanently damaged by low-level exposure. (in this thread, that
Kaz Kylheku guy is the best example, voicing his dips and jumpers
mumble jumble into this thread. (if we switch the underlying hardware
to DNA or quantum qubits, his dips and jumpers goes haywire))

Kenny wrote:
«But if we cannot mutate lists we lose expressive power. Lisp programs
that always copy structure cannot scale beyond toy size. So mutable
state is not there just to confuse people, it extends the language
(so, yes, there is more to be learned).»

I object your use of the term mutable here as discussed above.
However, if i understand you correctly... here's the issue.

My issue here, is the complete separation of language as a interface
to computation, and elements in the language as hints/declarations/
helpers for the current technology of compilers to achieve speed or
certain low level issues (such as reference to memory, number size in
bits), which are necessary when the language is used in certain
applications (such as writing a OS, compiler, device driver) that by
definition needs to have direct access to hardware elements.

As i've tried to explain above, the behavior of linked things (of
which you are calling it “mutability” here), is essentially having 2
vars pointing to another var that holds the value. As i tried to
explain, this can be easily done in any well-designed lang, without
having the language having a behind-the-scenes reference/pointer/
object model. (how exactly it is done depends on the language, of
course) As stated before, if you give a code example in lisp that
shows some linked behavior, i can provide the some behavior coded in
Mathematica, or i can even try to code the same behavior in emacs lisp
but implemented without utilizing what you'd call the “mutability”
concept (what i'd call behind-the-scenes language model, or pointers/
references/“memory addr”/“lisp's object”.).

In yet another way to see this, is to focus on the _behavior_ of
computation as a function of the language's textual input (the source
code). Put it in yet another way, any of the idiosyncratic behind-the-
scenes language model of Lisp/Java/C are all having no mathematically
meaningful utility. They are by-products of computer engineering
constrained by today's hardware, often necessary due to practical,
speed issues. (and in the case of C and Java or most imperative langs,
it's mostly because it's brainless to implement)

Kenny wrote:
«OK, but if one thinks of dynamic scope as up the stack instead of
behind the scenes, it is not so scary. Mind you, this means using
special variables with discipline, only ever binding them in let
clauses.»

Nah.

First of all, please don't use the word stack. I don't know what the
fuck is a stack, and i know it is mathematically meaningless. What i
do know, is that one can insert ping pong balls into a pussy, and the
last one inserted will come out first. Now, that is mathematics.

Dynamic scope is another stupidity, just like the behind-the-scenes
things i've spoke above, that it has no meaningful Mathematical value.
Its existence, is just a by-product of computer engineering
constrained by computer hardware (in this case, the hardware of few
decades ago). As a “proof” of this, you do realize that dynamic scope
basically disappeared in langs of the past 2 decades.

Of course, as a review of computing history, we note that the behavior
of the fortuitous “dynamic scope” of the past is actually desirable
sometimes. And, it can be easily implemented in any well designed
langs, without the lang itself having a behind-the-scene stuff.
Exactly how this can implemented on top depends on the lang of course.

Again, let me emphasize, the issue here, is a clear separation of what
is mathematical meaningful in a language, from what's practical,
speed, or hardware issues. If one wants to design a language that's
not just high-level like mathematica, but also as speedy as C, then as
i have wrote long esasy before, this should be done by having special
declarative/hint construct that clearly indicate to user of the
language that such is for the compiler, and having nothing to do with
his computation.

Kenny wrote:
«I wish I knew more about FP, it sounds like you would prefer that to
the extra mental housekeeping we Lispers take for granted (and
sometimes screw up).»

I think i'm even aversive to the jargon of Functional Programming. It
smacks of certain elitism and generates confusion. So-called
Functional programing practically is just to define your functions so
it doesn't call global vars. Of course, in a more strict sense, it
entails all that lambda, currying, recursion, higher-order-functions,
function sequencing aka filters or streaming, function composition,
“referential transparencies”, monads (whatever that is) ... and all
that good shit.

... now a bit rambling about jargons:

Jargons, first of all, we should understand, are terms that arise in
particular field by its professionals, for the practical purpose to
communication. More specifically, the need is usually as a shorthand
of complex ideas, and a way to make the idea precise. As i have said
profusely in my various essays, jargons, being a part of language,
which is a social element of human animals, it also serve a social
function of class differentiation (think of how you dress represent
who you are; and you diction and accent gives out who you are; and
human animals in general go out of their way to dress/speak in hope to
give impressions, hide, or be themselves). Jargons, as in this social
role, tends to become abused, in the sense that often jargons are
thrown by people without actually intending to use it as its original,
professional purpose of ease in communicating specialized ideas. More
specifically, jargons are throw by people without understanding what
it means nor intend to discuss any issue. (see the many literary,
highbrow words i used in this post? They are not really there for the
purpose of clear communication. They are there, to tell my detractors,
that they are fucking morons in comparison to me in the department of
english writing. Too.)

Now, a jargon, or the naming of things, has a quality aspect. That is,
as a professional in some field, we can judge, the quality of a jargon
according to the degree the term communicates its meaning or by other
criterion such as terseness, familiarity, religious/cultural issues,
and so on. For example, there are standardized jargons in almost all
professional fields with published tomes, and many times how a new
concept or thing is named is much debated for its merits before it is
actually standardized or adopted by some standardizing organization in
the field. (think of jargons in law, physics, mathematics, chemistry,
astronomy, biology, psychology, literature, linguistics ... and in
general any science. (try to come up with examples of jargons in each
of these field yourself))

Now, let's consider the jargon “functional programing” a bit.. The
jargon “functional programing”, in my opinion, is a jargon of good
quality. It communicates its meaning quite well, based on the
similarity of math concept of function. Not too long, culturally ok,
not offensive ..., using words that are commonly understood (sometimes
this is a good thing, sometimes not) ...

Now, let's consider the jargon “functional programing” in the context
of social, class differentiation context. When the jargon FP is
abused, in what way it is abused? what are some of the particular
effects or ramifications of its abuse? I don't have some elaborate
analysis of this... but one observation i can think of, is that it
confounds the very essence of the idea functional programing, namely
that of coding subroutines such that it doesn't use global vars. So,
especially when in tech geekers group as in comp.lang.*, it often
gives the impression to laymen (imperative programers) that it is
something very complex, involving a bunch of “advanced” and esoteric
concepts of math. Essentially, distorting its essential meaning and
generates non-understanding for something that is otherwise extremely
easy to understand.

(again, i note here that in the Mathematica language's one-thousand
pages of manual, it does not emphasize or give the reader any
impression of the jargon “functional programing” at all. (am not sure
if the term is actually found in the manual other than in a intro
section showing briefly how Mathematica can do various styles of
programing) This is a extreme beauty and savviness of Stephen Wolfram.
The effect of this proper technical writing, avoids the problem of
programers sensationally discuss things that is divisive of programing
(i.e. writing specifications for a desired computation). In contrast,
the worst shit of abuse of jargon and its damaging effects happen in
Haskell, Scheme, Perl, Python documentations. Perl and Python docs are
in different class of stupidity than the Haskell and Scheme. Haskell
and Scheme people actually understand the meaning of the jargons they
use, and they used it properly, only not understanding its social
aspects. While, the Perl and Python morons do not understand the
technical aspects of the jargons they use, but also so fucking stupid
to litter them profusely in their docs)

Kenny wrote:
«You are right, it has been too long since I dropped this URL:
http://www.tilton-technology.com/cello-shot-06.jpg
»

Great. Can the chick be naked?

I have:
http://xahlee.org/PageTwo_dir/Person...rn_movies.html

Kenny wrote:
«No, mutable lists rock and are one of the great bits of genius behind
Lisp, the idea that the singly-linked list is an incredibly versatile
data structure. To have that and all the list-processing functions
just sitting there at ones fingertips while dashing off little
algorithms is simply huge, explaining Greenspun's Tenth (the
replication of Lisp in other HLLs).»

O my god Kenny. By now i hope you understand my idea of the separation
of computer language issues of (1) language elements that have do to
with constructing computation and algorithms. (2) language elements
that are by-products of computer engineering constrained by hardware
technologies; mathematically valueless but necessarily anyway for
practical, speed, or hardware-device-controlling aspects.

If you understand the above, you'll see that the “linked list” belongs
to the second category. In other words, it is a mathematically
meaningless concept as far as computation is concerned.

And, if you understand the above, then the linked list as exhibited in
lisp's cons cells, is detrimental and hampers the programer's job of
using the language to specify computations. To you, a lisper, you
might not see this, and think cons being great because the lang's
technical details is ingrained in your mind. But let me put to you a
mirror: suppose i present to you the idiosyncratic, behind-the-scene,
language model thingamajig used in Java or C or C++ language, you
probably are very confounded by them, and find them quite a fetter and
distraction to specifying computations you have in your mind.

--------------------------

In the above, i have expressed the idea of seperation of mathematicaly
meaningful elements of a computer language, from elements in the
language that are necessitated by hardware and speed constraints.

Stephen Wolfram — a certified genius — resorts to not word but deeds
and created Mathematica some 20 years ago, based on this priciple. (i
do not know he actually, explicitly thought in this way, nor, whether
this is the dominant priciple he had in mind when creating
Mathematica. However, it is my ascription, that Mathematica the lang
is a lang based on the above priciple. Furhter, Stephen is fully aware
of this priciple and this is exhibited in a lot places in his
writings. (side note: there are other langs based on this principle,
also, i'm not the only person who have this idea. This idea of a lang
being a pure tool for specification of computation without computer-
engineering-hardware issues, is certainly not new. However, it is
probably the case that 99.99% of computer scientist who work on
languages, have no idea of it.))

I hope i have made this idea clear. A recent essay on this is at:

“Jargons And High Level Languages”
http://xahlee.org/emacs/jargons_high_level_lang.html

(and read the related essays linked at the bottom if you want to know
more)

Is there any lispers who are still very confused and don't know what
i'm talking about? Raise your hands please, so i can kick you in the
ass.

(this message continues in the next post)

Xah
xah@xahlee.org
∑ http://xahlee.org/

☄
  Reply With Quote
Reply


Thread Tools
Display Modes


Some other forums that might be of your interest : Development, Ada, Apple script, Assembler, Awk, Beos, Basic, C, C++, C#, C# .net, .net, .net frameworks, Asp .net, Clarion, Clipper, Clos, Clu, Cobol, Coldfusion, Delphi, Dylan, Eiffel, Forth, Fortran, Haskell, Hermes, Icon, Idl, Java, Java script, Jscript .net, Jcl, Linoleum, Lisp, Lotus, Limbo, Logo, Ml, Mumps, Oberon, Postscript, Pop, Pl1, Prolog, Python, Ruby, Pascal, Perl, Php, Rebol, Rexx, Sed, Sather, Scheme, Smalltalk, Tcl, Vhdl, Vrml, Visual basic, Visual basic .net, Yorick, Mysql, Omnis, Postgresql, Xbase, Access, Oracle, Adabas, Berkeley, Btrieve, Filemaker, Gupta, Db2, Informix, Ingres, Mssql server, Object, Olap, Paradox, Rdb, Revelation, Sybase, Theory, Dbase, Html, Java script, Css, Flash, Photoshop, Corel script, Xml, Tech, Beos, Gem, Hp48, Hpux, Linux, Mac, Ms-dos, Os2, Palm, Solaris, Ti99, Windows, Xenix, Aos, Chorus, Geos, Inferno, Lantastic, Lynx, Mach, Minix, Netware, Os9, Parix, Plan9, Psos, Qnx, Xinu, Sco, Unix, Aix, Aux, 386bsd, Bsdi, Freebsd, Netbsd, Openbsd, Ultrix, Amd, Intel, Aptiva, Buz, Deals, Homebuilt, Overclocking, Programming, Extra forums


Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666