4 ms·
One practical advantage is language features can be freely added/used without requiring/waiting for users to update their platforms to a new version. - F# impl
by Leftium 3y ago
One practical advantage is language features can be freely added/used without requiring/waiting for users to update their platforms to a new version.
- F# implemented futures (promises) in F#. So any F# platform could immediately start using futures without having to upgrade the language runtime. I think C# and JS were able to polyfill promises, but the simpler async/await syntax could not be polyfilled. (It might be possible with transpilers like Babel.)
- In a similar fashion, some JS features were implemented as polyfills to support browsers that lacked support.
As others comments have mentioned, the big take-away from "Lisp can be written in Lisp" is the concept that data and code are the same. Code modifies data. Code is just data, so code can be used to generate new code.
One of the practical applications is you can write a domain-specific language (DSL). Not only can you write "Lisp in Lisp," you can also write specialized languages made to perfectly handle your use case.
I believe Paul Graham made a DSL for e-commerce sites which helped him stay ahead of the competition:
1. His DSL was at least one level of abstraction higher than what everyone else was dealing with.
2. Lisp's recursive/tree structure was a good match with the structure of HTML documents.
Of course, functional programming is just a way of thinking; it can be implemented in non-functional languages; FP languages just make it easier.
I forgot where I learned all this, but this article seems to explain in more detail: https://hw.leftium.com/#/item/606619 https://hw.leftium.com/#/item/606619