8 ms·
Is Lisp Still Unique? Or at Least Different? (2002)
- bachmeier 8y agoLast update was 16 years ago. I'm not sure this particular page is in any way relevant in 2018. We could have a discussion about the question posed in the title, and I'm sure some might anyway, but we won't learn anything useful from the posted article.
- roenxi 8y agoThe premise of the title is a bit odd, because technically anything a lisp can do assembly language can do. The bar on being able to do 'anything' is so low that many things accidentally become Turing complete. Can lisp programmers still feel smug about using lisp? No, because it never was and never will be productive to feel smug. Is lisp still the best language for expressing a programmers thoughts? Yes, because it has basically no syntax, so any program will be a direct representation of a programmer's mental model for how their program works. No language with syntax will do that, but the average programmer is probably best actively discouraged from utilising this freedom because they probably have flawed mental models of what is going on.
- mamon 8y ago>> because it has basically no syntax, so any program will be a direct representation of a programmer's mental model for how their program works That's actually a problem with Lisp, because every programmer would have different mental model and without some syntax rule imposing at least basic structure most of Lisp programs would be PITA to maintain by the unlucky next programmer. It also seriously limits the scale of teams of Lisp programmers (is that even a thing?), because every one of them will have their own "right way" of doing things.
- deleted 8y ago[deleted]
- taeric 8y agoThis is a criticism that just feels fabricated. Worse, it is all assertion, but no evidence. By and large, what you are doing is going to dictate large parts of your tool chain. And, by and large, most people have not built tool chains in lisp. I would caution against reading any technical meaning into either of those facts.
- guhidalg 8y agoFrom an engineering perspective, you're right, lisp really does give you too much power. From a linguistic perspective, isn't this the same as accents and dialects developing in isolated groups of people? We don't fault Australians for having unique vocabulary and accent, it's just a different way of speaking. Maybe the beauty of lisp is that each person gets to solve problems in the particular way they feel is most obvious, even if it's not universally accepted as being so.
- rowang 8y agoImagine it more like everybody is free to make their own dialect without ever having the need to actually talk that dialect with someone else. And then require that a team all with different dialect start to communicate effectively together.
- erik_seaberg 8y agoThe team should be working in a shared domain-specific language. The good thing about Lisp is that creating a DSL isn't a painful ordeal.
- shagie 8y agoAcross my Java career, I've done raw servlets, struts, Spring, Stripe, and back to Spring. The vast majority of my Java knowledge transferred seamlessly from one environment to another with only minor changes ("oh, that's how its done in Stripe"). I could probably switch to another team that uses something else with a different version of Java and become a contributor within a day or two of getting the environment up and running. If each LISP team is using their own DSL, how much of that LISP knowledge transfers from one shop to another? While the overall structure of the language is the same, how much of the DSL is the same? Is it similarity of Spring to Struts (a few different annotations, all of the data structures are the same)? or is it similarity of Java to C# (different annotations, different data structures, similar syntax, a number of the Patterns shift implementation)?
- 8y ago
- cultus 8y agoI think this criticism of lisp is overblown. It’s never idiomatic to introduce a macro unless you really need one. In the clojure community at least, macros are used pretty sparsely. The base language is is expressive enough.
- pharrington 8y agoMacros are only tangentally related to mamon's point.
- cultus 8y agoReally? Because apart from macros, Lisp has less syntax and little complexity compared to most languages. The issue mamon was talking about is about different programmers using different mental models or features. If macros aren't overused, this isn't nearly as big of a deal as it is for C++ or Scala. I should except common lisp here. That is indeed a complex language. But Clojure and Scheme aren't/
- zeveb 8y agoNo need to except Common Lisp here. I typically find it quite easy to understand other programmers' Common Lisp. It's not a difficult-to-understand language, and neither are macros, properly used (and they are indeed rarely improperly used).
- lispm 8y agoClojure is a different language - it borrows stuff from Lisp, but it can't run any non-trivial Lisp code from the past decades without more or less rewriting it. Even primitive stuff like math operators work differently - because Clojure mostly uses the math stack of the host language.
- pharrington 8y agoYeah. As a branch from rowang's points, humans are primed from birth to grok complex syntax and specifically leverage that syntax to ingest information streams. In programming, this is most clearly illustrated by contrasting Lisp and their ilk with Ruby. General considerations of the languages aside, Ruby's syntax is notoriously complex - yet, the language is famous for being one of, if not the most, easiest to read languages currently in use.
- taeric 8y agoRuby is famous for it's advocates claiming it is the easiest to read language. I have yet to see evidence of said claim. Sadly, I have seen the opposite. I, and most of my team, dread dealing with the Ruby package at work. Notorious for obscure tricks and terrible callback based system, where it is ridiculously easy to mess things up.
- ioquatix 8y agoCan you point to some examples with the properties you suggest make Ruby unreadable?
- taeric 8y agoThis implies I think it is unreadable as an intrinsic property of the language. A claim I do not understand, and I am not making. I could point to dense poetry as an example of hard to read English. Or light prose as examples of the opposite. In reality, I'd likely just be picking examples I like. Largely pivoted in the skill of the writer. Not any intrinsic feature of English. And, ironically, it likely takes training and experience to appreciate either. Programming and writing.
- deleted 8y ago[deleted]
- pharrington 8y agoCan you point to some specific examples with the properties you suggest make Ruby unreadable?
- throwaway613834 8y agoIt's rather jarring to read "Can lisp programmers still feel smug about using lisp? No" followed by "the average programmer is probably best actively discouraged from utilizing this freedom because they probably have flawed mental models".
- drb91 8y agoWhy do you think that syntax has anything to do with expressing mental models? If anything, that would seem to inhibit recognition of similar processes.
- lispm 8y ago> Yes, because it has basically no syntax That's a myth. Lisp has lots of syntax. It just works different from what one might expect. It even has user-level mechanism to implement custom syntax: Macros. Lisp usually has a two-level syntax: s-expressions as a data-level syntax and on top of that Lisp program syntax: function calls, built-in special operators (block, catch, if, let, progn, tagbody, quote, function, ...) and macros (lots of macros). The myth that Lisp has no syntax, comes mostly from computer science education where students learn a very simplified pure Lisp as an educational tool. Telling them Lisp has no syntax, then is the usual trick to get the students of the mental hurdle of a different - Lisp on top of s-expressions - syntax. This Lisp is then just enough to write recursive list processing functions - but has nothing to do with real programming in Lisp. Even slightly more advanced (with respect to Lisp usage) texts like SICP mostly don't use macros for syntactic extension and don't explain them.
- deleted 8y ago[deleted]
- bla2 8y ago(2002)
- dang 8y agoThanks, added.
- shagie 8y agoI'm really curious about the benchmarks used for Java (and C++). List processing being 20x slower than C++? Array access being 7x slower than C++? So yep. A 16 year old benchmark when Java 1.4 was current (Java 5 was 2004 which brought with it a collections rework and a lot of improvements with not everything needing to be synchronized) based on a 20 year old update on something that was written in '91. > Built-in Support for Lists. Java has the Vector type, which allows for sequences of dynamically varying length That's ancient history. > Dynamic Typing. Java attaches run-time type information to instances of the class Object, but not to primitive data elements. However, Java requires a type declaration for every variable. This has some advantages for production code, but has disadvantages for rapid prototyping and evolution of programs. Java does not have a generic/template system that would allow types life Vector<String>, and suffers greatly because of it. Python's object model is the same as Lisp's, but Python does not allow optional type declarations as Lisp does. More ancient history. The Java IDE being compared is BlueJ. Some of those points were valid in '97. Some were interesting in 2002. But languages have changed and Java (1.4 -> Java 8 and beyond), Python (2.1 -> 3.7) and Perl (5.7 -> 5.28.0) have all matured quite a bit since then. And then there's the ideas of functional programming that are seeping into other languages. This article aged worse than the bumperstickers from '85 that's also currently on the front page.
- cechner 8y agodo you have more modern benchmarks that cover the same ground?
- shagie 8y agohttps://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/lisp.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... is the current benchmark site. The article links to http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all http://shootout.alioth.debian.org/gp4/benchmark.php?test=all... (which is a dead link). The earliest wayback machine for the link is https://web.archive.org/web/20060522132352/http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all https://web.archive.org/web/20060522132352/http://shootout.a... which puts Java at 1.7x C's speed and Lisp at 3.3. It does the same toy programs in the current implementation (rather than the 'hash access', 'reverse lines', 'array access' and 'list processing' benchmarks cited in the article) The last 2018 crawl of the link is a 301 to https://benchmarksgame-team.pages.debian.net/benchmarksgame/ https://benchmarksgame-team.pages.debian.net/benchmarksgame/ (the current site). Note that the current site argues against the benchmarks cited on norvig. In https://benchmarksgame-team.pages.debian.net/benchmarksgame/why-measure-toy-benchmark-programs.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... > The best choice of benchmarks to measure performance is real applications… Attempts at running programs that are much simpler than a real application have led to performance pitfalls. Examples include: > Kernels, which are small, key pieces of real applications > Toy programs, which are 100-line programs from beginning programming assignments… > Synthetic benchmarks, which are small, fake programs invented to try to match the profile and behavior of real applications… > All three are discredited today, usually because the compiler writer and architect can conspire to make the computer appear faster on these stand-in programs than on real applications.
- ebzzry 8y agoThe key problem with this article is, that Norvig cherry-picked features of Lisp that are present with the languages that he contrasts it with. So, what happens then is that it will give the impression that Lisp somehow lost its uniqueness, or whatever makes it stand out among the others. The premises were at best, loaded. If we’re going to talk about CL, here are some of the features that still make it unique: - live update of a running program, including (re)definitions of classes, condition handlers, etc. - object system which has multimethods, multiclasses, multidispatch. - it has a debugger and stepper which has complete access to the stack, with unwind protection - it has a very strong, unhygienic macro system. The average programmer does not need a lot of these things because: - the tasks do not demand those features - the programmer doesn’t know them - the programmer doesn’t want to or can’t invest time in them
- nerdponx 8y agoThe main problem I had when learning CL was its standard library that at felt both enormous and strangely deficient in utilities for day-to-day work. CLHS is fine but the definitions can be obtuse, navigation isn't all that easy, and it's just a generally daunting approach to learning a language. There's a big gap between the code you learn in Practical Common Lisp and what you see if you open the source for any popular CL library. It's like Haskell, without the hype. The underlying paradigms aren't that terribly different, but the actual terminology for expressing ideas idiomatically is wildly different, and represents an unusual obstacle.
- edflsafoiewq 8y agoI wish every language had docs like the CLHS.
- qbrass 8y ago>The underlying paradigms aren't that terribly different, but the actual terminology for expressing ideas idiomatically is wildly different, and represents an unusual obstacle. Haskell uses a lot of terminology that's familiar to mathematicians, but unfamiliar to everyone else. CL uses a lot of strange terminology, because it incorporated concepts before their names were standardized and used in other languages. You're left spending a lot of time trying to figure out that a wheel is called a frob or you just end up re-inventing the wheel even though the frob was already in the standard.
- blarg1 8y agoMy favourite thing about lisp is the lists and symbols, it is so nice for representing data because you don't have to declare data structures etc if that makes any sense. No other language I know of that does that.
- thayne 8y agoYes, just like every other language.
- neokantian 8y agoAs I see it, Lisp is a language in (pretty much) pure prefix notation and of which the core data structure is a linked list and in which functions are first-class values. The advantages of the prefix notational purity are manifold, but schools train people in the use of infix/Eulerian notation: f(a+b,g(x,y)) versus (f (+ a b) (g x y)) The problem of notational convention has not been solved since 1958. Other languages painstakingly support infix/Euler, requiring comparatively incredible compiler construction effort. Doing so also removes the manifold advantages of Lisp's notational purity. JSON is much more popular than S-expressions. Therefore, we can assume that nested arraylist/hashtables are more popular than linked lists as the core language data structure. Pretty much every serious language treats functions as first-class values nowadays. So, this is no longer a strategic advantage in Lisp.
- WalterBright 8y ago> incredible compiler construction effort Not really. BYTE magazine, in the 1970s, published the complete source code for a Pascal compiler, including the code generator.
- neokantian 8y agoPascal can undoubtedly be shoehorned into the target of a simple, single-pass LL(1) parser. Doing so comes at a real "flexibility" cost, though. For example, don't try to define your functions in any arbitrary order. It won't fly. As a programmer, you will surely notice the limitations of single-pass LL(1) compilers. Nowadays, infix/Eulerian notations are generally targeted with at least an LALR(1) parser. The notational complexity in languages like C++ (in gcc) and C# generally even exceed what LALR(1) can handle. Apparently, their parsers need to be painstakingly hand-coded. In my book, that is clearly overshoot. Do we really need to create a dependency on languages that even LALR(1) cannot handle? What are you even getting in exchange? Debatable ...
- deleted 8y ago[deleted]
- 8y ago
- mark_l_watson 8y agoI had lunch with Peter around the time he updated this article. I had written two Lisp books for Springer-Verlag about 5-6 years before. I was still using Lisp but I think he had more or less switched to Python although he did write a nice Scheme system in Java around that time. In 2018 I still use Common Lisp for a major personal project (hybrid AI, wrapping deep learning models so they can be used as functional components (just blogged about this yesterday http://markwatson.com/blog/2018/08/19/hybrid-artificial-intelligence-systems.html http://markwatson.com/blog/2018/08/19/hybrid-artificial-inte...). At the end of the day, language matters but libraries, tooling, and platform support matter more.
- tabtab 8y agoI've always been intellectually fascinated by Lisp, but would NOT want to use it in a production (team) environment. It has two problems: First, is that it's too "meta" in that one can shape it to be just about anything they want. This can make it difficult for others to read your code, for they have to know your mind's style. Our typical "office" languages tend to hard-wire idioms, such as control structures (if, while, case, try, etc.) which make it easier for other readers to digest. It may be less parsimonious (more code), but it's overall easier for an outsider to come in and read it. Second is that nested lists are the wrong base structure for humans. Our natural languages are closer to maps or ordered maps (AKA "associative arrays"), not nested lists. I was working with others at the C2.com wiki to form something similar for maps: a meta-heavy map-oriented language. We nicknamed the project "MASP". C2 fell apart, but I have some new ideas for MASP that I may write up one of these days. MASP may never go mainstream because of its heavy meta-ing, but could be great for experimental, hobby, and rush-to-market startup projects. Paul Graham has said Lisp's meta ability gave him an edge in the "stores race". Being first-to-market matters in dot-com-ville more than team-friendly code.
- dang 8y ago> This can make it difficult for others to read your code This is solved simply by making the program have suitable conventions. A good team does that anyway.
- taeric 8y agoI'd actually argue that strict "maps" are the wrong choice. Instead, human learning is much more akin to an alist of data that you periodically garbage collect. Sometimes, having multiple "entries" for a single key makes a ton of sense and you essentially key key->value mappings based on recency and overall capacity of your entire experience, not experience in just a single mapping. For your first point, you seem to be making an assertion with no data. I get the fear. I have never actually seen it play out. Worse, I have never seen it play out that these other languages are easy to just jump into. You can soften the claim to "easier" but you have not established a baseline. Just blindly claiming it would have been harder in lisp.
- 8y ago
- bitwize 8y agoLisp is largely obsolete. Clojure is the truly modern Lisp. It integrates seamleasly with the world's most widely used runtime, its data structures are immutable and persistent by default, vectors and maps are first-class objects alongside lists, and its list data structure is really a tree of vectors. Every C++ developer knows that you should always prefer vectors to linked lists because of how poorly linked lists perform under modern CPU caching hierarchies. Clojure lists are much more suited to modern CPUs than traditional Lisp lists are. Clojure also provides the abstraction of the "conjable", which allows transducers to be abstracted over many different collection types.
- lispm 8y ago> poorly linked lists perform under modern CPU caching hierarchies It's poor practice to have all data structures being dictated by machine architectures. Actually there is very little evidence that a purely vector-based Lisp would be faster. From what I've seen, Clojure programs are not faster than CL programs. Maybe you have numbers which prove otherwise? > Clojure lists are much more suited to modern CPUs than traditional Lisp lists are 'much more'? Evidence?