Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is ECMAScript really a dialect of Lisp?

A friend of mine drew my attention the welcome message of 4th European Lisp Symposium:

... implementation and application of any of the Lisp dialects, including Common Lisp, Scheme, Emacs Lisp, AutoLisp, ISLISP, Dylan, Clojure, ACL2, ECMAScript, ...

and then asked if ECMAScript is really a dialect of Lisp. Can it really be considered so? Why?

Is there a well defined and clear-cut set of criteria to help us detect whether a language is a dialect of Lisp? Or is being a dialect taken in a very loose sense (and in that case can we add Python, Perl, Haskell, etc. to the list of Lisp dialects?)

like image 777
Emre Sevinç Avatar asked Feb 17 '11 14:02

Emre Sevinç


People also ask

Is Javascript based on LISP?

Yes, JavaScript is a Lisp.

What is the best LISP dialect?

At present, the best-known dialects are Common Lisp, Scheme, Racket and Clojure. Lisp became the “pathfinder” for many ideas which found application in the modern programming languages: tree-like structures, dynamic typing, higher-order functions and many others.

What language is ECMAScript written in?

ECMAScript is a general-purpose programming language that is implemented in Javascript and some other languages. It is the scripting language that formed the basis of browser-based Javascript and Node. js.

Is LISP still used in 2021?

Yes, it is, but you have to know where to look. People who use LISP don't tend to shout too loudly about it but there's a handful of examples of a few high-profile startups having used it to great effect over the last 20 years. It is also very popular with small companies in Europe.


2 Answers

Brendan Eich wanted to do a Scheme-like language for Netscape, but reality intervened and he ended up having to make do with something that looked vaguely like C and Java for "normal" people, but which worked like a functional language.

Personally I think it's an unnecessary stretch to call ECMAScript "Lisp", but to each his own. The key thing about a real Lisp seems like the characteristic that data structure notation and code notation are the same, and that's not true about ECMAScript (or Ruby or Python or any other dynamic functional language that's not Lisp).

Caveat: I have no Lisp credentials :-)

like image 60
Pointy Avatar answered Sep 20 '22 01:09

Pointy


It's not. It's got a lot of functional roots, but so do plenty of other non-lisp languages nowadays, as you pointed out.

Lisps have one remaining characteristic that make them lisps, which is that lisp code is written in terms of lisp data structures (homoiconicity). This is what enables lisps powerful macro system, and why it looks so bizzare to non-lispers. A function call is just a list, where the first element in the list is the name of the function.

Since lisp code is just lisp data, it's possible to do some extremely powerful stuff with metaprogramming, that just can't be done in other languages. Many lisps, even modern ones like clojure, are largely implemented in themselves as a set of macros.

like image 42
mblinn Avatar answered Sep 20 '22 01:09

mblinn