Lisp is King

Started by
325 comments, last by bishop_pass 20 years, 6 months ago
(setf fruits '(apples oranges pears bananas))

I created a variable called fruits, and assigned it the value that is the list (apples oranges pears bananas). Each of the elements in the list are symbols and can be assigned anything that you want to them. In other words, I could assign the number 12 to apples, or I could assign a list to apples if I wanted.

I can retrieve the spelling (the string) of each symbol above if I wanted. For example, if I wanted to know the characters contained in the name of the variable fruit, I could get that. I can print the name of the variable, or what the variable has been assigned.

The list (apples oranges pears bananas) is not just a linked list, it is a list of cons cells, meaning I could insert items midway into the list that are lists themselves.

If I ever reassign something different to fruits, then the list (apples oranges pears bananas) automatically gets deallocated, unless some other variable was assigned to it as well.

All the symbols within the list would also get deallocated, except for any symbols which in turn are assigned a value.

EDIT: One more thing: if you choose to represent a term such as 'bananas' with a string using C or C++, you'll have to make sure you never refer to it again using the string, because in C or C++, that would actually duplicate the existence of that string. So, you'll have to refer to it by creating a variable, such as 'banana'. But if you do that, make sure that you also store the name of the variable in a string, so you can access it.

[edited by - bishop_pass on March 7, 2003 9:31:03 PM]
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
Advertisement
WOW
quote:Original post by bishop_pass
Out of Control discusses Karl Sims'' program. In another thread, I mentioned the significance of this, and here''s what I believe it is: Each of the works created by Sims'' program have a unique style. Traditional languages tend to produce work which is undeniably stamped with a fixed style that doesn''t seem to change. Yes, we change the parameters, and the output changes, but in the end, it bores us, because we can see it''s very monotone with respect to its style.

Like I was saying above (a quote of myself) Lisp allows the underlying functionality of the program to change at runtime, not just a parameter set. I said that if you can only change the parameter set, you tend to get programs which get brittle and their work is immediately identifiable due to their content being stamped which says that the program can only progress so far before exhausting its output.

The images of Karl Sims'' program (some of you have probably seen them before from another thread) show how a Lisp program which adds to its core program code at runtime can escape this quandry. Note how none of the images suffer from looking like they were output by the same program.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
quote:
I created a variable called fruits, and assigned it the value that is the list (apples oranges pears bananas).


Doing this in C would involve creating some sort of symbol table and related functions to manage it. Not fun.

The real question is: Given some problem, will implementing a solution in Lisp be better than C more often than not?


Anyway, go write a complete modern operating system in Lisp. Have fun.


----
Bart
----Bart
Ok I just did it now what?
quote:Original post by trzy
Doing this in C would involve creating some sort of symbol table and related functions to manage it. Not fun.

Yeah. Not only that, when you''re done, you will have created a half-baked Lisp implementation, and using it effectively will require you to code in Lisp, rather than in C, for it will never look as good in C.
quote:Original post by trzy
The real question is: Given some problem, will implementing a solution in Lisp be better than C more often than not?

Wrong. The real question is: do most problems go away when you move from a language like C to Lisp?
quote:Original post by trzy
Anyway, go write a complete modern operating system in Lisp. Have fun.

That''s what C is for. You miss the point completely. Operating systems are not built frequently. You don''t build a road system and a set of vehicles to traverse that road system with the tools you wish to deploy into society. Rather, you do what you have to do to get the transportation system into place with the best tools for the job, and then you get on with letting society function.

Once society is functioning, it has the tools necessary to build the infrastructure to build better road systems. Once an operating system is in place, a system such as Lisp can be used to build better tools for refining and advancing the state of computing. For example, Lisp is about as powerful as you can get for building tools (such as compilers) to further advance the state of operating systems.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
quote:Original post by The Reindeer Effect
Ok I just did it now what?

You just did what? You created a C/C++ equivalent? Let''s see it.

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
quote:
it effectively will require you to code in Lisp, rather than in C, for it will never look as good in C.


You wouldn''t be blinded by parentheses in C

quote:
Original post by trzy
The real question is: Given some problem, will implementing a solution in Lisp be better than C more often than not?

Wrong. The real question is: do most problems go away when you move from a language like C to Lisp?


When I said "implementing a solution", that implied the problem has been solved. The question is therefore which language (Lisp or C) is better at it. Merely making the problem go away isn''t the issue, because you can probably do it in both.

Of course, "which is better" isn''t an appropriate question in itself. It all depends on the problem.

Would Lisp be suitable for most of what is being done in C right now, whatever that may be?

One of the complaints about Lisp is that it isn''t a practical language for large projects, even if it is a very interesting way to approach problems.

quote:
That''s what C is for. You miss the point completely.


Lisp and C are for different things, that''s the point I made, and what you said as well.

Perhaps a better request would have been: Write a high-performance real-time 3D engine in Lisp.

Lisp doesn''t seem too interesting for the things I''m playing with now: 3D graphics and compilers.

Arguably, Lisp could be handy for programs which need to process data such as BSP trees, etc. For sophisticated compilers, I''m not sure Lisp would be helpful.

By chance, I''ve been looking at ML, and supposedly it''s pretty good for programs which rely on complex data structures. What I would really find handy for writing programs to manipulate lots of complex data structures is a language that makes creating, manipulating, and managing data structures very easy.

I don''t see Lisp as being too practical for this in itself, but I''m sure some of its ideas could be carried over to some better high-level language.


quote:
For example, Lisp is about as powerful as you can get for building tools (such as compilers) to further advance the state of operating systems.


I think what has to be identified is what sorts of programs are most needed to advance the state of an operating system or operating "environment" (basically, the user''s experience of the computer itself – the OS should only do basic resource management with policy being handled by a standard package of applications, IMHO) and what language would best facilitate their development.

I suspect these would be a lot of "boring" applications which is why they aren''t as interesting to discuss: Word processors, web browsers, database tools, etc.

I think I''m kind of clueless when it comes to what a typical user really wants. The programs I most frequently use (which could be considered "programs for average users") are Mozilla, Eudora, WordPerfect, Winamp, a P2P program, and an image viewer.

The other programs I use are irrelevant to the majority of PC users: lots of development tools, emulators, and some old games.

Because I like to write programs and learn about things that interest me, I feel that I can''t say much about what the average user needs and what sorts of OS applications are most in demand.


—-
Bart
----Bart
Okay, I dled LispWorks Personal edition. NOW POINT TO GOOD TUTORIALS!

~Happy Days, American without money
quote:Original post by RedSweater
Okay, I dled LispWorks Personal edition. NOW POINT TO GOOD TUTORIALS!

~Happy Days, American without money


My profile is full of Lisp-related threads
More specifically, What is so great about Lisp? is _FULL_ of lisp-related links, including full books on Lisp.

[edited by - Extrarius on March 7, 2003 12:58:32 AM]
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

This topic is closed to new replies.

Advertisement