Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (69 sloc) 3.9 KB
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
<title>Erasm++ - meta_prelude</title>
<link rel="stylesheet" type="text/css" href="./css/default.css"></link>
<link rel="stylesheet" type="text/css" href="./css/syntax.css"></link>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-29123087-1']);
_gaq.push(['_setDomainName', '']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
<div id="main">
<div id="sidebar">
<div id="header">
<h1>Erasm++ </h1>
<!-- <h2>Navigation</h2> -->
<a href="./">About</a>
<li> <a href="./erasm.html">ERASM++</a> </li>
<li> <a href="./gendsm.html">GenericDsm</a> </li>
<li> <a href="./meta_prelude.html">MetaPrelude</a> </li>
<a href="./download.html">Download/Install</a>
<a href="./manual/manual.html">Online Manual</a>
<a href="./privacy.html">Privacy Policy</a>
<div id="content">
<h1 id="metaprelude">MetaPrelude</h1>
<p>MetaPrelude is a C++ metaprogramming library that tries to realize <a href="">Haskell</a>-like (but untyped) purely-functional, non-strict type-level programming environment. It is used as the backend of static type-level computation in ERASM++ and GenericDsm. I hope it could help implementing more complex EDSLs than the assembly language.</p>
<p>It is still far from complete and mostly undocumented, and here I only list some of the most important limitations. The interested reader is invited to review the code directly.</p>
<li><p>It is an untyped calculus.</p></li>
<li><p>The implementation is based on a naive top-most left-most evaluator, and is very inefficient.</p></li>
<li><p>It doesn’t support lambdas (efficiently). This implies, among other things, that you can’t have Haskell-style monads syntactically.</p></li>
<li><p>Pattern matching is not supported. Instead, users have to use a custom multiway conditional called <code>ifn</code> like the following:</p>
<pre><code>ifn&lt; isX&lt;x&gt; , thenX ,
isY&lt;x&gt; , thenY ,
defaultCase &gt;
<p>Note that this is a lazy conditional, and is semantically different from Haskell’s case expressions.</p></li>
<li><p>In order to support currying, lots of ugly preprocessor hacks are involved. Furthermore, functions with only up to a fixed number (3 at this moment) of parameters can be curried. Defining a new function without macros is practically impossible.</p></li>
<li><p>Most importantly, the complexity of the program is dependent upon the particular compiler implementation! Some versions of compilers cache template instantiations, some do not, others in-between at various degrees, and all this can make a difference of linear to super-exponential complexity.</p></li>
<p>For the moment, code is the only documentation. Please see the following files in the distribution if you are interested:</p>