Show HN: Computation at Compile-Time now free online
billsix.github.io
billsix.github.io
The book is about augmenting the Gambit Scheme compiler with the code which it is compiling, thus treating the compiler as an interpreter. Testing dominates the compile-time computation, as each procedure in the book is collocated with tests for that procedure. Should any test fail, the library fails to compile, like a type error in a statically-typed language.
ps: is `[|y| (cons x y)]` standard notation in gambit ?
[|y| (cons x y)] turns into (lambda (y) (cons x y))
https://web.archive.org/web/20151012023906/http://mercure.ir...
It's nice to see more investigations going on into the nuances of programming "stages", rather than the usual compile vs interpret dogma.
Another approach which seems similar in spirit is Zig's use of compile-time execution http://ziglang.org
Then at least your tests will be close by the code that they are testing and they won't affect the size of the delivered binary.
I encourage the collocation of tests with procedures in every language, but I personally doubt the efficacy of pound defines.
Assert macros are great, but how can a programmer guarantee that they are ever even invoked?
"mo' tests mo' problems" -Sean 'puff daddy" Combs.