3 ms·
In my mind there is one killer feature in Lisp, and that is Compile-Time-Computing. You have a macro system that isn't some lameass additional language with se
by cracauer 7y ago
In my mind there is one killer feature in Lisp, and that is Compile-Time-Computing.
You have a macro system that isn't some lameass additional language with severe limitations like the C preprocessor or C++ templates. You have all the language available both at compile time and at run time. You can even use functions you already have (and tested) in both places.
This allows you to leave every single assumption you make during programming in one place. You don't have to splatter uncertainty about what the program is supposed to do into multiple places because you language isn't expressive enough, e.g. you cannot just redefine control structures to express an assumption. That is what leads to "changeable software", not just "readable software".
My writings on the subject:
https://medium.com/@MartinCracauer/a-gentle-introduction-to-compile-time-computing-part-1-d4d96099cea0 https://medium.com/@MartinCracauer/a-gentle-introduction-to-...
https://medium.com/@MartinCracauer/a-gentle-introduction-to-compile-time-computing-part-2-cb0a46f6cfe8 https://medium.com/@MartinCracauer/a-gentle-introduction-to-...
Example - using scientific units attached to literals in source code, but keep them at compile time and don't slow down runtime with unit checking:
https://medium.com/@MartinCracauer/a-gentle-introduction-to-compile-time-computing-part-3-scientific-units-8e41d8a727ca https://medium.com/@MartinCracauer/a-gentle-introduction-to-...
And speaking about early or late (static/dynamic) type checking. If you have compile-time computing you don't have to choose. How silly would it be to make a programming language that can only do one or the other.
https://medium.com/@MartinCracauer/static-type-checking-in-the-programmable-programming-language-lisp-79bb79eb068a https://medium.com/@MartinCracauer/static-type-checking-in-t...
Finally, there is turnaround time during development:
https://hackernoon.com/software-development-at-1-hz-5530bb58fc0e https://hackernoon.com/software-development-at-1-hz-5530bb58...
- benji_is_me 7y agoYou should check out Zig. Here's the part of the documentation concerning compile-time code. https://ziglang.org/documentation/master/#comptime https://ziglang.org/documentation/master/#comptime