<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://lambda-the-ultimate.org">
<channel>
 <title>Lambda the Ultimate - LtU Forum, Site Discussion</title>
 <link>http://lambda-the-ultimate.org/taxonomy/term/1 2/0</link>
 <description>Main Discussion Forum</description>
 <language>en</language>
<item>
 <title>Nimrod: A new statically typed, compiled programming language which supports metaprogramming</title>
 <link>http://lambda-the-ultimate.org/node/4749</link>
 <description>&lt;blockquote &gt;&lt;p &gt;Nimrod is a statically typed, imperative programming language that tries to give the programmer ultimate power without compromises on runtime efficiency. This means it focuses on compile-time mechanisms in all their various forms.&lt;/p&gt;
&lt;p &gt;Beneath a nice infix/indentation based syntax with a powerful (AST based, hygienic) macro system lies a semantic model that supports a soft realtime GC on thread local heaps. Asynchronous message passing is used between threads, so no &quot;stop the world&quot; mechanism is necessary. An unsafe shared memory heap is also provided for the increased efficiency that results from that model.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;I would like to share this language here as it has recently had a new version released. &lt;a href=&quot;http://nimrod-code.org/&quot;&gt;Nimrod&lt;/a&gt; resembles Python in that it uses whitespace to delimit blocks and Pascal because of the way that types are defined (TType). It supports metaprogramming with macros and templates. Code example:&lt;/p&gt;
&lt;pre &gt;
# compute average line length
var count = 0
var sum = 0

for line in stdin.lines:
  count += 1
  sum += line.len

echo &quot;Average line length: &quot;,
  if count &amp;gt; 0: sum / count else: 0
&lt;/pre&gt;&lt;br &gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Tue, 21 May 2013 15:20:16 -0400</pubDate>
</item>
<item>
 <title>Janus: A Time-Reversible Language</title>
 <link>http://lambda-the-ultimate.org/node/4748</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://tetsuo.jp/ref/janus.pdf&quot;&gt;By C. Lutz and H. Derby circa 1982&lt;/a&gt;. Header:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
JANUS was written by myself and Howard Derby for a class at Caltech in 1982 (or thereabouts). The class had nothing to do directly with this project. We did it out of curiosity over whether such an odd animal as this was possible, and because we were interested in knowing where we put information when we programmed. JANUS forced us to pay attention to where our bits went since none could be thrown away.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;This is class report but also a great design exercise in reversible programming language constructs. For example, I love how they make if conditions reversible:&lt;/p&gt;
&lt;pre &gt;
if   num # 1
then i += 1        ; Put last prime away, if not done
     fact[i] : num ; and zero num
else num -= 1
fi fact[i] # fact[i-1]
&lt;/pre&gt;&lt;p &gt;
Note that # means not equals; colon is used for swap (!!). The &quot;fi&quot; condition must match the truth value of the &quot;if&quot; condition so the condition can be played backwards. Loop constructs are similarly organized so they can play backwards, the language has procedures but all variables are global :). &lt;/p&gt;
&lt;p &gt;Sadly, although there are a few follow on papers (e.g. by &lt;a href=&quot;http://dl.acm.org/citation.cfm?id=1366230.1366239&amp;amp;coll=DL&amp;amp;dl=ACM&amp;amp;CFID=218518830&amp;amp;CFTOKEN=98567030&quot;&gt;Yokoyama et al.&lt;/a&gt;) and some esoteric reversible languages like &lt;a href=&quot;http://esolangs.org/wiki/Kayak&quot;&gt;Kayak&lt;/a&gt;, there doesn&#039;t seem to be any other good examples of high-level serious reversible programming languages. &lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Tue, 21 May 2013 00:39:59 -0400</pubDate>
</item>
<item>
 <title>Genealogical Diagrams broken link</title>
 <link>http://lambda-the-ultimate.org/node/4747</link>
 <description>&lt;p &gt;maybe replace&lt;br &gt;
http://lambda-the-ultimate.org/node/7&lt;br &gt;
&quot;complete&quot; http://merd.net/pixel/language-study/diagram.html&lt;/p&gt;
&lt;p &gt;with&lt;br &gt;
http://rigaux.org/language-study/diagram.html&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/2">Site Discussion</category>
 <pubDate>Mon, 20 May 2013 19:45:18 -0400</pubDate>
</item>
<item>
 <title>Osmosian</title>
 <link>http://lambda-the-ultimate.org/node/4746</link>
 <description>&lt;p &gt;(via awelonblue)&lt;/p&gt;
&lt;p &gt;&quot;Plain English Programming&quot; care of &lt;a href=&quot;http://www.osmosian.com/&quot;&gt;the Osmosian order&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
We intend to supplant, in turn, the programming languages, operating systems, and hardware configurations currently in widespread use. Our initial goal is to see Plain English (and other natural-language variants). ... We offer our Plain English compiler as both &quot;proof of concept&quot; and a first step in the right direction. Our integrated development environment includes an elegant desktop interface, a simplified file manager, an efficient text editor, the compiler, and the page-layout routines used to produce all of our documentation, the illustrations for our web site, and this manifesto. It should be noted that all this functionality is embodied in a single, stand-alone, native-code executable less than one megabyte in size. The program runs on the Wintel Kluge, was written entirely in Plain English, and re-compiles itself in less than three seconds.
&lt;/p&gt;&lt;/blockquote&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Mon, 20 May 2013 19:03:05 -0400</pubDate>
</item>
<item>
 <title>ANN: Emerging Languages and Strange Loop 2013</title>
 <link>http://lambda-the-ultimate.org/node/4745</link>
 <description>&lt;p &gt;Alex Payne and I are pleased to announce the 2013 Emerging Languages program (&lt;a href=&quot;https://thestrangeloop.com/preconf&quot;&gt;https://thestrangeloop.com/preconf&lt;/a&gt;):&lt;/p&gt;
&lt;p &gt;* Noether: a concurrent security-oriented language - Daira Hopwood&lt;br &gt;
* BODOL, or How To Accidentally Build Your Own Language - Bodil Stokke&lt;br &gt;
* Babel: An Untyped, Stack-based HLL - Clayton Bauman&lt;br &gt;
* The J Programming Language - Tracy Harms&lt;br &gt;
* Nimrod: A new approach to meta programming - Andreas Rumpf&lt;br &gt;
* Qbrt Bytecode: Interface Between Code and Execution - Matthew Graham&lt;br &gt;
* Daimio: a language for sharing - Dann Toliver&lt;br &gt;
* Metaprogramming for the masses - Boo 10 years later - Rodrigo B. de Oliveira&lt;br &gt;
* Ens?: Composing DSL Interpreters, Languages &amp;amp; Aspects - William Cook&lt;br &gt;
* Dao Programming Language for Scripting and Computing - Limin Fu&lt;br &gt;
* Axiomatic Language	 - Walter Wilson&lt;br &gt;
* Gershwin: Stack-based, Concatenative Clojure - Daniel Gregoire&lt;/p&gt;
&lt;p &gt;Emerging Languages is an optional camp on the preconference day of Strange Loop. Tickets for Strange Loop go on sale Tuesday May 21st at noon US Central time at &lt;a href=&quot;http://regonline.com/strangeloop2013&quot;&gt;http://regonline.com/strangeloop2013&lt;/a&gt;. Strange Loop is $500. Emerging Langs is an additional $150.&lt;/p&gt;
&lt;p &gt;The Strange Loop program (&lt;a href=&quot;http://thestrangeloop.com/sessions&quot;&gt;http://thestrangeloop.com/sessions&lt;/a&gt;) has many talks of interest to language developers and aficionados as well (just a partial list here):&lt;/p&gt;
&lt;p &gt;* Keynote: - The Trouble With Types - Martin Odersky&lt;br &gt;
* Workshop: Real Development Boot Camp in SWI-Prolog - Anne Ogborn&lt;br &gt;
* Workshop: From Installed to Productive in Julia - Leah Hanson&lt;br &gt;
* Chuck Moore (creator of Forth)&lt;br &gt;
* Software for Programming Cells - Colin Gravill&lt;br &gt;
* Exercises in Style - Christa Lopes - implementing one small program in many ways&lt;br &gt;
* Dart for the Language Enthusiast - Bob Nystrom&lt;br &gt;
* Linear Logic Programming - Chris Martens&lt;br &gt;
* A Relational Exploration of the Chomsky Hierarchy - Friedman, Byrd&lt;br &gt;
* Scala vs Idris: Dependent types, now and in the future - Miles Sabin, Edwin Brady&lt;br &gt;
* Building optimising compiler for Dart - Vyacheslav Egorov&lt;br &gt;
* Functional Reactive Programming in Elm - Evan Czaplicki&lt;br &gt;
* Julia: The Design Impact of Multiple Dispatch - Stefan Karpinski&lt;br &gt;
* Fucntional Vectors, Maps, and Sets in Julia - Zach Allaun&lt;br &gt;
* Why Ruby Isn&#039;t Slow - Alex Gaynor (about the Topaz Ruby on Pypy project)&lt;br &gt;
* Evolution of Scala Macros - Eugene Burmako&lt;br &gt;
* Fast and Dynamic - Maxime Chevalier-Boisvert&lt;br &gt;
* Continuations on the Web and in your OS - Jay McCarthy&lt;/p&gt;
&lt;p &gt;Lots of other great stuff too. Hope you can make it!&lt;/p&gt;
&lt;p &gt;Alex Miller&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Mon, 20 May 2013 12:13:52 -0400</pubDate>
</item>
<item>
 <title>Dimensional Analysis in real world and Type Systems</title>
 <link>http://lambda-the-ultimate.org/node/4744</link>
 <description>&lt;p &gt;I&#039;m not sure I know what I&#039;m talking about... &lt;/p&gt;
&lt;p &gt;Isn&#039;t &lt;a href=&quot;http://en.wikipedia.org/wiki/Dimensional_analysis&quot;&gt;dimensional analysis&lt;/a&gt; used in natural science a kind of type checking? If so, doesn&#039;t it mean Curry–Howard isomorphism is applicable and, therefore, dimensional analysis is simply theorem proofing?&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Sun, 19 May 2013 18:59:48 -0400</pubDate>
</item>
<item>
 <title>A reversible Javascript interpreter</title>
 <link>http://lambda-the-ultimate.org/node/4743</link>
 <description>&lt;p &gt;I posted a while ago about a meta-circular Javascript interpreter I&#039;ve been working on (now called Tailspin).&lt;/p&gt;
&lt;p &gt;It is now reversible. As well as running in the browser and allowing algorithms to be visualised, Tailspin can now run code both forwards and backwards (using lots of continuations).&lt;/p&gt;
&lt;p &gt;Being reversible provides some really interesting opportunities for exploring program execution and aiding learning to code. So far I have focused on algorithm visualisation where reversibility makes it possible to scrub through the execution of algorithms. This is not just fun, it transforms the experience of understanding the algorithm. I&#039;ve been surprised at how simple it has been to create some really good visualisations (see the &lt;a href=&quot;http://will.thimbleby.net/algorithms&quot;&gt;wiki&lt;/a&gt;), it&#039;s a little hacky at the moment, but it&#039;s really easy using the wiki to create an algorithm visualisation and without any work to be able to scrub back and forth through it.&lt;/p&gt;
&lt;p &gt;Suggestions for uses or improvements are very welcome.&lt;br &gt;
&lt;br &gt;&lt;br &gt;
More info: &lt;a href=&quot;http://will.thimbleby.net/reversible-javascript/&quot;&gt;http://will.thimbleby.net/reversible-javascript/&lt;/a&gt;&lt;br &gt;
Wiki: &lt;a href=&quot;http://will.thimbleby.net/algorithms&quot;&gt;http://will.thimbleby.net/algorithms&lt;/a&gt;&lt;br &gt;
IDE: &lt;a href=&quot;http://will.thimbleby.net/algorithms/inspector&quot;&gt;http://will.thimbleby.net/algorithms/inspector&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Sun, 19 May 2013 01:46:30 -0400</pubDate>
</item>
<item>
 <title>MacroPy: Bringing Macros to Python. Quasiquotes, case classes, LINQ and more! </title>
 <link>http://lambda-the-ultimate.org/node/4742</link>
 <description>&lt;p &gt;Hey All,&lt;/p&gt;
&lt;p &gt;MacroPy (https://github.com/lihaoyi/macropy) is a project we&#039;ve been working on, which gives you the ability to (very easily) perform AST manipulations on a Python program, and runs on a unmodified Python runtime (CPython 2.7 or PyPy 2.0). &lt;/p&gt;
&lt;p &gt;We have a whole suite of demo macros, which I think are all pretty compelling use cases for macros in a language which traditionally doesn&#039;t have such functionality. They are pretty different from what comes up if you&#039;d google &quot;lisp macros&quot;!&lt;/p&gt;
&lt;p &gt;We think this is super cool, so hopefully you find it interesting. Looking forward to any feedback!&lt;/p&gt;
&lt;p &gt;Thanks!&lt;br &gt;
-Haoyi&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Sat, 18 May 2013 16:59:43 -0400</pubDate>
</item>
<item>
 <title>what&#039;s a useful definition of equivalent functions?</title>
 <link>http://lambda-the-ultimate.org/node/4741</link>
 <description>&lt;p &gt;Equivalence of functions is, in general, undecidable.  But specific instances of it are usually decidable.  Equivalence can be proven via structure analysis, or disproven via structure analysis or by example.  Equality can be proven on functions whose input is limited to a finite set simply by exhaustive testing of all possible inputs. So, while it&#039;s true that there will always be an infinite set of pairs of functions for which we cannot prove equivalence or nonequivalence, it isn&#039;t really the case that we can&#039;t ever prove anything. &lt;/p&gt;
&lt;p &gt;But what notion of &#039;equivalence&#039; is useful?&lt;/p&gt;
&lt;p &gt;What if we have two functions that are provably equivalent where their results are defined, but result in errors in different cases, or result in *different* errors in some cases?  If I can prove, in the context of a particular program, that no possible call to a function will be a member of either error-causing set, then the functions are equivalent ... for purposes of that program.  ie, they are observationally equivalent for the particular subset of valid inputs that we&#039;re interested in.   &lt;/p&gt;
&lt;p &gt;What if we have two functions that do equivalent things to members of slightly different types?  For example, if I have two string-concatenation functions, but one of them concatenates a string class on which fifteen other  operations are defined and one of them concatenates a string class on which thirteen of the _same_ other operations and three _different_ other operations are defined?  These concatenation functions are not exactly mathematically equivalent, but in some very important way they are exactly the same, and may even be expressed by exactly the same source code.  If a mathematician said these functions weren&#039;t equivalent, as an engineer I would roll my eyes and ignore him. If my job required me to satisfy his useless notion of equivalence, I would *make* the functions equivalent by just defining the &#039;missing&#039; operations in both classes. &lt;/p&gt;
&lt;p &gt;What about having &#039;equivalent&#039; multiplication functions on, say, ints and rationals?  If I posit that there is a multiplication function on a &#039;number&#039; type that both of the other functions are subsets of (that is, they give equal results on equal inputs, for all inputs they can be given), is that a useful notion of equivalence?&lt;/p&gt;
&lt;p &gt;What if we have two functions that return exactly the same results in all cases, and we can prove it ... but one of them takes N-squared memory and NlogN runtime, and the other takes N-squared runtime and NlogN memory?  As an engineer I&#039;d find this semantic equivalence and resource-requirement nonequivalence useful and swap one for the other depending on whether speed or memory use were more important.  As a mathematician, I don&#039;t even know whether I&#039;d be working with a notion of equivalence that would note the difference.  &lt;/p&gt;
&lt;p &gt;In the end, &#039;equivalence&#039; is any relation that&#039;s transitive, symmetric, and reflexive.  There&#039;s an infinite number of choices of such relations, and people who talk about function equivalence often do so without saying which equivalence they mean.  Or, importantly, which equivalence is most useful in some relevant context. &lt;/p&gt;
&lt;p &gt;And while you&#039;re chewing on the question of what &#039;equivalence&#039; is most useful in a given context, what notion of proof is most useful to establish it?&lt;/p&gt;
&lt;p &gt;What if we have a pair of functions which has been observed to return the same answer for the same inputs on a randomly-selected billion possible inputs ... and monitoring both has revealed that we have achieved 100% code coverage in both functions while doing so ... and other monitoring, plus a few million not-so-randomly-selected inputs, has assured that all possible combinations of taken and not-taken conditional branches in both functions have been exercised, on inputs that differ from each other by the theoretical minimum possible for that input type?  As a mathematician, I couldn&#039;t claim that I know these functions are equivalent.  As an engineer, I&#039;d consider the indications of function equality to be strong enough that I wouldn&#039;t mind the absence of a proof.  I&#039;d feel comfortable swapping one for the other, especially if they are both relatively short.  &lt;/p&gt;
&lt;p &gt;Why short?  Shortness limits the possible semantic complexity to some wobbly notion of a boundary, making it less likely that one or both contains subtleties not revealed by the extended fuzz-test.  If one or both of the functions were twice as long, I&#039;d want more fuzz-testing before I&#039;d feel as comfortable swapping them.  This corresponds to some intuition about reaching a particular certainty level, but that certainty level, no matter how you slice it, is less than an absolute proof.&lt;/p&gt;
&lt;p &gt;So, here&#039;s a question.  Is it useful for programmers to go with some &#039;heuristic&#039; of function equality, or an engineering-grade &#039;indication&#039; of function equality, if no mathematically certain proof is available and by doing so they can achieve measurably better results?   Is it worthwhile for PL theorists and researchers to seek and refine such &#039;heuristics&#039; and ways of estimating the strength of such &#039;indications&#039; (rather than &#039;proofs&#039;) of function equality?&lt;/p&gt;
&lt;p &gt;In mechanical engineering, strength of materials is always an estimate.  In programming, sometimes the strength of our knowledge is also an estimate.   This is a problem, but not necessarily a disaster, in terms of producing useful results.  Mechanical engineers compensate by including a &#039;safety margin&#039; well beyond the requirements of the particular job.  How should programmers compensate?&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Thu, 16 May 2013 14:31:57 -0400</pubDate>
</item>
<item>
 <title>getting feet wet re: Computational Thinking</title>
 <link>http://lambda-the-ultimate.org/node/4740</link>
 <description>&lt;p &gt;C.T. has been &lt;a href=&quot;https://www.google.com/search?ie=UTF-8&amp;amp;oe=UTF-8&amp;amp;q=computational+thinking&amp;amp;btnG=&amp;amp;domains=http%3A%2F%2Flambda-the-ultimate.org&amp;amp;sitesearch=http%3A%2F%2Flambda-the-ultimate.org&quot;&gt;mentioned on LtU before&lt;/a&gt;. I do hope that it gets ever wider attention. I like this paper in that the approach is not mainly about making people be able to be programmers. It is about making people be able to understand things e.g. so they can (as I see it) understand items in the news, or talk about things over coffee. Even people who learn to program often miss the forest for the trees, I think.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://www.cs.ou.edu/~rlpage/SEcollab/hcwtfpie2012.pdf&quot;&gt;How Computers Work: Computational Thinking for Everyone&lt;/a&gt;&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
What would you teach if you had only one course to help students grasp the essence of computation&lt;br &gt;
and perhaps inspire a few of them to make computing a subject of further study? Assume they have&lt;br &gt;
the standard college prep background. This would include basic algebra, but not necessarily more&lt;br &gt;
advanced mathematics. They would have written a few term papers, but would not have written&lt;br &gt;
computer programs. They could surf and twitter, but could not exclusive-or and nand. What about&lt;br &gt;
computers would interest them or help them place their experience in context? This paper provides&lt;br &gt;
one possible answer to this question by discussing a course that has completed its second iteration.&lt;br &gt;
Grounded in classical logic, elucidated in digital circuits and computer software, it expands into&lt;br &gt;
areas such as CPU components and massive databases. The course has succeeded in garnering the&lt;br &gt;
enthusiastic attention of students with a broad range of interests, exercising their problem solving&lt;br &gt;
skills, and introducing them to computational thinking.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;&quot;The course includes some computer programming, but does not dwell on it.&quot;&lt;/p&gt;
&lt;p &gt;I wish more real-world day-job programmers (including refreshing my own self I can&#039;t be too hypocritical) really learned these things:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
The big ideas in the honors course are&lt;br &gt;
1. the correspondence between digital circuits and formulas in logic,&lt;br &gt;
2. how abstractions facilitate combining solutions to small problems to form solutions to big ones,&lt;br &gt;
3. how algebraic formulas can specify computations,&lt;br &gt;
4. how models expressed in software capture the behavior of processes and devices,&lt;br &gt;
5. how important, complex algorithms derive from simple, definitional properties,&lt;br &gt;
6. how different definitional properties can produce the same results at vastly different computational&lt;br &gt;
expense,&lt;br &gt;
7. how computational expense makes some useful devices feasible and renders others infeasible,&lt;br &gt;
8. and how all of these ideas bear on the ability of computers to deal with information on the massive&lt;br &gt;
scale needed to provide services like search engines, internet storefronts, and social networks
&lt;/p&gt;&lt;/blockquote&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Thu, 16 May 2013 14:25:30 -0400</pubDate>
</item>
<item>
 <title>Terra: A low-level counterpart to Lua</title>
 <link>http://lambda-the-ultimate.org/node/4739</link>
 <description>&lt;p &gt;A very interesting project developed by Zachary DeVito et al at Stanford University:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
&lt;a href=&quot;http://terralang.org/index.html&quot;&gt;Terra&lt;/a&gt; is a new low-level system programming language that is designed to interoperate seamlessly with the Lua programming language:&lt;/p&gt;
&lt;pre &gt;
-- This top-level code is plain Lua code.
print(&quot;Hello, Lua!&quot;)

-- Terra is backwards compatible with C
-- we&#039;ll use C&#039;s io library in our example.
C = terralib.includec(&quot;stdio.h&quot;)

-- The keyword &#039;terra&#039; introduces
-- a new Terra function.
terra hello(argc : int, argv : &amp;amp;rawstring)
    -- Here we call a C function from Terra
    C.printf(&quot;Hello, Terra!\n&quot;)
    return 0
end

-- You can call Terra functions directly from Lua
hello(0,nil)

-- Or, you can save them to disk as executables or .o
-- files and link them into existing programs
terralib.saveobj(&quot;helloterra&quot;,{ main = hello })
&lt;/pre&gt;&lt;p &gt;
Like C, Terra is a simple, statically-typed, compiled language with manual memory management. But unlike C, it is designed from the beginning to interoperate with Lua. Terra functions are first-class Lua values created using the terra keyword. When needed they are JIT-compiled to machine code.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Seems as if the target use case is high-performance computing. The team has also released a related paper, titled &lt;a href=&quot;http://terralang.org/pldi071-devito.pdf&quot;&gt;Terra: A Multi-Stage Language for High-Performance Computing&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
High-performance computing applications, such as auto-tuners and domain-specific languages, rely on generative programming techniques to achieve high performance and portability. However, these systems are often implemented in multiple disparate languages and perform code generation in a separate process from program execution, making certain optimizations difficult to engineer. We leverage a popular scripting language, Lua, to stage the execution of a novel low-level language, Terra. Users can implement optimizations in the high-level language, and use built-in constructs to generate and execute high-performance Terra code. To simplify meta-programming, Lua and Terra share the same lexical environment, but, to ensure performance, Terra code can execute independently of Lua’s runtime. We evaluate our design by reimplementing existing multi-language systems entirely in Terra. Our Terra-based auto-tuner for BLAS routines performs within 20% of ATLAS, and our DSL for stencil computations runs 2.3x faster than hand-written C.
&lt;/p&gt;&lt;/blockquote&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Wed, 15 May 2013 04:38:14 -0400</pubDate>
</item>
<item>
 <title>Unordered pairs and their representation</title>
 <link>http://lambda-the-ultimate.org/node/4738</link>
 <description>&lt;p &gt;Occasionally situations arise where a type of unordered pairs would be very handy.&lt;/p&gt;
&lt;p &gt;Perhaps the most important example is for representing edges in undirected graphs.&lt;/p&gt;
&lt;p &gt;I came across another example that is instructional in a paper by C.J. Date entitled &quot;The Primacy of Primary Keys: An Investigation&quot;. He wonders how to define a relation to store information about marriages, under the definition that a marriage is between two people. He gives a definition like:&lt;/p&gt;
&lt;pre &gt;
MARRIAGE ( HUSBAND, WIFE, DATE_OF_MARRIAGE )
    CANDIDATE KEY ( HUSBAND, DATE_OF_MARRIAGE )
    CANDIDATE KEY ( WIFE, DATE_OF_MARRIAGE )
&lt;/pre&gt;&lt;p &gt;
and raises the issue that there is no reason to prefer designating one key or the other as primary. If you amend the example so that there are not distinguished roles like &quot;husband&quot; or &quot;wife&quot; that could provide sensible labels for two separate attributes each storing a single person identifier, then this seems to be a natural spot for an unordered pair type. (Please refrain from discussing the politics of this definition, there are plenty of places on the internet for that.)&lt;/p&gt;
&lt;p &gt;I set about thinking of how to make such a type and what its interface could be. I ended up with nearly the exact same interface I had for general sets. I am working on a language for expressing database queries, so I want to strictly control non-determinacy. (Adopting Haskell concrete syntax for purposes of communication...) I have a &lt;code &gt;member :: a -&amp;gt; UnorderedPair a -&amp;gt; Bool&lt;/code&gt; containment test, an &lt;code &gt;instance Eq a =&amp;gt; Eq (UnorderedPair a)&lt;/code&gt;, and a function like &lt;code &gt;elements :: UnorderedPair a -&amp;gt; Set a&lt;/code&gt;. There&#039;s no pattern matching on unordered pairs because it would be so easy to accidentally shoot yourself in the foot with it, and no pattern matching on sets either. There is &lt;code &gt;toList :: Set a -&amp;gt; NonDeterministic [a]&lt;/code&gt; though if you need an escape hatch. I also have an &lt;code &gt;instance Ord a =&amp;gt; Ord (UnorderedPair a)&lt;/code&gt; and &lt;code &gt;inorder :: Ord a =&amp;gt; UnorderedPair a -&amp;gt; (a, a)&lt;/code&gt;.&lt;/p&gt;
&lt;p &gt;Overall I&#039;m reasonably happy with this. But I got to wondering whether it would be better to have a more general facility and view unordered pairs as a special case of it. You can look at them as the quotient of pairs with respect to an equivalence relation that permutes the ordering, and then you get unordered triples and ... too, if you can think of anything to use them for. Or you can look at them as a refinement type of sets with cardinality 2.&lt;/p&gt;
&lt;p &gt;Those definitions of course differ on whether &lt;code &gt;(3,3) :: UnorderedPair Integer&lt;/code&gt; though, and it seems like there may be applications for both answers. A fair amount of literature discusses undirected graphs with loops edges from one vertex to itself. But at least as much literature discusses graphs where such edges are disallowed, and disallowing them seems more natural for the marriage example. I suppose with general purpose refinement types you could look at sets with cardinality in [1 : 2], having your cake and also eating it.&lt;/p&gt;
&lt;p &gt;The quotient type approach struggles with one of my goals, because presumably the pattern matching function that applies on ordered pairs would still apply to the quotient unordered pairs without flagging the result as non-deterministic.&lt;/p&gt;
&lt;p &gt;If you take the ad hoc approach (neither quotients nor refinement types) it is difficult to think of names for the unordered pairs with and without allowing the degenerate pairs relating a value to itself, so that is another challenge.&lt;/p&gt;
&lt;p &gt;I wasn&#039;t able to dig up too many examples through search engines, does anyone have thoughts on the best approach to modeling these?&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Tue, 14 May 2013 23:11:08 -0400</pubDate>
</item>
<item>
 <title>texts &amp; otherwise for bottom up teaching/learning</title>
 <link>http://lambda-the-ultimate.org/node/4737</link>
 <description>&lt;p &gt;Hi Folks,&lt;/p&gt;
&lt;p &gt;My son is now studying computer science at college, and in looking over some of his course materials, I&#039;ve noticed how differently computer science seems to be taught, compared to earlier times (in my case, early 70s, MIT).&lt;/p&gt;
&lt;p &gt;Which leads me to wonder, if one wanted to teach/learn the way I did, bottom up, are there any good books (textbook format or otherwise), lecture notes, online tutorials, etc. that one might use to proceed from:&lt;br &gt;
- math, theory of computation background&lt;br &gt;
- basic hardware concepts -&amp;gt; computer architecture&lt;br &gt;
- machine language, assembly language (including assembler and linker concepts&lt;br &gt;
- higher level languages (including compiler and interpreter concepts/designs)&lt;br &gt;
- algorithms and problem analysis/solution&lt;br &gt;
- operating systems&lt;br &gt;
- databases&lt;br &gt;
- networking&lt;br &gt;
- systems&lt;br &gt;
- systems of systems&lt;/p&gt;
&lt;p &gt;A few old standards come to mind:&lt;br &gt;
- Structure and Interpretation of Computer Programs (Sussman, et. al.)&lt;br &gt;
-  The C Programming Language &amp;amp; The Unix Programming Environment (Kernighan and Pike) - still find these useful occasionally&lt;br &gt;
- Knuth (obviously)&lt;br &gt;
- Comer, Tannenbaum, Stallings for networking&lt;/p&gt;
&lt;p &gt;I&#039;m drawing a blank, though, when it comes to &quot;what&#039;s under the hood&quot; - going bottom up through basic computing concepts, hardware architecture, machine and assembly language, assemblers, interpreters, compilers, operating systems.&lt;/p&gt;
&lt;p &gt;So a question to folks here:  what&#039;s stuck with you folks over the years, and/or what have you come across more recently, that might fit the bill?&lt;/p&gt;
&lt;p &gt;Miles Fidelman &lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Mon, 13 May 2013 10:26:20 -0400</pubDate>
</item>
<item>
 <title>We&#039;re doing it wrong....  </title>
 <link>http://lambda-the-ultimate.org/node/4736</link>
 <description>&lt;p &gt;Poul-Henning Kamp makes an interesting case in favor of his opinion that CS education in analyzing algorithm complexity, is focusing on a model of computation which is simplified to the point of being stupid and wrong, and that it leads students to real-world failures in writing performant code.  &lt;/p&gt;
&lt;p &gt;By taking page swapping into account, he has achieved a one to two order-of-magnitude speedup in normal use cases over a &quot;standard, provably optimal&quot; algorithm used throughout computer science.  He argues that the model of computer memory as having uniform access time is and has for several decades, been wrong and misleading to the detriment of the students and standards of performance.  He&#039;s on about virtual memory and disk swapping in particular, but his points are just as valid in a system with a high-speed memory cache fronting a slower main memory, which is essentially all of them.  Here is a link to his article: &lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://queue.acm.org/detail.cfm?id=1814327&quot;&gt;You&#039;re doing it wrong&lt;/a&gt;&lt;/p&gt;
&lt;p &gt;This is of interest to language developers because most people aren&#039;t actually writing those fundamental algorithms anymore.  They&#039;re using the libraries that the language developers provide.  So let&#039;s not provide stupid and wrong, eh? &lt;/p&gt;
&lt;p &gt;On the other hand, I don&#039;t see how his described application (a server) requires the ordering that a tree structure provides.  It isn&#039;t in the business of efficiently providing lots of dynamic ordered lists of the documents it serves; it&#039;s in the business of efficiently providing lots of served documents.  If I were attempting to optimize access to documents, I&#039;d be creating a hash table of pointers to these documents rather than a tree of any description, thus never needing to access more than one page (or maybe two for rehashes in the small fraction of cases where hash bucket overflows have happened) in order to find out where the document is kept. &lt;/p&gt;
&lt;p &gt;On the gripping hand, his described tree structure is perfect for collections that have to support a lot of insertion and deletion while remaining ordered, so I can see it as having good use to implement, say, database tables. &lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Thu, 09 May 2013 12:28:15 -0400</pubDate>
</item>
<item>
 <title>Go-style defer-recover exception handling is better than try-catch style?</title>
 <link>http://lambda-the-ultimate.org/node/4735</link>
 <description>&lt;p &gt;The main advantage of defer-recover exception handling over the try-catch is that it doesn&#039;t complicate the control flow of the program. This not only makes programs using defer-recover more readable, but also makes the implementation of this feature in a language much simpler than implementing try-catch exception handling.&lt;/p&gt;
&lt;p &gt;On the other hand, the main disadvantage (in Go) is that, it does not allow handling exceptions in place close to where exceptions may arise, and the normal execution has to be resumed in the caller of the function that handles the exception.&lt;/p&gt;
&lt;p &gt;Recently I supported Go-style panic/exception handling by defer-recover in my hobby language &lt;a href=&quot;http://daovm.net&quot;&gt;Dao&lt;/a&gt; (it was mentioned &lt;a href=&quot;http://lambda-the-ultimate.org/node/2085&quot;&gt;here&lt;/a&gt; before, but there have been many changes since then). I solved the mentioned problem in Dao by supporting a new type of code block (tentatively called framed block for convenience). Such framed block allows to handle exceptions around the place they arise, and to resume normal execution right after the framed block (namely in the same function where the exception is handled). This is achieved by executing framed blocks in new stack frames, which reuse/share the stack data of their surrounding functions and trigger execution of deferred blocks at exit as normal. You can find more details in a &lt;a href=&quot;http://daovm.net/space/dao/thread/937&quot;&gt;blog&lt;/a&gt; I just wrote.&lt;/p&gt;
&lt;p &gt;Are there many people here finding Go-style exception handling interesting? I wonder if my improvements could make exception handling by defer-recover more interesting, and better than try-catch?&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/1">LtU Forum</category>
 <pubDate>Tue, 07 May 2013 00:33:55 -0400</pubDate>
</item>
</channel>
</rss>
