Why only C ++ (and the D language) provides the function of variable templates? Are variation patterns good?

Why only C ++ (and D) languages ​​from many programming languages ​​support variable templates?

Is there a BASIC ADVANTAGE for providing this function to the language?

Or does the main complexity and increase in compilation time (due to type checking) make this more likely impractical?

Where do I know that only C ++ (and D) languages ​​support variable templates?

Wikipedia link: https://en.wikipedia.org/wiki/Variadic_template

+4
source share
2 answers

Lisp , , (, Lisp , ++ ). Lisp ++ ( C) ! SBCL ( Common Lisp).

, , D Terra Haskell , , ... , Lisp , , , ; SICP, Lisp Lisp .

( ) homoiconicity: - , - (. , , - , , GEB, ,...). ( ). CAIA J.Pitrat.

(, Linux) ( dlopen dlsym), ( ) C ( ++) -ie C "( ++) DSL, .

++ - () metaprogramming. C ++ ( ) dlopen - . JIT- (, , libgccjit, LLVM, libjit, GNU ..) .


( Lisp) , Lisp ( Lisp) Lisp AST ( S- -s) Lisp. , "" Lisp ++ ( Common Lisp ). , RPCGEN, SWIG, s11n, Lemon ( ) Lisp (, ++ ). , , , .

+10

++ , , ++ : .

type_traits ++ , . Armadillo, C LAPACK, . Armadillo , ++.

+11

Source: https://habr.com/ru/post/1690062/


All Articles