by jerf · 17y ago · 0 comments
Given that the only other "problem" in the post is a Hello World post, surely you aren't complaining that the author failed to include a "Hello World" lisp program? Well, here you go:
(print "Hello World")
I do not understand what you're saying at all.(Also, I'm not a lisper. In fact I'm increasingly of the opinion that it represents a wrong direction for the future of programming languages. So this is not a "pro-Lisp bias" thing.)
[1] Im not talking about implementations, obviously, Common lisp, scheme and clojure have their problems, im talking about the general idea of lisp.
As a skilled developer, I certainly prefer this philosophy to the Java philosophy of "If the feature might be abused, leave it out." (Obviously, I simplify that, but there's a lot of truth there.) But I don't think it's the right way to think of languages as we go forth, and I don't think it can scale as we go forward.
Instead of seeing languages in terms of what they permit, I see them in terms of what they deny. In particular, what invariants do they maintain? Now, that might seem an odd way of looking at it, but what it is is support for the next question: What do languages build on top of this invariant?
All the languages that I am currently interested in, and all the ones that I think provide the way forward, maintain invariants that Lisp does not let you maintain, precisely because it gives the Lisp programmer too much power. One obvious example: You can't "mutable lisp" your way into a language that has immutable variables all the time. If the language provides for mutation, even if you program in a strictly immutable subset of the language, your libraries, including your very base libraries that make up the "runtime", are likely to be mutation-based. (Getting around this might be possible but hardly worth it.) Erlang builds a huge runtime around having such pervasive immutability, and while mutable Lisps can borrow large swathes of Erlang's libraries and capabilities, they are incapable of providing a guarantee at the language level that no function you ever call will mutate a value out from underneath you. Erlang is a great example of building on quite a few invariants (read "programmer limitations") and producing things that are harder and/or impossible without them.
Another example: Type system. Lisp certainly lets you layer type systems on top of your language, but without enforcement by the language, there's a barrier as to how much you can take advantage of it. What the ML family does with types is not something you can add to a Lisp and end up with the same thing you get with native language support. You can come close, but there's a final level of integration or loop-closing (don't have a clean word for this concept) that you can not get to.
Smaller example: Haskell's laziness. You can add laziness constructs to a strict language (see also: Python generators), but you can not macro your way to a fully-lazy language starting with a strict one, at least not in any reasonable manner. (This feature excites me much less, but it's another example of something you have to start with.)
When the entire philosophy is about empowerment, you close the doors to a lot of things that can only be obtained by carefully-selected disempowerment of the programmer, most of which are fringe right now, but which I think will become more important over the future. Truly ultimate power only comes from assembler; languages give you their power by restricting the assembler they can generate.
In the single programmer case, especially the mature single programmer case, "more power" may be a great thing, but I think it breaks down pretty quickly as you get more people involved, especially as you get less-than-experts involved, and I think a lot of Lisp's failures to take over the world come from this basic issue, and some second-order effects.
What I want to close with is something I already said: Certainly, if I had to choose between a conventional Java-style B&D language or Lisp, I'd take Lisp. But the interesting action is occurring in the fields dominated by constraining the programmer: parallel programming developments, STM, immutability and/or banning shared memory, and potentially other interesting things that all involve first taking things from programmers, then building on the resulting invariants that things like Lisp or Perl or Ruby make a big point of not constraining you with. (I'm interested in type-safe string manipulations to ban XSS at the type level, for instance.) There are Lisps doing those things, but notice precisely that they have to be built in at the language level; you can't just macro your way to Clojure's STM. (And if that does happen to be how it is implemented, I'd run screaming; STM isn't very useful unless it is a very strong guarantee. And any connection with other JVM libraries will be very hard, too.)
In order to understand what is actually happening in any one part of a Lisp program, I may have to understand most of the rest of the program, if it is written in a particularly complicated way. This is usually never the case in Java.
Lisp will still be one of them, the choice of no invariants that restrict the programmer. It's a viable niche. It just isn't the only niche. I think it's less viable than Lisp advocates think and that this is part of the reason it never has taken off, but here we enter the realm of opinion as there isn't anywhere near enough science to actually know. (Indeed, the whole of idea of "science" sounds weird here because we are so far away from having it at all.)
I also point to foldr's message in this thread. Strong typing has its pros and cons, even when done as nicely as Haskell's typing can be, and personally, I don't think that's ever going to change. Sometimes you're going to want it and sometimes not.
I must have missed the memo explaining why static typing is always better. Can you forward it to me?
Lisp [is] stuck in the past...
You lose a little credibility here for not specifying which lisp you mean. I'll assume you mean Common Lisp because:
- Scheme is in the middle of reinventing itself after the R6RS unpleasantness, and that process could have any number of interesting repercussions.
- Clojure is very young, and already has a good chance of becoming the first mainstream functional programming language. I'll leave the value of that distinction unspecified for now, but it would be interesting.
- Some of the features available to Common Lisp programmers in the past really are impossible to duplicate today, and will probably remain so for the forseeable future. By all accounts, the system-level introspection and debugging capabilities available on Lisp Machines were a real treat to operate. We can reasonably disagree about how useful it might be to have OS, toolchain, editor, and system software all written in the same language and presenting a uniform interface, but I don't see how anyone could claim that ML and Haskell have surpassed Lisp on this point.
Check out the Haskell page on Music and Sound libraries and applications: http://www.haskell.org/haskellwiki/Applications_and_librarie...
That stuff might be useful, especially if you like curses user interfaces.
Compare that to some of the Lisp APPLICATIONS in that area:
OpenMusic: http://recherche.ircam.fr/equipes/repmus/OpenMusic/
PWGL: http://www2.siba.fi/PWGL/pwglconstraints.html
Common Music: http://commonmusic.sourceforge.net/
Symbolic Composer: http://www.symboliccomposer.com/windows/page_screenshots.sht...
Somehow the Lisp programmers haven't gotten the message that Lisp has been surpassed in all respects by Haskell - I wonder why that is. Do you have an idea why Lisp has cool applications and Haskell has curses-based MP3 player frontends?
Also, Common Lisp still has no libraries or coherent community. Every time I ask #lisp about a library for something trivial, the answer is "write it yourself". This is annoying to people that don't want to shave that particular yak.
Haskell's community is nearly the opposite, so I bet in 18 years we will see many more Haskell apps than Common Lisp apps. Unless the community starts being nice to people, and people start sharing code worth sharing, that is.
ML and Haskell have certainly surpassed common lisp in some respects, but to say that they have surpassed all lisps in all respects has got to be some sort of sophistry.
Lisp is a form of syntax (and a few primitives like Eval and quote) that makes it easy to write programs that manipulate programs.
Common Lisp and Lisp 1.5 and Scheme and Clojure all have certain other things in common.
However, they have those things in common because they are generally recognized as being good things to have in a language for the purpose of programmer productivity. In no place is it written in stone that to be a Lisp, it must not use Hindley-Milner type inference.
I think you'll also find that most Lispers are chronic dabblers in programming languages, to say that I'm sticking my head in the sand when I choose to write whatever-it-is in Clojure is insulting.
> there is no good reason for a modern language to lack a powerful type system.
Lisps can and do have powerful type systems - you're confusing dynamic with none at all.
Other than type-safe heterogenous lists(which is only true if you hold static type systems to a much higher standard of type-safety than dynamic type systems), what sorts of things do a type system with type classes, algebraic data types, and higher order functions prevent doing?
> Lisps can and do have powerful type systems - you're confusing dynamic with none at all.
Common Lisp has a powerful object system and dispatch scheme, but it isn't as powerful as Haskell's type system. Type classes provide compile-time multi-methods which can be every bit as dynamic as CLOS's when needed, but which are statically checked as much as is possible. In addition, type classes make it possible to dispatch not just on argument type but also on return type. How do you write a Common Lisp function which polymorphicly converts an integer to whatever type you need? This is admittedly a bit of a weak example, but polymorphic conversions like this can probably be useful(for example, you could use it to implement a somewhat inefficient heterogenous list).
In Haskell(I'm not very familiar with Haskell, but my testing indicates that this would work): class FromInt t where fromInt :: Integer -> t
Haskell also has parameterized types, which aren't as needed in dynamic type systems, but that relative lack of need is only because a dynamic type systems considers a program that calls a method which doesn't work on an object's type at runtime to be type-safe.
In a statically typed language with type classes and sufficiently powerful syntactic macros, it would be possible to conveniently defer to dynamic type checking in way that would type-check statically. The macros are only necessary for the convenience part. Otherwise, you'd have to create a lot of type classes for every type you wanted to use dynamically. With macros, you could just include the creation of the appropriate classes in the form that defines a new type. In fact, it could be built into the language making even macros unnecessary.
I'd love to see some modern SML or Haskell taking over the area of code compiled to binary, plus a constant growth of dynamic languages as well, because they are also cool. But that big revolution may not happen.
http://ecls.sourceforge.net/ecl-in-quake2.jpg
That takes care of the graphics, networking, matrix manipulation and low-latency. What other FUD do you need answered?
You might be able to do a serious graphics or high-performance computing project in Lisp. You will be the first one, and I'll be very interested in how it goes.
ICAD has been written in Lisp and many turbines of several commercial aircrafts have been designed with it.
CDRS was the conceptual design and rendering system, written by Evans & Sutherland in Lisp. Many cars from Ford and Jaguar have been designed with it. It was then taken over by PTC and sold as Pro/Engineer Designer.
Mirai is a 3d graphics tool used for example to create the animations of Gollums's face in Lord of the Rings. Earlier versions of this software have been used for animation films and many computer games, for example by Nintendo to design the 3d worlds. There were other uses of this software, for example the Orca in 'Free Willy' was animated with it.
Here is a screenshot of Mirai: http://lispm.dyndns.org/lisp/pics/Mirai-P5-Paint-Front.jpg
Let us know when there is a similar Haskell app that supports 2d+3d painting, 3d modelling, 3d animation, 3d rendering, 3d motion editing, etc. in a nice application for, say, SGIs or Windows machines - then show how to script it in Haskell at runtime.
(print "Hello World")
The result I expected was: Hello World
The result I got was: "Hello World"
In the language we are using, the "Hello World" program is simply: Hello World
but, this is my anti-Lisp bias thing.Instead of print, try princ.
[1]> (princ "hello world")
hello world
"hello world"
The first unquoted string is the rendered display of the PRINT function, a side-effect. The second quoted string is the result, print returns the string it printed as a result.Try nesting them and see what happens: (princ (princ "hello world"))
You admit to having an anti-lisp bias without knowing anything about lisp. This whole "I hate it because I don't know it" thing is silly and unbecoming of good programmers.