4 ms·
TypeScript have multiple packages available which adds macros.
by bazoom42 4y ago
TypeScript have multiple packages available which adds macros.
- capableweb 4y agoCare to link some of those? Are they macros as in C-macros or macros as in Lisp-macros? Macros in C-like languages (like JavaScript or TypeScript) tends to be relatively basic text substitution macros, while in lisp they are part of the core language, and you construct macros just like you construct normal code.
- bazoom42 4y agoFor example: https://github.com/GoogleFeud/ts-macros https://github.com/GoogleFeud/ts-macros > while in lisp they are part of the core language The power of the typescript toolchain is that a macro framework like ts-macros can be a package and doesnt have to be part of the core language. If 20% of users want to be able to do something in a Lisp that the built-in macro system doesn't support, they either can try to get the change into the core language, or live without it (or fork it). If it changes, it'll change for everyone using that lisp. But in Typescript, you don't have this restriction, so modifying the language for your own need, becomes a lot easier. Lots of work on Typescript and Javascript is simply done in packages, as it's possible and doesn't impact the core of the language, which everyone shares.
- lispm 4y ago> The power of the typescript toolchain is that a macro framework like ts-macros can be a package and doesnt have to be part of the core language. Lisp can do the same, but macros are so central, that everyone uses it including the core of the language itself and anything written on top. It's not optional, since syntactic meta-programming is one of the core features of Lisp.