TypeScript has all of these, too.
TypeScript has all of these, too.
Normal TS doesn't expose normal macros or reader macros to the user.
JS runtimes don't have the image introspection ability of CL.
TS types are removed before the JIT and don't actually impact performance (not to mention they encourage polymorphism which is actively BAD for JS performance). CL type hints are use by the compiler to actually speed up the output code (quite dramatically I'd add).
I meant reader macros, by the way: can it do that?
; A comment
(set-macro-character #\% (get-macro-character #\;))
% Also a comment new Function(“…”)
There’s no guarantee that it will be JITed, but then the CL standard is also pretty loose about the semantics of ‘compile’.SET-MACRO-CHARACTER is used to modify what happens when certain characters are found while reading code. In this case, SET-MACRO-CHARACTER is being used to instruct Lisp to start treating % as if it were a semi-colon (i.e. the third line is a comment), thus extending the syntax of Lisp on-the-fly.
The (GET-MACRO-CHARACTER #\;) portion could have been any code at all; GP could have defined % to do anything, such as "treat the remainder of this line as if it were a line of Python code", using calls to a Python implementation, such as cl-python [0].