Hacker News new | past | comments | ask | show | jobs | submit login
Lisp outside the Box (O'Reilly book) (lisp-book.org)
83 points by RK on July 23, 2009 | hide | past | favorite | 34 comments



This from the publisher that used to have "no lisp books" in their submission guidelines. :)


Any reason for that?


I don't know what the reason was, but you can probably find someone mentioning it by searching the threads referencing the publisher in comp.lang.lisp, from 5-6 years ago.


The reason seems to just be that LISP books generally don't sell well. And it seems to still be in their submission guidelines.

http://oreilly.com/oreilly/author/writeforus_1101.html

"Books on topics that have dismal sales despite quality books being available. (If you're addressing a topic where good books have sold dismally in the past (for instance, LISP, LaTeX, or Web-based training),"


Well, maybe LISP stuff is moving out of the "doesn't sell" category.


I wish he would have included a chapter on the condition system. I've had a hard time wrapping my head around it. Everyone says "It's great, but you have to see it in action."


Maybe it's not too late:

This is very much a draft outline. Both overall breakdown and specific chapter titles are likely to change over the coming months.

In any case, I though the chapter on conditions in PCL was pretty good: http://gigamonkeys.com/book/beyond-exception-handling-condit...


Here is a "style guide" that's been missing.

http://random-state.net/log/3453016738.html

The condition system really does need a treatise on its own, specifically as a generic custom control-flow toolkit. There are hairy bits in the standard wrt to the debugger interface, but the above links clarifies many things.


What I like best about the table of contents is that:

"Hmm, maybe it's time we mentioned Lists"

is chapter 9. Good way to escape the programming urban legend that "In Lisp, lists are the only data structure."


It was Ch12 in Practical Common Lisp.

12. They Called It LISP for a Reason: List Processing - http://gigamonkeys.com/book/they-called-it-lisp-for-a-reason...


Lists are the most ingenious data structures possible; Nature uses them exclusively -- or what do you think DNA or our brain ore molecules are consisting of?

(You don't have 'arrays' or 'hashes' in Nature, and why would you need them? Read on:)

The only difficulty with lists is interconnection with other list elements; Nature uses this heavily, and our brain would not be possible without these inter-connections.

So -- lists as used in our current computer systems may be slow, but they are still the best data structure ever created.


How is DNA not an array? Correct me if I'm wrong, but Lisp lists are linked lists, so elements don't have to be next to each other in memory. On the other hand, DNA is stored and processed from one molecule to the next one physically.


Lists or arrays?

Nature doesn't know arrays. There's no index (which is the only real distinctive between arrays and lists), and the next atom of information can be (physically) more or less distant from the previous one, so: Nature only uses lists.

Think of it: arrays are only used because of faster accessing reasons, otherwise you never would even think of preferring arrays over lists.

Lists are perfect, because they already contain the previous and the after information bit, which is always crucial to us -- we all are enclosed in the time barrier -- and all of other memory alignment and usage, invented by computer scientists, were simply born out of the necessity of speed, and nothing else.

Lists contain the information stored in the simplest possible way, without wasting any bit of information (which would be necessary if you would care about an index).

Interconnection is the real reason why computers never will be able to substitute a human brain -- and this statement (or better: fact) will never grow old...


"the next atom of information can be (physically) more or less distant from the previous one"

Not true, at least with something like DNA. When something like RNA polymerase goes through DNA, it always goes to the physically closest nucleotide. Sure there is a "link" between bases in the form of molecular bonds, but this bond only works between nucleotides right next to each other. No nucleotide can bond to a nucleotide farther away, and have a polymerase follow that bond.

If DNA were a linked list, it would basically be one where every element is adjacent to the next one in memory. The whole point of a linked list is that they don't have to be like that, one element can point to another 4, 12, 32, etc bytes away. That way insertions and deletions are much easier.

DNA works much more like an array. The "index" for a gene is the promoter sequence at its beginning. A protein complex forms there and polymerase runs down sequentially from nucleotide to the next physically closest nucleotide.

Also, why do you say computers will never substitute a brain when linked lists can quite easily represent a neural network?


Computer memory is always aligned in a one-dimensional, (relatively) huge array.

All of artificial intelligence is based on a one-dimensional representation of a 3 dimensional fact (our physical existence).

DNA, our brain, every bit of information in Nature, always, exclusively, uses all 3 physical dimensions present to store its data, so we never will be able to directly compete with Nature in that fact. Because every dimension present has its own role, and how would you represent that in a simple computer memory (leaving out the fact that computer memory is really huge and really slow compared to the memory systems of Nature).

Do you (personally) know anything about how Nature uses all of the 3 dimensions present, to align its data in a really ingenious and unique way? Do you?

Physically near has a special meaning in our human brain, and influences all the bits of information near the stored information.

So, you see, Nature is able to use all of the 3 dimensions of physical reality to represent its data, while computers (and, consequently, all of AI) seems to be condemned to use a 1 dimensional, slow, physically huge, representation...

So, please please, don't directly compare Nature with human investigation -- they are as far from each other as our planet is from sun...

The more you observe Nature (and I really do!), the more you experience yourself really ignorant about the Intelligence hiding behind...


I suggest you download FoldIt (http://fold.it/portal/), it does a pretty good job at modeling the 3d interactions in proteins using your computer, which I'm pretty sure also has that "1 dimensional" memory.

Do you know how nature uses all 3 dimensions to store information, do you even know what you're talking about? DNA, no matter how "ingenious" its structure, ends up just being a series of bases. Each base in DNA will lead to a particular base in the resulting RNA, this is nothing more than a 1-to-1 mapping, a hash. Ever three bases of RNA (a codon) lead to a particular anti-codon which is mapped to an amino acid. Again, nothing complicated conceptually. You use a series of mappings to translate one series of molecules into another. It can be easily done with a computer. It's only complex in nature because it needs to be complex in nature, otherwise it wouldn't work.

And even if 1 dimensional memory is limiting, how long until computers themselves use molecules to read and store data?

Your argument is effectively that of someone in the 19th century saying the flight is impossible because current transportation can only move on land.

Also, electronic systems are much faster than biological ones, compare the speed of an electric signal in a wire to that of a nerve impulse.


In our brain, certain impulses are carried via electricity, so they are as fast as possible (inside their structure). Other, much more complex processes, don't involve electricity directly, but they are still fast enough -- but given their complexity, they are still really fast, relatively speaking, and they need quite no space (more important than everything else...).

Time is not a measure for intelligence. If it were so, humans could be defined as some of the least intelligent beings on our planet (as they need many many years to finally be adults; in fact, we need to learn so many things; most animals are quite ready when they are born -- ask somebody who knows animals).

As for your speculations of human future: are we talking about science or fiction? Although humans are really good in inventing really fantastical future scenes, that has nothing to do with science -- so let's call it fiction for now...


"In our brain, certain impulses are carried via electricity, so they are as fast as possible (inside their structure)"

No, electric impulses in your brain are not carried in the same way as electricity in wires. Please read up on basic neuroscience before you talk about the nervous system. Nerve signals are passed by having one section of a nerve be depolarized (lose polarity, the difference in charge from inside and outside the nerve wall), which causes the next section to depolarize, and so on. Your basic electric wire uses a difference in electric potential, or voltage, between one end and the other, which creates an electromagnetic field that moves electrons.

You completely misunderstood the importance of time. I'm not talking about long-term development (and even then your average human infant of even 6 months is far more intelligent than most animals on Earth). I meant the speed at which the nervous system works as compared to a computer. If you read my previous paragraph, you can see that a computer is still much faster than the human brain. The brain's advantage is the complex networking of all the neurons. Science has already gone a fair way in understanding the brain, we can even decipher signals to let paralyzed people control computers. How much longer until we can start modeling simple brains, and then further?

And as for my speculations, look at what you're doing right now. You, and I, can instantly communicate over a host of different ways even if we are on opposite sides of the Earth. If we wanted to talk face-to-face, we could even see digitized versions of each other in video chat. If we wanted to meet in person, it's only a matter of ours for one of us to go to the other. What do you think people from a hundred years ago would say when you told them such things would be possible?

It may take a while, dozens, hundreds, or even thousands of years, but your speculations of the uniqueness of nature are narrow-minded. You say that modern computers can never match nature because they use 1-dimensional data storage. I've already shown you how such storage can model 3d interactions (it's not about the data, it's about the way it's processed).

Maybe we should call it fiction for now, but remember that the very idea of having a machine calculate an integral, much less solve protein structures, would have been laughable in the past.


Your position: science can imitate (and maybe even surpass) Nature.

My position: science will never ever be able to even come close to Nature (a simple example? Look at the most simple form of live possible: current (so heavily applauded) science has no idea, whatsoever, what even the principle of every live-form is consisting of -- it's called the "soul", BTW).

WWW -- Who Will Win?

;)


What counts as a living form? The definition of life is based entirely on scientific observations of what we currently perceive. Does a virus have a soul? Why or why not? (If you say it doesn't because it's not alive, what are your criteria for life? Science's?)

Remember that it is only a belief of yours' that the soul is at the heart of life. What if an entirely inorganic machine was one day created that could:

1. Maintain its internal state (homeostasis).

2. Harvest and utilize energy (metabolism). Very recently robots have been created that can digest organic matter and convert it to usable energy.

3. Manufacture add-ons for itself (growth).

4. Sense its environment and change behavior accordingly (response to stimuli).

5. Manufacture smaller versions of itself by harvesting and creating the needed materials and assembling them (reproduction).

6. Contain a code that can be modified and that governs its behavior, so that imperfect code can be weeded out or changed to improve (adaptation).

And this machine would be completely autonomous. It wouldn't even need much intelligence since all it essentially does is maintain itself, respond in pre-programmed ways to the environment, and create more of itself. How is this different from life other than it doesn't use life's materials? Would it have a soul?


Fiction again? Are your dreams more real than reality? You're not doing a real favor to science.

Science always has to be concrete and repeatable (as you well know). You already make my head ache, really badly...

Please remember: science can reach only that far, it has real limits, which nobody is able to extend, and which we all need to respect.

P.S: The principle of any life in Nature is called it's soul, which is invisible, and which only lasts as long as the life persists. So, every plant has its (simple) soul, and science until now has no clue whatsoever what even the simplest form of these souls are consisting of -- as they are, in fact, outside of our physical universe...


How do any of those break any limits of science? Please, I'd love to know. Maybe you think I'm talking about Matrix-style robots and have decided that I'm just being silly. I'm not. A simple bot that has the capability of manufacturing more of itself won't be that hard, consider that most modern factories are highly automated.

Oh, as for your soul principle, do you have any concrete evidence, any proof?

Are you actually saying that science has limits because it doesn't conform to your belief system?


So, you say that it would (in theory) be possible, that the human brain could create something more intelligent than itself?

Come on, that's ridiculous.

(Like the evolution theory, which is completely ridiculous, as it says that a less intelligent being can "auto-evovle" into something more intelligent...)

At this point, any discussion is pointless, as we already completely substitute reality with fiction.


Since you:

hardly seem to read my comments

completely misinterpret what you do read

respond by calling everything fiction or ridiculous

and throw around equally baseless claims of your own.

Yes, this is discussion is over.


What a happy end, we finally agree.


That is such a bone-headed analysis, I'm not sure how to respond. If by index, you mean the reference we use to access an element of an array, that is just the physical location of that element in memory with the offset of the array subtracted. (High-level languiges do math under the covers to simplify things for the progammer, but that's basically it.) Lists use the exact same information., except they contain it literally.

Lists are perfect, because they already contain the previous and the after information bit, which is always crucial to us -- we all are enclosed in the time barrier -- and all of other memory alignment and usage, invented by computer scientists, were simply born out of the necessity of speed, and nothing else.

No , they were born because they are much simpler to implement and imagine than linked lists. They continue to be used be used becaue they are faster simpler, and use less space than linked lists.

Nature only uses lists.

No, Nature uses neither lists nor arrays. Atoms, generally are neither fixed in location (as in the case of arrays), nor do they conain the location of their neighbors (as in the case of lists.)

Interconnection is the real reason why computers ne.ver will be able to substitute a human brain -- and this statement (or better: fact) will never grow old...

Simply untrue.

The fact is that both lists and arrays are abstractions really exist outside of computers. One may argue wither whetehr the human brain is or molecules are more organized as a list or an array, but it's a dumb debate.


What about the parts of the (human) brain that are just some wet-wired differential processing grid. Though their phenotype is ultimately prescribed in DNA (granted a list), I wouldn't be surprised to find that many of those "moving parts" are more efficiently approximated/realized by things like 'hashes' (etc) as opposed to lists.

(My apologies if I'm out of my depth here.)


Could you be more specific about what you mean? What exactly is a processing grid and which parts of the brain do you mean?

Not questioning you, just really desperate right now for inspiration.


Ray Kurzweil's book: "The Singularity is Near"

My copy isn't so near, but I think my "intuitions" were informed somewhere in one of his "Reverse Engineering the Human Brain" sections. (Sorry I can't provide a more precise reference.)

His book is well footnoted, and if there are in fact scientific studies reinforcing what I claim to remember him having written, I'm sure they would be documented there.

If you haven't read it, and your looking for some hyper-tech sort of inspiration, I highly recommend it. It is maybe a bit exhaustive for the casual reader, but well worth it considering it's detail and scope.

(And my apologies to RayK if I'm entirely mistaken in my understanding.)


Maybe you have a point I'm missing, but I'd think it was obvious that Nature uses mappings... ;)


So "outside" now means "inside"? Lisp is reviled because it doesn't play nicely with "modern" (read: broken-by-design) technologies like MS-Windows and the WWW stack. Any attempt to make the language more cube-farm-friendly really ought to be called a boxing-in, rather than the opposite.


Calling an FFI tutorial an "attempt to make the language more cube-farm-friendly" is needlessly incendiary. The fact is, there are lots of C wheels out there that don't need reinventing, and calling them from a REPL is useful and mischievous and fun.


From what I've gleaned from the direction of many recent discussions on haskell-cafe, the good FFI support is a huge reason that Haskell is starting to fail to avoid success.


I still love that motto.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: