<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://lambda-the-ultimate.org">
<channel>
 <title>Lambda the Ultimate - Meta-Programming</title>
 <link>http://lambda-the-ultimate.org/taxonomy/term/15/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>Hardware Design and Functional Programming: a Perfect Match</title>
 <link>http://lambda-the-ultimate.org/node/2880</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.jucs.org/jucs_11_7/hardware_design_and_functional/jucs_11_7_1135_1158_sheeran.pdf&quot;&gt;Hardware Design and Functional Programming: a Perfect Match&lt;/a&gt; by Mary Sheeran, Journal of Universal Computer Science, Special issue devoted to the Brazilian Symposium on Programming Languages, 2005.&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
This is a slightly odd paper that explains why I am still as fascinated by the combination of functional programming and hardware design as I have ever been. It includes some looking back over my own research and that of others, and contains 60 references. It explains what kinds of research I am doing now, and why, and also presents some neat new results about parallel prefix circuits. It ends by posing lots of hard questions that we need to answer if we are to be able to design and verify circuits successfully in the future.
&lt;/p&gt;&lt;/blockquote&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <pubDate>Sun, 29 Jun 2008 13:29:36 -0400</pubDate>
</item>
<item>
 <title>COLA Brainfuck</title>
 <link>http://lambda-the-ultimate.org/node/2796</link>
 <description>&lt;p &gt;From the &lt;a href=&quot;http://www.swa.hpi.uni-potsdam.de/index.html&quot;&gt;Software Architecture Group&lt;/a&gt; at the Hasso Plattner Institut:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Our &lt;a href=&quot;http://www.swa.hpi.uni-potsdam.de/tutorials/cola/index.html&quot;&gt;tutorial&lt;/a&gt; on COLA provides insight on how programming languages can be implemented using the combined abstractions and an implementation of parsing expression grammars in COLA. The &quot;esoteric&quot; programming language brainfuck was chosen for its simplicity, which allows for concentrating on COLA&#039;s features.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Previously: &lt;a href=&quot;http://lambda-the-ultimate.org/node/2483&quot;&gt;COLA and Open, extensible object models&lt;/a&gt;; via &lt;a href=&quot;http://del.icio.us/neuraxon77&quot;&gt;neuraxon77&lt;/a&gt;.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/24">DSL</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/8">Implementation</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <pubDate>Thu, 01 May 2008 03:58:14 -0400</pubDate>
</item>
<item>
 <title>Scheme macro systems</title>
 <link>http://lambda-the-ultimate.org/node/2753</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://lists.gnu.org/archive/html/chicken-users/2008-04/msg00013.html&quot;&gt;[Chicken-users] macro systems and chicken (long)&lt;/a&gt;, Alex Shinn, Apr 2008.&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
There seems to be a lot of confusion in the Chicken&lt;br &gt;
community, and the Lisp community in general, about the&lt;br &gt;
different macro systems, so I thought provide some&lt;br &gt;
background information and discussion of the eggs available&lt;br &gt;
in Chicken and their uses.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;A very nice post that provides a historical overview and implementations of a hygienic &lt;code &gt;(swap! a b)&lt;/code&gt; macro in different macro systems: syntactic closures, reverse syntactic closures, explicit renaming, syntax-case, and syntax-rules.&lt;/p&gt;
&lt;p &gt;I didn&#039;t know &lt;a href=&quot;http://citeseer.ist.psu.edu/bawden88syntactic.html&quot;&gt;syntactic closures&lt;/a&gt; before, and find their interface and implementation simple and easy to understand.  Any reasons why they aren&#039;t used more in Scheme?&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/7">History</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <pubDate>Sun, 06 Apr 2008 22:47:28 -0400</pubDate>
</item>
<item>
 <title>Applied Metamodelling: A Foundation for Language Driven Development</title>
 <link>http://lambda-the-ultimate.org/node/2711</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.ceteva.com/book.html&quot;&gt;Applied Metamodelling: A Foundation for Language Driven Development&lt;/a&gt; (2004)&lt;br &gt;
by Tony Clark, Paul Sammut, James Willans&lt;/p&gt;
&lt;p &gt;An excerpt: &lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Language-driven development is fundamentally based on the ability to rapidly design new languages and tools in a unified and interoperable manner. We argue that existing technologies do not provide this capability, but a language engineering approach based on metamodelling can. The detailed study of metamodelling and how it can realise the Language-Driven Development vision will form the focus for the remainder of this book.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;In software engineering circles the term &quot;language driven development&quot; is synonymous with &quot;language oriented programming&quot;, a term which LtU members are more familiar with (thanks to Martin Ward&#039;s article &lt;a href=&quot;http://www.cse.dmu.ac.uk/~mward/martin/papers/middle-out-t.pdf&quot;&gt;Language Oriented Programming&lt;/a&gt; which first appeared in 1994, and then Martin Fowler&#039;s essays on the topic). The book hasn&#039;t appeared on the radar here on LtU, despite &lt;a href=&quot;http://scholar.google.ca/scholar?hl=en&amp;amp;lr=&amp;amp;cites=13735337140062296561&quot;&gt;41 citations&lt;/a&gt;. I suspect this is due in part to only &lt;a href=&quot;http://citeseer.ist.psu.edu/736058.html&quot;&gt;one citation at Citeseer&lt;/a&gt;, and the lack of cross-talk between computer scientists and software engineers.&lt;/p&gt;
&lt;p &gt;There are a lot of similarities between the &lt;a href=&quot;http://www.ceteva.com/xmf.html&quot;&gt;XMF language&lt;/a&gt; (&lt;a href=&quot;http://lambda-the-ultimate.org/node/2686&quot;&gt;discussion at LtU&lt;/a&gt;) and that of the &lt;a href=&quot;http://www.chrisseaton.com/katahdin/&quot;&gt;Katahdin language&lt;/a&gt; (&lt;a href=&quot;http://lambda-the-ultimate.org/node/2303&quot;&gt;discussion at LtU&lt;/a&gt;). Other related discussions here at LtU, include &lt;a href=&quot;http://lambda-the-ultimate.org/node/815&quot;&gt;Language Workbenches: The Killer App for DSLs&lt;/a&gt; - about the essay by Martin Fowler, &lt;a href=&quot;http://lambda-the-ultimate.org/node/1851&quot;&gt;Ralph Johnson: Language workbenches&lt;/a&gt; - a response to Fowler&#039;s essay, &lt;a href=&quot;http://lambda-the-ultimate.org/node/577&quot;&gt;XActium - Lightweight Language Engineering?&lt;/a&gt; - which discusses an essay about a previous version of XMF, &lt;a href=&quot;http://lambda-the-ultimate.org/node/1690&quot;&gt;Generating Interpreters?&lt;/a&gt; , &lt;a href=&quot;http://lambda-the-ultimate.org/node/377&quot;&gt;Language Oriented Programming&lt;/a&gt; - discusses an essay by Jetbrain&#039;s Sergey Dmitriev, &lt;a href=&quot;http://lambda-the-ultimate.org/node/1693&quot;&gt;&quot;Language Oriented Programming&quot; Meta Programming System&lt;/a&gt; - discussion of the Jetbrain MPS system, &lt;a href=&quot;http://lambda-the-ultimate.org/node/46&quot;&gt;The DSL, MDA, UML thing again...&lt;/a&gt; - an older discussion on the relationship between DSLs and MDA. &lt;/p&gt;
&lt;p &gt;(Disclaimer: Some may notice that I am mentioned on the XMF web site, but this is just because I subjected their XMF language to a number of grueling challenges which they passed with flying colors: see the &lt;a href=&quot;http://www.ceteva.com/XMF/&quot;&gt;language snippets&lt;/a&gt; in the documentation. I have no affiliation with their company.) &lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/24">DSL</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/17">Software Engineering</category>
 <pubDate>Fri, 07 Mar 2008 14:07:33 -0500</pubDate>
</item>
<item>
 <title>Closing the Stage: From Staged Code to Typed Closures</title>
 <link>http://lambda-the-ultimate.org/node/2575</link>
 <description>&lt;p &gt;Yukiyoshi Kameyama, Oleg Kiselyov, Chung-chieh Shan. &lt;a href=&quot;http://okmij.org/ftp/Computation/staging/metafx.pdf&quot;&gt;Closing the Stage: From Staged Code to Typed Closures&lt;/a&gt;. PEPM&#039;08. (&lt;a href=&quot;http://okmij.org/ftp/Computation/staging/paper-examples.ml&quot;&gt;code&lt;/a&gt;)&lt;br &gt;
&lt;blockquote &gt;&lt;p &gt;
Code generation lets us write well-abstracted programs without performance penalty. Writing a correct code generator is easier than building a full-scale compiler but still hard. Typed multistage languages such as MetaOCaml help in two ways: they provide simple annotations to express code generation, and they assure that the generated code is well-typed and well-scoped.  Unfortunately, the assurance only holds without side effects such as state and control. Without effects, generators often have to be written in a continuation-passing or monadic style that has proved inconvenient. It is thus a pressing open problem to combine effects with staging  in a sound type system.
&lt;p &gt;
This paper takes a first step towards solving the problem, by translating the staging away. Our source language models MetaOCaml restricted to one future stage. It is a call-by-value language, with a sound type system and a small-step operational semantics, that supports building open code, running closed code, cross-stage persistence, and non-termination effects. We translate each typing derivation from this source language to the unstaged System F with constants. Our translation represents future-stage code using closures, yet preserves the typing, alpha-equivalence (hygiene), and (we conjecture) termination and evaluation order of the staged program...&lt;/blockquote&gt;
&lt;p &gt;
Essentially, representation of staged programs in an unstaged language turns out to be related to typechecking/typed compilation: typechecking is a stage. While this basic idea is straightforward, the work presented in the paper is rather intricate and depends on previous work on typed compilation. Oleg will be able to put this work in context in the forum, hopefully.&lt;br &gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Sun, 16 Dec 2007 22:17:29 -0500</pubDate>
</item>
<item>
 <title>Inductive Synthesis of Functional Programs: An Explanation Based Generalization Approach</title>
 <link>http://lambda-the-ultimate.org/node/2541</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://jmlr.csail.mit.edu/papers/v7/kitzelmann06a.html&quot;&gt;Inductive Synthesis of Functional Programs: An Explanation Based Generalization Approach&lt;/a&gt;&lt;br &gt;
Emanuel Kitzelmann, Ute Schmid; &lt;a href=&quot;http://jmlr.org/&quot;&gt;JMLR&lt;/a&gt; Volume 7(Feb), 2006.&lt;/p&gt;

&lt;blockquote &gt;We describe an approach to the inductive synthesis of recursive equations from input/output-examples which is based on the classical two-step approach to induction of functional Lisp programs of Summers (1977). In a first step, I/O-examples are rewritten to traces which explain the outputs given the respective inputs based on a datatype theory. These traces can be integrated into one conditional expression which represents a non-recursive program. In a second step, this initial program term is generalized into recursive equations by searching for syntactical regularities in the term. Our approach extends the classical work in several aspects. The most important extensions are that we are able to induce a set of recursive equations in one synthesizing step, the equations may contain more than one recursive call, and additionally needed parameters are automatically introduced.&lt;/blockquote&gt;

&lt;p &gt;Is this the future of programming?&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <pubDate>Tue, 20 Nov 2007 16:33:13 -0500</pubDate>
</item>
<item>
 <title>Tagless Staged Interpreters for Simpler Typed Languages</title>
 <link>http://lambda-the-ultimate.org/node/2438</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://okmij.org/ftp/papers/tagless-final-APLAS.pdf&quot;&gt;Finally Tagless, Partially Evaluated, Tagless Staged Interpreters for Simpler Typed Languages&lt;/a&gt;.&lt;br &gt;
Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan.&lt;br &gt;
&lt;blockquote &gt;&lt;p &gt;
We have built the first family of tagless interpretations for a higher-order typed object language in a typed metalanguage (Haskell or ML) that require no dependent types, generalized algebraic data types, or postprocessing to eliminate tags. The statically type-preserving interpretations include an evaluator, a compiler (or staged evaluator), a partial evaluator, and call-by-name and call-by-value CPS transformers.&lt;br &gt;
Our main idea is to encode HOAS using cogen functions rather than data constructors. In other words, we represent object terms not in an initial algebra but using the coalgebraic structure of the LC. Our representation also simulates inductive maps from types to types, which are required for typed partial evaluation and CPS transformations.&lt;br &gt;
&lt;/blockquote&gt;
&lt;p &gt;
Oleg explains:&lt;p &gt;
It seems like a common wisdom that an embedding of a &lt;em &gt;typed&lt;/em&gt; object language (e.g., DSL) to a &lt;em &gt;typed&lt;/em&gt; meta-language so that all and only typed object terms can be represented requires dependent types, GADTs or other such advanced type systems. In fact, this problem of writing (tagless) type-preserving typed interpreters has been the motivation for most of the papers on GADTs. We show that regardless of merits and conveniences of GADTs, type-preserving typed interpretation can be achieved with no GADTs whatsoever, using very simple type systems of ML or Haskell98.  We also show the same approach lets us perform statically type-preserving partial evaluation and call-by-value or call-by-name CPS tansformations. The latter transformations, too, are often claimed impossible in Haskell98 or ML - requiring instead quite advanced type systems or language features.&lt;p &gt;
The complete (Meta)OCaml and Haskell code accompanying the paper is&lt;br &gt;
&lt;a href=&quot;http://okmij.org/ftp/packages/tagless-final.tar.gz&quot;&gt;available&lt;/a&gt; (see &lt;a href=&quot;http://okmij.org/ftp/packages/tagless-final-README.txt&quot;&gt;readme&lt;/a&gt;).
&lt;p &gt;
One of features of our approach is writing the DSL code in a form that can be interpreted in multiple ways. Recently we have become aware the very same approach underlies `abstract categorial grammars&#039; (ACG) in linguistics. Chung-chieh Shan has written an extensive article on this &lt;a href=&quot;http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Translations/&quot;&gt;correspondence&lt;/a&gt;. That post itself can be interpreted in several ways: the file can be read as plain text, or it can be loaded &lt;em &gt;as it is&lt;/em&gt; in Haskell or OCaml interpreters.&lt;p &gt;
It should be noted that the linguistic terms `tectogrammatics&#039; and `phenogrammatics&#039; were coined by none else but Haskell Curry, in his famous 1961 paper &#039;Some Logical Aspects of Grammatical Structure&#039;. The &lt;a href=&quot;http://let.uvt.nl/general/people/rmuskens/ndttg/&quot;&gt;summary&lt;/a&gt; of the ESSLLI workshop describes further connections to linear lambda-calculus.
&lt;p &gt;
The paper has been accepted for APLAS; the authors appreciate any comments indeed.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/8">Implementation</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Tue, 04 Sep 2007 05:35:37 -0400</pubDate>
</item>
<item>
 <title>A Temporal Logic Language for Context Awareness in Pointcuts</title>
 <link>http://lambda-the-ultimate.org/node/2185</link>
 <description>&lt;p &gt;A &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;ct=res&amp;amp;cd=1&amp;amp;url=http%3A%2F%2Fp-cos.net%2Fdocuments%2Ftemporal-logic-for-context-awareness.pdf&amp;amp;ei=0Z0YRpPBF4-AnQOxyrXqDQ&amp;amp;usg=__VluzHQgcnWMrbjpk0Zav1e9oldU=&amp;amp;sig2=vPTDLadA6XC3tc5sd2QY3A&quot;&gt;paper&lt;/a&gt; by Charlotte Herzeel, Kris Gybels, Pascal Costanza presented at &lt;a href=&quot;http://www.international-lisp-conference.org/2007/index&quot;&gt;ILC2007&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Some program concerns cannot be cleanly modularized, and their implementation leads to code that is both hard to understand and maintain. In this paper we consider extending an e-commerce application, written in CLOS, with two of such crosscutting concerns. Though most of the time Common Lisp&#039;s macro facilities and CLOS method combinations can be used to modularize crosscuts, we discuss the use of a more declarative solution when crosscuts depend on the execution history. For this purpose we give an overview of HALO, a novel pointcut language based on logic meta programming and temporal logic, which allows one to reason about program execution and (past) program state.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Charlotte Herzeel presented this at ILC with a flashy web-shop application built on Edi Weitz&#039;s standard tools of the web trade. The example takes the basic web-shop and uses aspects to add a lot of funky rules about promotion and discounts based on stock levels, what&#039;s selling well, what the user has been browsing, etc, and makes sure the discounts are honoured at the checkout.&lt;/p&gt;
&lt;p &gt;The focus on adding new and interesting functionality with aspects is refreshing. So is the basis in a powerful language like Lisp. The weakness of most aspect-oriented programming examples in my eyes is that they appear to be working around artificial problems caused by stubbornly using a base language that&#039;s ill-suited to the task. That only plays well with the audiences who are also stubbornly using those base languages for ill-suited tasks :-)&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <pubDate>Sun, 08 Apr 2007 04:48:30 -0400</pubDate>
</item>
<item>
 <title>A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language</title>
 <link>http://lambda-the-ultimate.org/node/2146</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.cs.berkeley.edu/~adamc/papers/CtpcPLDI07/&quot;&gt;A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language&lt;/a&gt;&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
I present a certified compiler from simply-typed lambda calculus to assembly language. The compiler is certified in the sense that it comes with a machine-checked proof of semantics preservation, performed with the Coq proof assistant. The compiler and the terms of its several intermediate languages are given dependent types that guarantee that only well-typed programs are representable. Thus, type preservation for each compiler pass follows without any significant &quot;proofs&quot; of the usual kind. Semantics preservation is proved based on denotational semantics assigned to the intermediate languages. I demonstrate how working with a type-preserving compiler enables type-directed proof search to discharge automatically large parts of the proof obligations.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://ltamer.sourceforge.net/&quot;&gt;Software/proof source code and documentation&lt;/a&gt;&lt;/p&gt;
&lt;p &gt;Slides are available from a talk I gave at the &lt;a href=&quot;http://gallium.inria.fr/&quot;&gt;Projet Gallium&lt;/a&gt; seminar at INRIA Rocquencourt, in &lt;a href=&quot;http://www.cs.berkeley.edu/~adamc/papers/CtpcPLDI07/CtpcINRIA.odp&quot;&gt;OpenOffice&lt;/a&gt; and &lt;a href=&quot;http://www.cs.berkeley.edu/~adamc/papers/CtpcPLDI07/CtpcINRIA.pdf&quot;&gt;PDF&lt;/a&gt; formats.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;I found this while attempting to follow up on &lt;a href=&quot;http://lambda-the-ultimate.org/node/2145#comment-27058&quot;&gt;this post&lt;/a&gt;. The approach taken here&amp;mdash;dependently-typed ASTs and denotational semantics&amp;mdash;and the observation that, carried to its logical conclusion, the result is typed intermediate and assembly languages, proof-carrying code, etc. suggests to me a connection to &lt;a href=&quot;http://lambda-the-ultimate.org/node/1760&quot;&gt;this work&lt;/a&gt;. It also seems to offer a denotational counterpoint to Leroy&#039;s &lt;a href=&quot;http://lambda-the-ultimate.org/node/1610#comment-19530&quot;&gt;coinductive big-step operational semantics&lt;/a&gt;, also done in Coq. Fascinating stuff.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/11">Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/8">Implementation</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/20">Lambda Calculus</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/29">Semantics</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Thu, 22 Mar 2007 11:46:03 -0400</pubDate>
</item>
<item>
 <title>Type-Level Computation Using Narrowing in Omega</title>
 <link>http://lambda-the-ultimate.org/node/2049</link>
 <description>&lt;p &gt;Haven&#039;t seen this &lt;a href=&quot;http://web.cecs.pdx.edu/~sheard/papers/sheardPLPV.ps&quot;&gt;paper&lt;/a&gt; by &lt;a href=&quot;http://web.cecs.pdx.edu/~sheard/&quot;&gt;Tim Sheard&lt;/a&gt; mentioned on Ltu before. As in previous papers Sheard tries to &lt;a href=&quot;http://lambda-the-ultimate.org/node/1115&quot;&gt;put Howard Curry to work&lt;/a&gt; in terms that are understandable for those that don&#039;t have a Phd in type theory. &lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Abstract:&lt;br &gt;
Omega is an experimental system that combines features of both a programming language and a logical reasoning system. Omega is a language with an infinite hierarchy of computational levels. Terms at one level are classified (or typed) by terms at the next higher level. In this paper we report on using two different computational mechanisms. At the value level, computation is performed by reduction, and is largely unconstrained. At all higher levels, computation is performed by narrowing.
&lt;/p&gt;&lt;/blockquote&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/11">Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Thu, 08 Feb 2007 15:21:50 -0500</pubDate>
</item>
<item>
 <title>Meta-Compilation of Language Abstractions</title>
 <link>http://lambda-the-ultimate.org/node/2019</link>
 <description>&lt;p &gt;&lt;a href=&quot;ftp://lispnyc.org/meeting-assets/2007-01-14_surana/SuranaThesis.pdf&quot;&gt;Meta-Compilation of Language Abstractions&lt;/a&gt;, a dissertation by Pinku Surana.&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
High-level programming languages are currently transformed into efficient low-level code using optimizations that are encoded directly into the compiler. Libraries, which are semantically rich user-level abstractions, are largely ignored by the compiler. Consequently, library writers often provide a complex, low-level interface to which programmers &amp;quot;manually compile&amp;quot; their high-level ideas. If library writers provide a high-level interface, it generally comes at the cost of performance. Ideally, library writers should provide a high-level interface and a means to compile it efficiently.&lt;/p&gt;
&lt;p &gt;This dissertation demonstrates that a compiler can be dynamically extended to support user-level abstractions. The Sausage meta-compilation system is an extensible source-to-source compiler for a subset of the Scheme programming language. Since the source language lacks nearly all the abstractions found in popular languages, new abstractions are implemented by a library and a compiler extension. In fact, Sausage implements all its general-purpose optimizations for functional languages as compiler extensions. A meta-compiler, therefore, is merely a shell that coordinates the execution of many external extensions to compile a single module. Sausage demonstrates that a compiler designed to be extended can evolve and adapt to new domains without a loss of efficiency.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;A very interesting and detailed paper, which touches on many perennial LtU subjects, and once again shifts the line between user programs and the compiler.  If you&#039;re tempted to say &quot;this sounds like X...&quot;, then read Chapter 2, which gives a comprehensive comparison to alternative approaches, including static type inference, traditional macro systems, templates, partial evaluation, and multi-stage languages such as MetaML and MetaOCaml.&lt;/p&gt;
&lt;p &gt;Some carefully selected quotes which I think summarize the summary quite well:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
The Sausage system provides a framework for programmers to write new domain-specific optimizations and inject them into the main compiler.&lt;br &gt;
...&lt;br &gt;
This dissertation takes the rather extreme view that anything beyond Core Scheme is a compiler extension.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Pinku Surana will be presenting this work at a meeting of &lt;a href=&quot;http://www.lispnyc.org/&quot;&gt;LispNYC&lt;/a&gt; on Feb 13th in New York City.  An announcement with details of the meeting can be found &lt;a href=&quot;http://lispnyc.scheming.org/meeting-feb-13-2007.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/24">DSL</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <pubDate>Fri, 02 Feb 2007 14:16:22 -0500</pubDate>
</item>
<item>
 <title>Ott--a tool for writing definitions of programming languages and calculi.</title>
 <link>http://lambda-the-ultimate.org/node/2002</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.cl.cam.ac.uk/~pes20/ott/&quot;&gt;Ott&lt;/a&gt;&amp;mdash;a tool for writing definitions of programming languages and calculi.&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Ott is a tool for writing definitions of programming languages and calculi. It takes as input a definition of a language syntax and semantics, in a concise and readable ASCII notation that is close to what one would write in informal mathematics. It generates LaTeX to build a typeset version of the definition, and Coq, HOL, and Isabelle versions of the definition. Additionally, it can be run as a filter, taking a LaTeX/Coq/Isabelle/HOL source file with embedded (symbolic) terms of the defined language, parsing them and replacing them by target-system terms. For a simple example, here is an Ott source file for an untyped call-by-value lambda calculus (test10.ott), and the generated LaTeX (compiled to pdf) and (compiled to ps), Coq, Isabelle, and HOL definitions.&lt;/p&gt;
&lt;p &gt;Most simply, the tool can be used to aid completely informal LaTeX mathematics. Here it permits the definition, and terms within proofs and exposition, to be written in a clear, editable, ASCII notation, without LaTeX noise. It generates good-quality typeset output. By parsing (and so sort-checking) this input, it quickly catches a range of simple errors, e.g. inconsistent use of judgement forms or metavariable naming conventions.&lt;/p&gt;
&lt;p &gt;That same input can be used to generate formal definitions, for Coq, HOL, and Isabelle. It should thereby enable a smooth transition between use of informal and formal mathematics. Additionally, the tool can automatically generate definitions of functions for free variables, single and multiple substitutions, subgrammar checks (e.g. for value subgrammars), and binding auxiliary functions. (At present only a fully concrete representation of binding is supported, without quotienting by alpha equivalence.)&lt;/p&gt;
&lt;p &gt;The distribution includes several examples, in varying levels of completeness: untyped and simply typed lambda-calculus, a calculus with ML polymorphism, the POPLmark Fsub with and without records, an ML module system taken from (Leroy, JFP 1996) and equipped with an operational semantics, and LJ, a lightweight Java fragment.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Peter Sewell and his team continue to bridge the gap between the informal and formal worlds of programming language semantics.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/24">DSL</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/29">Semantics</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Tue, 23 Jan 2007 02:06:59 -0500</pubDate>
</item>
<item>
 <title>Charming Python: Decorators make magic easy</title>
 <link>http://lambda-the-ultimate.org/node/1961</link>
 <description>&lt;blockquote &gt;&lt;p &gt;
Python made metaprogramming possible, but each Python version has added slightly different -- and not quite compatible -- wrinkles to the way you accomplish metaprogramming tricks. Playing with first-class function objects has long been around, as have techniques for peaking and poking at magic attributes. With version 2.2, Python grew a custom metaclass mechanism that went a long way, but at the cost of melting users&#039; brains. More recently, with version 2.4, Python has grown &quot;decorators,&quot; which are the newest -- and by far the most user-friendly way, so far -- to perform most metaprogramming.&lt;/blockquote&gt;
&lt;p &gt;
While metaprogramming is inherently a bit confusing, I think &lt;a href=&quot;http://www-128.ibm.com/developerworks/linux/library/l-cpdecor.html&quot;&gt;this article&lt;/a&gt; could have a been a little clearer. Still, it&#039;s a nice highlevel introduction to decorators. &lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/26">Python</category>
 <pubDate>Fri, 05 Jan 2007 09:40:42 -0500</pubDate>
</item>
<item>
 <title>A Stepper for Scheme Macros</title>
 <link>http://lambda-the-ultimate.org/node/1761</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://scheme2006.cs.uchicago.edu/10-culpepper.pdf&quot;&gt;A Stepper for Scheme Macros&lt;/a&gt;. Ryan Culpepper, Matthias Felleisen.&lt;br &gt;
&lt;blockquote &gt;&lt;p &gt;
In this paper, we present a macro debugger with full support for modern Scheme macros. To construct the debugger, we have extended the macro expander so that it issues a series of expansion events. A parser turns these event streams into derivations in a natural semantics for macro expansion. From these derivations, the debugger extracts a reduction-sequence (stepping) view of the expansion. A programmer can specify with simple policies which parts of a derivation to omit and which parts to show. Last but not least, the debugger includes a syntax browser that graphically displays the various pieces of information that the expander attaches to syntactic tokens.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Another paper from the &lt;a href=&quot;http://lambda-the-ultimate.org/node/1743&quot;&gt;Scheme workshop&lt;/a&gt;.&lt;p &gt;
Apart from being a nice exercise for macro lovers, a good macro debugger is essential for lowering the barrier to macro programming. Since macro programming is an important technique for building DSELs and for language oriented programming in general, having better macro debugging facilities is a Good Thing.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/24">DSL</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/18">Teaching &amp; Learning</category>
 <pubDate>Sun, 08 Oct 2006 09:34:10 -0400</pubDate>
</item>
<item>
 <title>Is &quot;post OO&quot; just over?</title>
 <link>http://lambda-the-ultimate.org/node/1741</link>
 <description>&lt;p &gt;While studying the conference program of the upcoming &lt;a href=&quot;http://www.oopsla.org/2006/&quot;&gt;OOPSLA 2006&lt;/a&gt; I discovered under the category &quot;essay&quot; an author who has quite something critical to &lt;a href=&quot;http://www.oopsla.org/2006/submission/essays/the_paradoxical_success_of_aspect-oriented_programming.html&quot;&gt;say&lt;/a&gt; about AOP:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;Aspect-oriented programming is discussed as a promising new technology. Like object-oriented programming, it is beginning to pervade all areas of software engineering. With its growing popularity, practitioners and academics alike are beginning to wonder whether they should start looking into or it, or otherwise risk having missed an important development. The author of this essay finds that much of aspect-oriented programming&#039;s success seems to be based on the conception that it improves both modularity and the structure of code, while in fact, it actually works against the primary purposes of the two, namely independent development and understandability of programs. Not seeing any way of fixing this situation, he thinks the success of aspect-oriented programming to be paradoxical.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;This is not just another internet rant about the latest PL hype but the author, Friedrich Steimann, had done interesting work about AOP before. In particular his latest paper about typed AOP:&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://www.fernuni-hagen.de/ps/forschung/publikationen/publikation_20284.shtml&quot;&gt;AOP and the antinomy of the liar&lt;/a&gt;&lt;/p&gt;
&lt;p &gt;but also his award winning former critical AOP review:&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://www.fernuni-hagen.de/ps/forschung/publikationen/publikation_04925.shtml&quot;&gt;Domain models are aspect free&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/4">Critiques</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/14">OOP</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/10">Paradigms</category>
 <pubDate>Sun, 24 Sep 2006 06:50:50 -0400</pubDate>
</item>
</channel>
</rss>
