>JavaScript has been called "Lisp in C's clothing". What it lacks is macros
No, it lacks a lot of things in comparison, and if it only lacks macros, then it's lacking a lot as well.
Considering, for this case, "Lisp"="Common Lisp", this is what Javascript lacks:
1. Strong typing. CL is very strongly typed. Javascript is very weakly typed. Typescript doesn't fix this 100% because the runtime is still javascript, and thus the running code is weakly typed.
2. Code should be a first class citizen; code can be processed/sliced/diced/handled as easily as data. That is, code is data so most of the functions that apply to data, also apply to code. This doesn't happen in Javascript. Thus in Lisp metaprogramming is very easy and can be applied in many ways, greatly enhancing the power of the language, making it a "programmable programming language."
---------------
I could stop here, because these two above are strong, significant differences enough to tip the balance towards CL. But there's more:
---------------
3. A really good object system. CLOS might be the most advanced OOP system out there.
4. Really good numeric support. Javascript numbers are internally floats. In CL you have a full numeric tower. Complex numbers? check. Arbitrary-length numbers? check.
5. Image-based interactive development
6. A killer exception handling system: The condition-restart system.
7. Speed. CL can execute significantly faster than JS and can approach C/Fortran speeds if needed (by using tricks.)
8. Optional static type checks, and type declarations for increased performance if needed.
9. In javascript, you code so you define what happens at runtime. In CL, you can define when is your code going to be run: "at read time" versus "at compile time" versus "at runtime". So there are three "times" you can leverage!!
I can only agree that Common Lisp is in many ways a much better language than JavaScript. But JavaScript is much more popular and it has evolved into a lisp direction, EcmaScript 6 has "arrow functions" which are basically lambdas.
One question, you say "CL is very strongly typed". Then you also say "Optional type checks". Are you saying CL is optionally very strongly typed?
>One question, you say "CL is very strongly typed". Then you also say "Optional type checks". Are you saying CL is optionally very strongly typed?
Note that I wrote "optional static type checks".
CL is always strongly typed. A character array, for example, stays as a character array. It can't be used directly in place of a byte array, for example.
But what it allows, optionally, are type declarations. These, in implementations like SBCL, allow compile-time ("static") type checking.
The declarations also allow big enhancements in code speed, because this produces code that is specific to a data type (you can always see the compiled assembly code for a lisp function by using the "disassemble" function)
No, it lacks a lot of things in comparison, and if it only lacks macros, then it's lacking a lot as well.
Considering, for this case, "Lisp"="Common Lisp", this is what Javascript lacks:
1. Strong typing. CL is very strongly typed. Javascript is very weakly typed. Typescript doesn't fix this 100% because the runtime is still javascript, and thus the running code is weakly typed.
2. Code should be a first class citizen; code can be processed/sliced/diced/handled as easily as data. That is, code is data so most of the functions that apply to data, also apply to code. This doesn't happen in Javascript. Thus in Lisp metaprogramming is very easy and can be applied in many ways, greatly enhancing the power of the language, making it a "programmable programming language."
---------------
I could stop here, because these two above are strong, significant differences enough to tip the balance towards CL. But there's more:
---------------
3. A really good object system. CLOS might be the most advanced OOP system out there.
4. Really good numeric support. Javascript numbers are internally floats. In CL you have a full numeric tower. Complex numbers? check. Arbitrary-length numbers? check.
5. Image-based interactive development
6. A killer exception handling system: The condition-restart system.
7. Speed. CL can execute significantly faster than JS and can approach C/Fortran speeds if needed (by using tricks.)
8. Optional static type checks, and type declarations for increased performance if needed.
9. In javascript, you code so you define what happens at runtime. In CL, you can define when is your code going to be run: "at read time" versus "at compile time" versus "at runtime". So there are three "times" you can leverage!!
There are even more differences, to be honest.