Lambda the Ultimate - Fun
http://lambda-the-ultimate.org/taxonomy/term/5/0
enHow to Write Seemingly Unhygienic and Referentially Opaque Macros with Syntax-rules
http://lambda-the-ultimate.org/node/5517
<a href="http://okmij.org/ftp/Scheme/Dirty-Macros.pdf">How to Write Seemingly Unhygienic and Referentially
Opaque Macros with Syntax-rules</a><br >
By Oleg Kiselyov<br >
<blockquote >
This paper details how folklore notions of hygiene and referential transparency
of R5RS macros are defeated by a systematic attack. We demonstrate
syntax-rules that seem to capture user identifiers and allow their own identifiers
to be captured by the closest lexical bindings. In other words, we have written
R5RS macros that accomplish what commonly believed to be impossible.
</blockquote>FunMeta-ProgrammingThu, 22 Mar 2018 02:22:21 +0000A unified approach to solving seven programming problems
http://lambda-the-ultimate.org/node/5470
<p >A <a href="http://dl.acm.org/citation.cfm?id=3110252&CFID=805521128&CFTOKEN=83435544&preflayout=flat">fun pearl</a> by William E. Byrd, Michael Ballantyne, Gregory Rosenblatt, and Matthew Might from ICFP: seven programming challenges solved (easily!) using a <I >relational</I> interpreter. One challenge, for example, is to find quines. Another is to find programs that produce different results with lexical vs. dynamic scope.</p>
<p >The interpreter is implemented in miniKanren (of course), inside Racket (of course). </p>FunFunctionalLogic/DeclarativeMon, 04 Sep 2017 18:44:29 +0000p5.js
http://lambda-the-ultimate.org/node/5450
<p >p5.js is a JavaScript library inspired by <a href="https://processing.org/">Processing</a>. Seems it could be a fun way to introduce non-CS types to programming. The <a href="http://hello.p5js.org/">demo</a> is particularly well done; check it out first. The actual home of the project is <a href="https://p5js.org/">here</a>. </p>FunGeneralTue, 11 Jul 2017 19:14:25 +0000Co-hygiene and quantum gravity
http://lambda-the-ultimate.org/node/5441
<p ><b ><a href="http://fexpr.blogspot.com/2017/06/co-hygiene-and-quantum-gravity.html">Co-hygiene and quantum gravity</a></b>. <span title=":P">Some light weekend reading by John Shutt.</span></p>
<p >The post starts with a dazzling proposition:</p>
<blockquote ><p >Gravity corresponds to pure function-application, and the other fundamental forces correspond to side-effects. ... quantum non-locality ("spooky action at a distance") is part of the analog to side-effects ...</p></blockquote>
<p >I can't do it justice here, so if you're interested in John's fascinating take on the relationship between lambda calculus and quantum physics, hop on over!</p>FunHistoryParadigmsTheorySat, 17 Jun 2017 15:11:24 +0000Portable Efficient Assembly Code-generation in High-level Python
http://lambda-the-ultimate.org/node/5251
<blockquote ><p ><a href="https://github.com/Maratyszcza/PeachPy">PeachPy</a> is a Python framework for writing high-performance assembly kernels.</p>
<p >PeachPy aims to simplify writing optimized assembly kernels while preserving all optimization opportunities of traditional assembly.</blockquote>
<p >
You can use the same code to generate assembly for Windows, Unix, and Golang assembly. The library handles the various ABIs automatically. I haven't seen this cool project before.</p>
<p >Among the cool features is the ability to invoke the generated assembly as regular Python functions. Nice.</p>DSLFunThu, 17 Sep 2015 00:53:19 +0000Tracking the Flow of Ideas through the Programming Languages Literature
http://lambda-the-ultimate.org/node/5203
<p ><i >Michael Greenberg, Kathleen Fisher, and David Walker, <a href="http://www.cs.princeton.edu/~mg19/papers/snapl2015.pdf">"Tracking the Flow of Ideas through the Programming Languages Literature"</a>, SNAPL 2015.</i></p>
<blockquote ><p >How have conferences like ICFP, OOPSLA, PLDI, and POPL evolved over the last 20 years? Did generalizing the Call for Papers for OOPSLA in 2007 or changing the name of the umbrella conference to SPLASH in 2010 have any effect on the kinds of papers published there? How do POPL and PLDI papers compare, topic-wise? Is there related work that I am missing? Have the ideas in O’Hearn’s classic paper on separation logic shifted the kinds of papers that appear in POPL? Does a proposed program committee cover the range of submissions expected for the conference? If we had better tools for analyzing the programming language literature, we might be able to answer these questions and others like them in a data-driven way. In this paper, we explore how <i >topic modeling</i>, a branch of machine learning, might help the programming language community better understand our literature.</p></blockquote>
<p >The authors have produced some really interesting visualizations of how the topic content of various conferences has evolved over time (it's interesting to note that OOPSLA isn't really about OO software development any more, and that PLDI appears to have seen an increasing emphasis on verification and test generation).</p>
<p ><b >Also of potential interest to LtU readers:</b> there is a prototype tool at <a href="http://tmpl.weaselhat.com/">http://tmpl.weaselhat.com/</a> that is based on the work presented in this paper. It allows you to upload a paper PDF, and will return the 10 most closely related papers according to the POPL/PLDI topic model. It could be a handy research tool. But, if nothing else, it's a fun way to see what else is related to a paper you're interested in.</p>FunGeneralHistoryMon, 20 Jul 2015 19:49:32 +0000Cakes, Custard, and Category Theory
http://lambda-the-ultimate.org/node/5200
<p ><A href="http://www.eugeniacheng.com/">Eugenia Cheng</A>'s new popular coscience book is out, in the U.K. under the title <A href="http://www.amazon.co.uk/Cakes-Custard-Category Theory-understanding/dp/1781252874/ref=sr_1_1?ie=UTF8&qid=1422244697&sr=8-1&keywords=eugenia+cheng">Cakes, Custard and Category Theory: Easy recipes for understanding complex maths</A>, and in the U.S. under the title <A href="http://www.amazon.com/How-Bake-Pi-Exploration-Mathematics/dp/0465051715/ref=sr_1_1?ie=UTF8&qid=1419352340&sr=8-1keywords=eugenia+cheng">How to Bake Pi: An Edible Exploration of the Mathematics of Mathematics</A>:</p>
<blockquote ><p >
Most people imagine maths is something like a slow cooker: very useful, but pretty limited in what it can do. Maths, though, isn't just a tool for solving a specific problem - and it's definitely not something to be afraid of. Whether you're a maths glutton or have forgotten how long division works (or never really knew in the first place), the chances are you've missed what really makes maths exciting. Calling on a baker's dozen of entertaining, puzzling examples and mathematically illuminating culinary analogies - including chocolate brownies, iterated Battenberg cakes, sandwich sandwiches, Yorkshire puddings and Möbius bagels - brilliant young academic and mathematical crusader Eugenia Cheng is here to tell us why we should all love maths.</p>
<p >From simple numeracy to category theory ('the mathematics of mathematics'), Cheng takes us through the joys of the mathematical world. Packed with recipes, puzzles to surprise and delight even the innumerate, Cake, Custard & Category Theory will whet the appetite of maths whizzes and arithmophobes alike. (Not to mention aspiring cooks: did you know you can use that slow cooker to make clotted cream?) This is maths at its absolute tastiest.<br >
</BLOCKQUOTE></p>
<p >Cheng, one of <A href="https://www.youtube.com/user/TheCatsters">the Catsters</A>, gives a guided tour of mathematical thinking and research activities, and through the core philosophy underlying category theory. This is the kind of book you can give to your grandma and grandpa so they can boast to their friends what her grandchildren are doing (and bake you a nice dessert when you come and visit :) ). A pleasant weekend reading.</p>Category TheoryCritiquesFunGeneralSemanticsTheoryFri, 17 Jul 2015 16:47:21 +0000 Don Syme receives a medal for F#
http://lambda-the-ultimate.org/node/5193
<p ><A href="http://research.microsoft.com/en-us/people/dsyme/">Don Syme</A> receives the Royal Academy of Engineering's <A href="http://www.raeng.org.uk/grants-and-prizes/prizes-and-medals/individual-awards/silver-medal">Silver Medal</A> for <A href="http://www.raeng.org.uk/news/news-releases/2015/july/pioneering-innovators-to-receive-academy-silver-me">his work on F#</A>. The citation reads:<br >
<BLOCKQUOTE ><br >
F# is known for being a clear and more concise language that interoperates well with other systems, and is used in applications as diverse asanalysing the UK energy market to tackling money laundering. It allows programmers to write code with fewer bugs than other languages, so users can get their programme delivered to market both rapidly and accurately. Used by major enterprises in the UK and worldwide, F# is both cross-platform and open source, and includes innovative features such as unit-of-measure inference, asynchronous programming and type providers, which have in turn influenced later editions of C# and other industry languages.<br >
</BLOCKQUOTE></p>
<p >Congratulations!</p>Cross language runtimesFunFunctionalGeneralImplementationObject-FunctionalOOPParadigmsSoftware EngineeringFri, 03 Jul 2015 19:16:06 +0000Conservation laws for free!
http://lambda-the-ultimate.org/node/5078
<p >In this year's <A href="http://popl.mpi-sws.org/2014/">POPL</A>, <A href="bentnib.org">Bob Atkey</A> made a splash by showing how to get <A href="http://bentnib.org/conservation-laws.pdf">from parametricity to conservation laws, via Noether's theorem</A>:</p>
<blockquote ><p >
Invariance is of paramount importance in programming languages and in physics. In programming languages, John Reynolds’ theory of relational parametricity demonstrates that parametric polymorphic programs are invariant under change of data representation, a property that yields “free” theorems about programs just from their types. In physics, Emmy Noether showed that if the action of a physical system is invariant under change of coordinates, then the physical system has a conserved quantity: a quantity that remains constant for all time. Knowledge of conserved quantities can reveal deep properties of physical systems. For example, the conservation of energy, which by Noether’s theorem is a consequence of a system’s invariance under time-shifting.</p>
<p > In this paper, we link Reynolds’ relational parametricity with Noether’s theorem for deriving conserved quantities. We propose an extension of System Fω with new kinds, types and term constants for writing programs that describe classical mechanical systems in terms of their Lagrangians. We show, by constructing a relationally parametric model of our extension of Fω, that relational parametricity is enough to satisfy the hypotheses of Noether’s theorem, and so to derive conserved quantities for free, directly from the polymorphic types of Lagrangians expressed in our system.
</p></blockquote>Category TheoryFunFunctionalLambda CalculusScientific ProgrammingSemanticsTheoryType TheoryTue, 28 Oct 2014 07:52:46 +0000Seemingly impossible programs
http://lambda-the-ultimate.org/node/5074
<p >In case this one went under the radar, at <A href="http://www.cse.psu.edu/popl/12/">POPL'12</A>, <A href="http://www.cs.bham.ac.uk/~mhe/">Martín Escardó</A> gave a tutorial on <A href="http://www.cs.bham.ac.uk/~mhe/.talks/popl2012/escardo-popl2012.pdf">seemingly impossible functional programs</A>:</p>
<blockquote ><p >
Programming language semantics is typically applied to<br >
prove compiler correctness and allow (manual or automatic) program<br >
verification. Certain kinds of semantics can also be applied to<br >
discover programs that one wouldn't have otherwise thought of. This is<br >
the case, in particular, for semantics that incorporate topological<br >
ingredients (limits, continuity, openness, compactness). For example,<br >
it turns out that some function types (X -> Y) with X infinite (but<br >
compact) do have decidable equality, contradicting perhaps popular<br >
belief, but certainly not (higher-type) computability theory. More<br >
generally, one can often check infinitely many cases in finite time.</p>
<p >I will show you such programs, run them fast in surprising instances,<br >
and introduce the theory behind their derivation and working. In<br >
particular, I will study a single (very high type) program that (i)<br >
optimally plays sequential games of unbounded length, (ii) implements<br >
the Tychonoff Theorem from topology (and builds finite-time search<br >
functions for infinite sets), (iii) realizes the double-negation shift<br >
from proof theory (and allows us to extract programs from classical<br >
proofs that use the axiom of countable choice). There will be several<br >
examples in the languages Haskell and Agda.
</p></blockquote>
<p >A <A href="http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/">shorter version</A> (coded in Haskell) appears in Andrej Bauer's blog.</p>Category TheoryFunFunctionalParadigmsSemanticsTheoryWed, 22 Oct 2014 09:57:47 +0000sml-family.org
http://lambda-the-ultimate.org/node/5058
<p >In his <A href="http://existentialtype.wordpress.com/2014/09/26/sml-family-org-up-and-running/">blog</A>, <A href="http://www.cs.cmu.edu/~rwh/">Bob Harper</A>, in joint effort with <A href="http://people.cs.uchicago.edu/~dbm/">Dave MacQueen</A> and <A href="http://www.lars.com/">Lars Bergstrom</A>, announces the launch of <A href="http://sml-family.org">sml-family.org</A>:</p>
<blockquote ><p >
The Standard ML Family project provides a home for online versions of various formal definitions of Standard ML, including the "Definition of Standard ML, Revised" (Standard ML 97). The site also supports coordination between different implementations of the Standard ML (SML) programming language by maintaining common resources such as the documentation for the <A href="http://sml-family.org/Basis/index.html">Standard ML Basis Library</A> and standard test suites. The goal is to increase compatibility and resource sharing between Standard ML implementations. </p>
<p >The site includes a <A href="http://sml-family.org/#History">history section</A> devoted to the history of ML, and of Standard ML in particular. This section will contain a collection of original source documents relating to the design of the language.
</p></blockquote>FunFunctionalHistoryImplementationParadigmsSemanticsTheoryTue, 30 Sep 2014 19:27:43 +0000Scratch jr
http://lambda-the-ultimate.org/node/5035
<p ><a href="http://www.scratchjr.org/">Scratch jr</a> is an iPad version of the Scratch environment, designed with young kids in mind. It is the best kid-oriented programming tool I tried so far, and my five year old has great fun making "movies" with it. As I noted on twitter an hour after installing, the ability to record your own voice and use it for your sprites is a killer feature. Check it out!</p>FunSat, 06 Sep 2014 17:45:56 +0000Functional Geometry and the Traite Ì de Lutherie
http://lambda-the-ultimate.org/node/4915
<p ><a href="http://www.cs.brandeis.edu/~mairson/Papers/ICFP062-mairson.pdf">Functional Geometry and the Traite Ì de Lutherie</a> by Harry Mairson, Brandeis University.</p>
<blockquote ><p >
We describe a functional programming approach to the design of outlines of eighteenth-century string instruments. The approach is based on the research described in Francois Denisâ€™s book, Traite Ì de lutherie. The programming vernacular for Denisâ€™s instructions, which we call functional geometry, is meant to reiterate the historically justified language and techniques of this musical instrument design. The programming metaphor is entirely Euclidean, involving straightedge and compass constructions, with few (if any) numbers, and no Cartesian equations or grid. As such, it is also an interesting approach to teaching programming and mathematics without numerical calculation or equational reasoning.</p>
<p >The advantage of this language-based, functional approach to lutherie is founded in the abstract characterization of common patterns in instrument design. These patterns include not only the abstraction of common straightedge and compass constructions, but of higher-order conceptualization of the instrument design process. We also discuss the role of arithmetic, geometric, harmonic, and subharmonic proportions, and the use of their rational approximants.
</p></blockquote>FunFunctionalThu, 03 Apr 2014 01:29:08 +0000Study finds that when no financial interests are involved programmers choose DECENT languages
http://lambda-the-ultimate.org/node/4914
<blockquote ><p >For immediate release. By studying the troves of open source software on the github service, a recent (and still unpublished) study by a team of empirical computer scientists found that programmers prefer to use DECENT languages. DECENT languages were defined by the team to be languages that conform to a set of minimal ethical standards, including clean syntax, expressive type systems, good package managers and installers, free implementations, no connection to the military-industrial complex and not harming animals. The researchers argue that their data support the view that the prevalent use of indecent languages, Java in particular, is the result of money influencing programmer decisions. The principal author of the study notes that DECENT languages do not necessarily make the most MORAL choices (e.g., many of them are not statically typed). He attributed this to a phenomenon called the "weakness of the will."</p>
<p >Details to follow. </blockquote>FunTue, 01 Apr 2014 05:01:57 +0000Propositions as Types
http://lambda-the-ultimate.org/node/4898
<p ><a href="http://homepages.inf.ed.ac.uk/wadler/papers/propositions-as-types/propositions-as-types.pdf">Propositions as Types</a>, Philip Wadler. Draft, March 2014.</p>
<blockquote ><p >The principle of Propositions as Types links logic to computation. At first sight it appears to be a simple coincidence---almost a pun---but it turns out to be remarkably robust, inspiring the design of theorem provers and programming languages, and continuing to influence the forefronts of computing. Propositions as Types has many names and many origins, and is a notion with depth, breadth, and mystery.</p></blockquote>
<p >Philip Wadler has written a very enjoyable (<em >Like busses: you wait two thousand years for a definition of â€œeffectively calculableâ€, and then three come along at once</em>) paper about propositions as types that is accessible to PLTlettantes.</p>FunHistoryTheoryFri, 07 Mar 2014 16:38:57 +0000