recentpopularlog in


« earlier   
A Gentle Introduction to Multi-stage Programming
Walid Taha

“Multi-stage programming (MSP) is a paradigm for developing generic software that does not pay a runtime penalty for this generality. This is achieved through concise, carefully-designed language extensions that support runtime code generation and program execution. Additionally, type systems for MSP languages are designed to statically ensure that dynamically generated programs are type-safe, and therefore require no type checking after they are generated.

This hands-on tutorial is aimed at the reader interested in learning the basics of MSP practice. The tutorial uses a freely available MSP extension of OCaml called MetaOCaml, and presents a detailed analysis of the issues that arise in staging an interpreter for a small programming language. The tutorial concludes with pointers to various resources that can be used to probe further into related topics.”
PLT  paper  tutorial  MetaOCaml  multi-stage-programming  metaprogramming  OCaml  ML 
2 days ago by elliottcable
stedolan/ppx_stage: Staged metaprogramming in stock OCaml
“`ppx_stage` adds support for staged metaprogramming to OCaml, allowing type-safe generation, splicing and evaluation of bits of OCaml source code. ppx_stage is heavily inspired by MetaOCaml, and can run many of the same programs (albeit with a slightly different syntax for staging).”
multi-stage-programming  metaprogramming  OCaml  ML  library  PPX 
2 days ago by elliottcable
Stream Fusion, to Completeness
“strymonas is a streaming library design for OCaml and Scala that offers support for fast, bulk, in-memory processing. It is developed using the state of the art facilities of Multi-Stage Programming (MSP) for each language. The utmost goal of the library is to offer a streaming API that achieves stream fusion at the highest level without altering the compiler backend. It covers the combination of many interesting (and challenging) combinators. The OCaml flavor, depends on BER MetaOCaml, OCaml’s dialect for MSP.”
multi-stage-programming  metaprogramming  OCaml  ML  PLT  library  MetaOCaml 
2 days ago by elliottcable
Metaprogramming lecture notes by Nada Amin
Metaprogramming is writing programs that manipulate programs, as data or processes. For example,
• an interpreter takes a program as input data and then turns this descrip- tion into a process;
• a compiler takes a program as input data and then produces an equivalent program as output data – translating the description from one language to another.
Metaprogramming is an art, even just to keep all the levels straight. This course gives some recipes for a more principled approach to meta-programming, from art to science.
programming  computer-science  course  lectures  metaprogramming 
7 weeks ago by jonmoore
C++17 constexpr Compile-time Ray Tracer
This is a C++17 ray tracer using constexpr function evaluation to produce the above image entirely at compile-time. Unlike other compile-time ray tracers which use template metaprogramming, this code also works just as well (in fact, thousands of times faster) at run time.
c++  ray  tracer  compiler  programming  metaprogramming  template 
october 2018 by Hwinkler

Copy this bookmark:

to read