[Meta] Lightweight Modular Staging library for D Language
Dmitry Olshansky
dmitry.olsh at gmail.com
Sat May 9 15:57:26 UTC 2020
Hi, folks
Hope you are all safe at home with that virus outbreak
world-wide. And it's good to be back.
Being forced to lock down has it's ups and down. For one good
aspect - I have found the time to re-implement and then
(finally!) understand the beautiful meta programming technique
called Lightweight Modular Staging by Martin Odersky et al.
In a nutshell - late binding + staged computation == DI
Framework. Which means that if you ever used DI framework you
have worked and understood the basics of staged computation.
Now if we add expression templates (or rather compile-time
polymorphic expression trees) to the mix we what Martin calls
Lightweight Modular Staging. I'm not sure where the modular part
comes in but it's surely lightweight and powerful!
So without further ado, I'm announcing the v1 of DLMS (LMS for D)
library:
Code:
https://github.com/glow-stack/dlms
DUB:
https://code.dlang.org/packages/dlms
There a few things that somehow fail at CTFE, I'll look into the
workaround options, seems easy to fix though - the library is
single ~350 LOC 0-deps D file.
I think it's feature complete for the time being I might expand
it as I move on to build the v2 of Pry parser generator using
this LMS library as the backbone in particular exploiting the
partial evaluation capabilities.
Have fun and stay safe!
--
Dmitry Olshansky
More information about the Digitalmars-d-announce
mailing list