作者: Shadaj Laddad , Koushik Sen
关键词:
摘要: Object-oriented programming, functional and metaprogramming each offer a unique axis of abstraction that enables modular code. Macros, common technique for metaprogramming, capture ASTs as quotes to let users manipulate them in the host language. However, macros are often at odds with other programming techniques since they can only process code written call-site cannot analyze behind boundaries such variables methods. Furthermore, generated macro expansion exist compile-time be passed around user Multi-stage treats runtime values address this problem, but introduces cost running compiler when splicing quotes. This forces developers choose between low overhead modularity. What if we could have best both worlds? We introduce fluid quotes, new uses dependent types pass through while ahead-of-time. capabilities by eliminating traditional requirement co-locating parameter expressions call-sites. Fluid not source also associated context ensure correctness. In addition, composed into larger without any demonstrate two specific applications: optimizing data processing pipelines making language integrated queries more flexible.