Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Check out D. It has Turing-Complete templates with specialised static if, static foreach, version, and debug constructs, all as statements and declarations, as well as more general quasiquoting expressions and declarations with mixin (yes, that is the same as Ruby's, Python's or PHP's eval, but at compile-time; in fact you can import() files at compile-time too and write a compiler in user code that compiles those before mixing the result in, all invoked by the D compiler). Add to that CTFE and introspection interfaces, including user-defined Turing-Complete constraints.
I am not super knowledgeable about this, but I think you might find Type Systems as Macros interesting. There is also the in-development language Hackett which uses the approach described in the paper to unify Racket style macros with a Haskell style type system.