>> I'm intrigued by the idea of functional programming, but i haven't >> found much material on it on the Web (which means i'm probably looking >> in the wrong place). There are a number of purely functional >> programming languages, then there's Lisp-ish languages and everything >> else.
>> My superficial observation is that Lisp users seem to be more tolerant >> of side-effects in their programs than Scheme users.
>yes. common-lisp emphasizes getting things done as opposed to >strictly maintaining language purity. personally, i think common-lisp >does a pretty good job on both counts.
To first talk about the languages as things in themselves: Scheme and CL are identical in their approach to side-effects (modulo only spelling). They both allow changing the bindings of variables, and they both allow mutating the contents of compound data. (Some languages like ML allow side-effects of the second type only, so one has to mimic assignable variables by defining a pro-forma compound datum called the reference. References require special syntax for mere access, which Scheme and CL variables don't.) You'd be shortchanging yourself if you used side-effects as a litmus to choose one of Scheme or CL over the other.
To next talk about usage: I disagree with the speculation that Scheme usage is more leery of side-effects, even if the language allows them. Both Scheme and CL have a non-imperative core, and users in both languages make forays out of this _as the situation demands_. Of course no one is going to use side-effects (or _anything_) gratuitously, not even in the C world, where assignment is used because it is the only way to solve a problem (another way of looking at this is that C's non-imperative core is not powerful enough). In Scheme and Common Lisp, it isn't that side-effects are curtailed, but that alternatives exist in the form of really powerful procedural constructs, and naturally they also find use. The full power of side-effects is nevertheless still there.
No influential Scheme group is side-effect-shy, but even so, the Scheme community I followed (Rice, Indiana) is extremely active in the imperative aspect of Scheme, fending off as it did the prevailing myth at the time that you cannot have mathematically reasonable languages that also had imperative features. It has done extensive work charting out the imperative landscape of Scheme, mapping it into two categories, i.e., State and Control. Some of the most persuasive elucidation that a purely functional approach (however higher-order) is weaker than its combination with imperative features comes from this community. Even the most idle surfing of the Scheme offerings on the Rice web site will put to rest any concerns you may have that side-effects receive but cursory treatment in the Scheme world.
If you find Scheme useful and you like it, explore it. Same goes for CL. Avoid getting trapped in pat binarisms. I wish you success and fun in your explorations!
It requires a certain mindset to be a good CL programmer (as opposed to a good C programmer). Similarly, to ge a good "purely functional non-strict" language (eg. Clean) programmer it requires a different mindset. For many people the lack of side-effects is intolerable (rightly so, as evidenced by the reactions in this thread). Usually one is forced into passing the state around, and this can become intolerable if designed inappropriately. The monadic-style is to hide the state, say in an abstract datatype (or just by discipline), and provide operators that will sequence actions and pass the state around under the covers. {Aside: for a beautiful use of monadic-style in Caml see the sources for fftw in www.fftw.org}. The monadic style is popular in ML (and its variants), Haskell, etc.. The Clean (www.cs.kun.nl/~clean) approach is a little bit more palatable. It has the notion of uniqueness types whereby you can declare that some object will not be shared by anything else when a function is invoked. Since side-effects are only a problem when sharing is present, this effectively overcomes it, and you get destructive updates in a functional manner. So you can get arrays to behave like arrays. However, this is does not make CL+CLOS! But, good Clean (or Haskell) programmers have done pretty well. For example Clean has its entire IDE written in Clean! A stateful task done well.
So before shooting all the children of Lisp (after all that is what ML, Haskell, Clean, etc. are) it might be worth your effort to take a closer look. If you want to take a look at only one, may I suggest Clean? As somebody else already mentioned, these languages really emphasize strong typing with type inferencing as one of their strong points besides functional style and/or laziness. They also have some neat features like list and array comprehensions. Of course, many of these features could possibly be added to CL via macros and stuff. Have fun!!
Kent M Pitman <pit...@world.std.com> 24 Jul 2000 03:53:43 GMT wrote:
> - What do you think is going on in someone's head when they > "think about" something? That is, do you think it's an excerise > in "functional process" (e.g., side-effect-free decomposition or > some such) or "imperative process" (manipulation of the stateful > stuff you seem to abhor so) or how would you characterize it?
this is a silly question. Do you think deity exist? Do you think they are sexy?
These type of questions belong to metaphysics, classical philosophy, and classical psychology. They are passé in our info age, except that Freudian theories are still used by shrinks to comfort people and shrinking their wallets.
What's _thinking_ anyway? How do you know that my existence isn't just your fancy? (after all, it is in your head.) For these questions, better dig neuroscience and information science for answers.
Furthermore, "functional" and "imperative" describe computation methodologies that we invented. Why do you assume that these notions are applicable (or maps) to how our brain processes? Are you supposing that human thinking has been completely understood or codified? You are forcing a simile. (or "isomorphism" as you say)
(btw, _isomorphism_ is a mathematical term bearing a rigorous definition in an axiomatic context. A lookup in dictionaries indicated that it is used in technical contexts only. (math, biology, chemistry.) Your usage of '_proper_ isomorphism' to endeavor a sense of mathematical mapping between two totally ill-defined and disparate things seems to me stultifying.)
Most of you have thought of the innocent question "how big is the universe", and so have our ancestors. In hindsight, it seems foolish that our ancestors pondered such a question without having taken a course in calculus and learned the ins and outs of bounded and finiteness concepts. In fact, it's quite ridiculous if modern notions of dimensionality are not present in the questioner's mind. But actually it's truly ludicrous if we are ignorant of shapes of space (topology) & non-Euclidean geometries. Frankly, it is a fucking stupid question in additional light of space-time continuum of Relativity. The point here is: what you think as sensible questions are not always good questions.
I would suggest that anyone who are interested in philosophy in general to follow Bertrand Russell's logical positivism school of thought, and ask not big-time metaphysical questions or lore but study logic & linguistics & mathematics: put your foot on solid ground.
having read so many language wars and literatures, i find it trite. The best language, is the one with the most good unyielding mathematical properties. The more interesting question is, the mathematical study of different ideology of such property sets, and possible ISOMORPHISM between them.
In newsgroups, few are educated enough to be aware of such a level of thought. They argue sugar syntaxes, they argue C++ vs Java, they argue my GC vs your GC, they argue high-level vs low level, they argue trivial psychology, they argue sizes, they argue petty arguments blithely and often blindly too.
> - Notwithstanding your answer, do you give any credence to the notion of > mental isomorphism? That is, do you suppose there is value in having > the "shape" of mental conceptions match the "shape" of reality (e.g., > to minimize the computational cost of marshalling and unmarshalling > brain data and/or reality data, depending on which way you're going) > or is that simply an irrelevancy?
I deem it irrelevant because such an observation is not a scientific observation; it has little value in aiding science.
> Likewise, do you see any value in > reasoning in a way that is consistent with the mechanism? > For example, > you could model a coke machine using "statistics" or "functional > expressions", but it seems to me there is more value to modeling it as > a state machine since it is, in fact, such a thing.
(ok, so drinking machines are sate machines. Therefore the so called "human thinking" jams into an excluded middle of functional/imperative?)
> If you choose to > model something in a way that it in fact doesn't work (as pre-Kepler > folk used to model the rotation of the planets in their spirograph-like > curly-orbit way), don't you risk overcomplicate the simple?
Here we are talking about planetary motion, which is a matter of eye-balling paths very well-defined and easily verified under science. You were talking about modeling of human thought -- a not well-defined thingy -- and insisting it "maps" to some ill-defined computational model. (Ockham's razor would cut you to pieces.)
> And so > doesn't it come down to how people think? Not how you wish them to think > but how they in fact think? (Can you cite experiments to show that you > have a clear and uncontroverted theory of how they think such that you > are sure you are not advocating dissonance between our mental models > and our devices for aiding in computation?)
How people think?
No, i don't care how people think, but how they should think according to knowledge. I understand the iffiness of purpose of life, i understand that theory needs corrections, but it is science & theories that we should base our argument or decisions on, not metaphysics, culture, fad, or what you or me think "how people thinks".
You know well how Theories of Relativity changed thinking? Do you know how the existence of irrational numbers changed thinking? Do you know how non-Euclidean geometry changed thinking? Do you know how Godel's theorem changed thinking? Do you know how Penrose Tiles changed thinking? (and so on and on and on.)
It's not "how people think" that matters, but "what do we know about how people think" and "what's the best way to think according to our understanding?". What is the (scientific) value of saying "human thinks more like imperative programing than functional decomposition"? I'm totally flummoxed on how such mapping maps, and fear such observation can only impede progress. As technology pushes us willy-nilly towards a pure information age, untruths and ignorance will become the primary woe among all vices and calamities. Cultivate one untruth, and you'd cause a damage more devastating than mass murder.
> Sometimes, obviously, the > technique for the computation may be well-understood and accepted; but > where it is not, debuggability comes (it seems to me) best when people > have some way of destructuring the problem into intelligible components; > isomorphism between the real world and the computation isn't the only > way to do it, but it doesn't seem to me that one should discount it as > a ridiculous way, either, in the case where programmers want to do it.
I understand your humanitarian approach to things. Of course, mathematics has intrinsic limitations and is of little power in the context of all crannies of human daily affairs. I cannot use formalism to decide whether i should kiss a girl, nor maximize my income by solving an equation. However, science is the ONLY way of real progress. (almost "by definition".) You are not doing computer _science_ if you stray too far from scientific approaches. (for what's worth: what i'm doing here is the science AND art of critical criticizing.)
What is your issue anyway? It is fine if you like Common Lisp better than Scheme, but not fine to litter untruths such as "human nature this or that". It is not really imperative programing that i attack in this thread, but your skunking "humanitarian" droppings.
PS "progress" is defined as betterment of human state in general that i wish neophyte thinkers won't moot a nitpicking.
* Frode Vatvedt Fjeld <fro...@acm.org> | Maybe CL should have included the ability to declare a function as | "functional" (side-effect-free, that is).
Most Lisp compilers include such a mechanism, but the guarantee is even harder to maintain and guarantee than typing, and it should not affect correctness, so nothing is lost by considering this as part of the great optimization problem.
#:Erik -- If this is not what you expected, please alter your expectations.
Christopher Browne wrote: > I suspect that most of those that suggest that OO is in any > way related to FP Just Didn't Get It when they did their two > week module on functional programming.
Polymorphism and inheritance are more important aspects of OO than object identity (encapsulation being further down). These two concepts blend perfectly with FP for those completing their two week module on functional programming. With CLOS, it is highly possible to write functions that return objects, which get garbage collected after a one-time use.
Of course, there are people for whom OO is not OO without their pet feature (e.g., those who say CLOS is not OO because it lacks encapsulation).
Maybe you wanted to say that object identity does not mix with FP, or that you consider object identity the sole defining feature of OO, polymorphism being a mere accident. If it's the latter, maybe it's just the side effect of your preference of imperative programming over both FP and polymorphism.
Xah wrote: > These type of questions belong to metaphysics, classical philosophy, > and classical psychology. They are passé in our info age
Ever heard of cognitive science and cognitive psychology in our info age? Had you studied it a little, you would have understood that the brain does not necessarily solve logically isomorph problems the same way. Your naive fixa idea gets old fast.
Xah <x...@xahlee.org> writes: > Kent M Pitman <pit...@world.std.com> 24 Jul 2000 03:53:43 GMT wrote: > > - What do you think is going on in someone's head when they > > "think about" something? That is, do you think it's an excerise > > in "functional process" (e.g., side-effect-free decomposition or > > some such) or "imperative process" (manipulation of the stateful > > stuff you seem to abhor so) or how would you characterize it?
> this is a silly question.
If I were implementing CORBA and talking about the efficiency of marshalling and unmarshalling data between two processors that shared no address space, it would make a big difference to know whether they used the same representational systems because it would affect the computational overhead significantly--would I have to transform each data item or could I pass stuff essentially "straight through". I think the issue is no less relevant to mental-to-computer links. And just because you can't reliably measure how computations is represented doesn't mean it's not relevant. Far from a silly question, I'd allege, it seems to me a central question. Just my opinion, though. Somehow I anticipate that your mileage will vary.
it is unfortunate that i usually find your (newsgroup) writings to be antithesis of the logical. (same goes for Peter Gabriel's Pattern of Software trash) I wonder if it's merely a manifestation of stylistic clash, or some fundamental world-view incongruity in us, or simply your writings don't shine.
Kent M Pitman <pit...@world.std.com> 25 Jul 2000 07:14:01 GMT wrote:
> If I were implementing CORBA and talking about the efficiency of marshalling > and unmarshalling data between two processors that shared no address space, > it would make a big difference to know whether they used the same > representational systems because it would affect the computational overhead > significantly--would I have to transform each data item or could I pass > stuff essentially "straight through".
Fine example of a computing task that i could imagine.
> I think the issue is no less > relevant to mental-to-computer links.
Where is your support for this opinion? It doesn't really connect to the previous example or address my criticism.
> And just because you can't reliably > measure how computations is represented doesn't mean it's not relevant.
Yeah, but just because you can cite a "just because" doesn't mean it's relevant. I want to see buttresses of your fancy edifice.
> Far from a silly question, I'd allege, it seems to me a central question.
A central pitfall, perhaps. Mumble jumble i insist.
> Just my opinion, though. Somehow I anticipate that your mileage will vary.
* Xah <x...@xahlee.org> | it is unfortunate that i usually find your (newsgroup) writings to | be antithesis of the logical. (same goes for Peter Gabriel's Pattern | of Software trash) I wonder if it's merely a manifestation of | stylistic clash, or some fundamental world-view incongruity in us, | or simply your writings don't shine.
Or it could simply be a consequence of the fact that you're the only sane person in the whole entire universe.
#:Erik -- If this is not what you expected, please alter your expectations.
Duane Rettig wrote: >Why are we talking about bricks and concrete in a lisp newsgroup?
indeed. it's summer and some really should be talking about icecream and its various flavors. time is not ready for architecture yet. -- Zur Einschätzung der aktuellen Situation in Ö http://www.tuwien.ac.at/diskurs/
Erik Naggum wrote: >* Xah <x...@xahlee.org> >| it is unfortunate that i usually find your (newsgroup) writings to >| be antithesis of the logical. (same goes for Peter Gabriel's Pattern >| of Software trash) I wonder if it's merely a manifestation of >| stylistic clash, or some fundamental world-view incongruity in us, >| or simply your writings don't shine.
> Or it could simply be a consequence of the fact that you're the only > sane person in the whole entire universe.
now this *IS* logical to me. (though I still don't understand ~three postmodern words per xah-sentence)
In article <lc8zur8cr8....@balrog.ece.ucsb.edu>, Shiv
<s...@balrog.ece.ucsb.edu> wrote: > Clean? As somebody else already mentioned, these languages really > emphasize strong typing with type inferencing as one of their strong > points besides functional style and/or laziness. They also have some > neat features like list and array comprehensions. Of course, many of > these features could possibly be added to CL via macros and > stuff. Have fun!!
As you might imagine, most of these "features" are available for CL or for subsets of CL. Type inferencing, list comprehensions, etc have been added several times to CL.
Rainer Joswig <rainer.jos...@ision.net> writes: > As you might imagine, most of these "features" are available > for CL or for subsets of CL. Type inferencing, list > comprehensions, etc have been added several times to CL.
> > As you might imagine, most of these "features" are available > > for CL or for subsets of CL. Type inferencing, list > > comprehensions, etc have been added several times to CL.
William Deakin wrote: >Reini Urban wrote: >> (though I still don't understand ~three postmodern words per
>What is a postmodern word?
I cannot tell you exactly now what it is, because I don't understand it, as I said, I can only show you what I mean. First I try it with some examples picked from random sentences:
xah sentence #1: "it is unfortunate that i usually find your (newsgroup) writings to be antithesis of the logical."
xah sentence #2: "(same goes for Peter Gabriel's Pattern of Software trash) I wonder if it's merely a manifestation of stylistic clash, or some fundamental world-view incongruity in us, or simply your writings don't shine."
xah sentence #3: "this is a silly question. Do you think deity exist? Do you think they are sexy?"
pm words in #1: "antithesis of the logical" pm words in #2: "Pattern of Software trash", "world-view incongruity" pm words in #3: deity, exist, sexy
ideology: (Unfortunately I have my own postmodernism ramblings only in german, so) A positivistic approach to postmodernism in computer languages: http://www.wall.org/~larry/pm.html
rationale: I see words taken from new fields and put into an old and closed context. This would not be harmful per se. The problem is that I don't understand the reason to use such words in this context. Is just the word that makes no sense or is the whole sentence? My guess -and that is why I said "postmodern"- that the author wants to hide the fact that he doesn't understand any meaning of our words or sentences, so he tooks "random" but interesting or may-fit words, applies them to our trash of sentences (in his view) to criticize our methods to communicate. This is a interesting deconstructive method but unfortunately only interesting to folks who don't understand the comp.lang.lisp level of communication, and worse for me, completely non understandable from his point of view because I don't know the original context where he took these words from. The criticized words and sentences make perfect sense for me, and the irritations are non-constructive.
Reini Urban wrote: > (though I still don't understand ~three postmodern words per > xah-sentence)
William Deakin <w.dea...@pindar.com> 26 Jul 2000 07:53:27 GMT wrote:
> What is a postmodern word?
C'mon people, there are dictionaries on the web. Look up and savor every word. What's your rush?
my American Heritage dictionary (1995) says: postmodern or post-modern adj. 1. Of or relating to art, architecture, or literature that reacts against earlier modernist principles, as by reintroducing traditional or classical elements of style or by carrying modernist styles or practices to extremes: ³the post-modern mode of tapering the tops of buildings² Jane Holtz Kay
Not until i looked up this word now, i find sense in Larry Wall's outcry: "Perl is a postmodern language".
Larry Wall is at the minimum an _artful_ criminal. One could disregard his damages to the computing world, and enjoy his writings.
Kent Pitman, you still haven't answered my question about what you think of Perl. (could you indulge ME and answer that?) Was Perl, in your opinion, a language based on fine principles?
> William Deakin wrote: > >Reini Urban wrote: > >> (though I still don't understand ~three postmodern words per
> >What is a postmodern word?
[...elided interesting stuff about postmodernism...]
> rationale: > I see words taken from new fields and put into an old and closed > context. This would not be harmful per se. The problem is that I don't > understand the reason to use such words in this context.
Art, or could it be an AI language gigger bug?
>Is just the word that makes no sense or is the whole sentence?
(Wishing he was not going to open up a whole Witgensitian can of worms :) My take on this is that meaning of words in a sentence depends on the the other words in the sentence and the context in which the sentence is used. In this case the word can never `make sense' except in the context of the sentence. Following on from this, to talk about a word making sense or not is senseless -- that is it neither makes sense or not. But hey ho, back to sendmail configuration.
> My guess -and that is why I said "postmodern"- that the author wants > to hide the fact that he doesn't understand any meaning of our words or > sentences, so he tooks "random" but interesting or may-fit words, > applies them to our trash of sentences (in his view) to criticize our > methods to communicate.
Or is generating the text automatically.
> This is a interesting deconstructive method but unfortunately only > interesting to folks who don't understand the comp.lang.lisp level of > communication,
Unless c.l.l is being used in a different way. That is, some kind of conceptual art experiment (this is where you have try and divine some kind of purpose or aesthetic meaning behind the text rather than divining any kind of sense) or some kind of elaborate programming text generation prank (like henley)[1]; And not using c.l.l. as a place to talk about problems and issues with lisp.
> and worse for me, completely non-understandable from his > point of view because I don't know the original context where he took > these words from.
Yup. Unless they are words statistically selected from a dictionary.
Anyway, thanks for your the explaination of postmodernism,
Poor me, in all innocent-ignorance, I always thougt that the only state of any Function(ality) in/or any other whatever-state or function for that matter has to be a *working state*.
As in most cases, if not all, it is *that* state that pays the mortgage.
Maybe it's time to get a Phd. in Programmer-lingo-phylosophy or just go on wasting my time on earning the can of spam for the daily-bread.
cor
-- /*#include<rumor.h> Everything is relative.........even that */ /* If GNU/LINUX has no solution, you'v got the wrong problem */ /* Never install Slackware.........You might learn to use IT */ /* pa3...@amsat.org ICQ:1612519 http://clsnet.dynip.nl */
Reini Urban (rur...@sbox.tu-graz.ac.at) 26 Jul 2000 11:11:38 GMT wrote:
> [postmodern words]... > rationale: > I see words taken from new fields and put into an old and closed > context. This would not be harmful per se. The problem is that I don't > understand the reason to use such words in this context. Is just the > word that makes no sense or is the whole sentence? > My guess -and that is why I said "postmodern"- that the author wants > to hide the fact that he doesn't understand any meaning of our words or > sentences, so he tooks "random" but interesting or may-fit words, > applies them to our trash of sentences (in his view) to criticize our > methods to communicate.
I hope this is honest. Though i doubt it is written without spices. Exactly what you mean by: "that the author wants to hide the fact that he doesn't understand any meaning of our words or sentences"? Which sentence or words or idea do you suppose i didn't understand in Kent's post? Or, perhaps you are referring to Kent's generic thought model or approach that i didn't like?
> This is a interesting deconstructive method but > unfortunately only interesting to folks who don't understand the > comp.lang.lisp level of communication
Do you really suppose that i'm such a dumb ass? Pray-explain in detail. Make a fool of me, or yourself. I'm eager to learn -- that you are a square.
> , and worse for me, completely non > understandable from his point of view because I don't know the original > context where he took these words from. The criticized words and > sentences make perfect sense for me, and the irritations are > non-constructive.
Perhaps i failed in communication to Pitman-alikes. If you just ask, i'd be happy to explain any sentence or intentions or origins or allegories or allusions or recondite wisdom you couldn't grasp. If you ask nicely, i'd be happy to re-write my post (you pick) in a completely flat, no highbrow words, down-to-earth, no figures of speech, dry, 100% content 0% dressing, symbolic-logic manner.
The modern world is full pitiful foolscap wearers in uniform.
Shiv <s...@balrog.ece.ucsb.edu> wrote: >So before shooting all the children of Lisp (after all that is what >ML, Haskell, Clean, etc. are) it might be worth your effort to take a >closer look. If you want to take a look at only one, may I suggest >Clean? As somebody else already mentioned, these languages really >emphasize strong typing with type inferencing as one of their strong >points besides functional style and/or laziness. They also have some >neat features like list and array comprehensions. Of course, many of >these features could possibly be added to CL via macros and >stuff. Have fun!!
I'm not sure if Clean if the best language to get into. The biggest problem with clean is that the source code to the compiler isn't available so if the binaries provided don't work for you, you're out of luck. Plus there is only one implementation of Clean available. Because of this I think ML (for example Ocaml) or Haskell are probably better choices.