0

There are Clojure, Scheme, etc. which are dialects of LISP, you can find a lot more at this SO question on which dialect is the best.

My question is pretty basic - what is a LISP dialect? Languages like C, C++, Java, JavaScript, PHP share similar syntax, but are different languages. Poeple don't call them different dialects of ALGOL. So why do people call these dialects of LISP? What does that actualy mean?

Community
  • 1
  • 1
ducin
  • 25,621
  • 41
  • 157
  • 256
  • Off topic, because mostly opinion-based. Please 'focus on questions about an actual problem you have faced. Include details about what you have tried and exactly what you are trying to do.' 'Avoid questions that are primarily opinion-based, or that are likely to generate discussion rather than answers.' – Rainer Joswig Oct 10 '16 at 14:41
  • I've heard of Masovian, Greater Polish, etc, which are dialects of Polish. What is a Polish dialect actually? Is it a subset or superset of Polish grammar, or just a very specific way to use the language? – molbdnilo Oct 10 '16 at 20:38
  • @RainerJoswig agree it's not a problem I've faced, no doubts. But disagree answer will have to be opinion-based. If people use the *Lisp dialect* term, then it does have a meaning. The same way you could ban many existing questions. – ducin Oct 11 '16 at 00:47
  • @RainerJoswig you can also close all questions like theseL http://stackoverflow.com/questions/20303351/which-javascript-library-should-i-start-with or http://stackoverflow.com/questions/5125431/how-to-start-programming-in-windows – ducin Oct 11 '16 at 00:52
  • @ducin: See http://stackoverflow.com/tour for a quick overview about good questions on Stackoverflow, One of the questions you linked to, has already been closed, because being opinion-based. *If people use the Lisp dialect term, then it does have a meaning.*. The term has different meanings for different people and discussions about it are going on for decades. Definitely opinion based. Let's focus on real practical problems, here on Stackoverflow. – Rainer Joswig Oct 11 '16 at 08:12

2 Answers2

2

I suggest that you start with the wiki, which says

In the Lisp world, most languages that use basic S-expression syntax and Lisp-like semantics are considered Lisp dialects, although they vary wildly, as do, say, Racket and Clojure.

I would say that a dialect of Lisp must subscribe to the most fundamental Lisp idea, specifically, easy tasks should be easy, hard tasks should be possible.

This often implies that the language should be extensible, IOW, it should grow to meet your needs. This hints in the direction of macros which allow one to extend the language syntax. This, in turn, requires that the original syntax should be relatively simple, IOW, probably, Sexp-based.

So, to me, the hallmarks of a Lisp dialect are

  • a powerful macro facility (IOW, the full language is available for code transformation at compile time) and
  • a simple syntax.

PS. Note that, according to some, Scheme is a dialect of Algol, so this is not a rigorous notion.

sds
  • 58,617
  • 29
  • 161
  • 278
2

There are just a few syntaxes around. We have Algol which coveres almost all the programming languages like SQL, Python, Pascal, PHP, and JavaScript. Some might say most of these are C, or B and they are right since these were the first to replace the typical begin with {. Looking at your profile you know mostly algol dialects and when you learned the last one it probably was simple since you already knew much from the knowledge of their sibling languages. You didn't learn a new language but a variant of one you already knew.

Lisp came in the late 50s and it had symbols and lists. It's syntax was not based on Fortran, that was the language of choice at the time. The original paper expressed eval using a few primitives. You can read about this in Paul Grahams excellent essay. If you know one dialect it's as easy to learn another in the same manner as with algol dialects. Trying to learn a lisp dialect by assimilating algol was very frustrating for me so I know this by experience.

Wikipedia has an excellent programming language tree you can browse. Like in natural language you have crazy languages like Finish that is not where to be found on the indieuropean language tree. You have such islands in programming languages as well. Lisp and Algol are truely different worlds even with some influenced over the decades.

As to the answer of what is needed for it to be a lisp dialect it's a little hazy, but I would include all languages that has one of these features:

  1. Fully parenthesized polish prefix notation. (S-expressions)

  2. cons,car,cdr and a symbol type with functions being first class citizens. eg. you can create mapcar (map in scheme)

Of course a undeniable lisp dialect would have both of these, but I would consider every language that only has one as lisp as well.

Sassy is intel assembly with better (lisp) syntax. It can perhaps expand macros and use the features of Scheme so it's a lisp but its restricted so not all would see it as a lisp dialect.

The creator of JavaScript, Brendan Eich, originally wanted to make a Scheme dialect. JavaScript is very close to be a Lisp but I still don't consider it a lisp since it has neither of my lisp feature sets. If they had made a singly linked lists a part of the spec I would have considered calling it a Lisp dialect with very bad looking syntax. Other people might include JS as a lisp.

Sylwester
  • 47,942
  • 4
  • 47
  • 79