<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://lambda-the-ultimate.org">
<channel>
 <title>Lambda the Ultimate - Object-Functional</title>
 <link>http://lambda-the-ultimate.org/taxonomy/term/12/0</link>
 <description>Combining OOP and functional programming</description>
 <language>en</language>
<item>
 <title>Deca, an LtU-friendly bare metal systems programming language</title>
 <link>http://lambda-the-ultimate.org/deca</link>
 <description>&lt;p &gt;The &lt;a href=&quot;http://code.google.com/p/decac/&quot;&gt;Deca programming language&lt;/a&gt; is &quot;&lt;i &gt;a language designed to provide the advanced features of sophisticated, high-level programming languages while still programming as close as possible to the bare metal. It brings in the functional, object-oriented, and generic programming paradigms without requiring a garbage collector or a threading system, so programmers really only pay in performance for the features they use.&lt;/i&gt;&quot;  The latter link provides a list of features that Deca does, will, and won&#039;t provide.  Features provided include type inference, universally- and existentially- quantified types, and &quot;a strong region-and-effect system that prohibits unsafe escaping pointers and double-free errors&quot;.&lt;/p&gt;
&lt;p &gt;The Deca language and ideas behind it are documented in a thesis, &lt;a href=&quot;http://decac.googlecode.com/files/Deca%20Thesis.pdf&quot;&gt;The design and implementation of a modern systems programming language&lt;/a&gt; (PDF):&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Low-level systems programming has remained one of the most consistently difficult tasks in software engineering, since systems programmers must routinely deal with details that programming-language and systems researchers have preferred to abstract away. At least partially, the difficulty arises from not applying the state of the art in programming-languages research to systems programming. I therefore describe the design and implementation of Deca, a systems language based on modern PL principles. Deca makes use of decades in programming-languages research, particularly drawing from the state of the art in functional programming, type systems, extensible data-types and subroutines, modularity, and systems programming-languages research. I describe Deca&#039;s feature-set, examine the relevant literature, explain design decisions, and give some of the implementation details for Deca language features. I have been writing a compiler for Deca to translate it into machine code, and I describe the overall architecture of this compiler and some of its details.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;The source code for the Deca compiler, decac, is &lt;a href=&quot;http://code.google.com/p/decac/source/checkout&quot;&gt;available here&lt;/a&gt;.  The compiler is implemented in Scala and generates LLVM bytecode.  (The author points out in the comments below that this implementation is a work in progress.)&lt;/p&gt;
&lt;p &gt;The author of Deca is LtU member Eli Gottlieb, who back in 2008 posted in the forum asking for feedback on his language: &lt;a href=&quot;http://lambda-the-ultimate.org/node/2898&quot;&gt;Practical Bits of Making a Compiler for a New Language&lt;/a&gt;.&lt;/p&gt;
&lt;p &gt;There&#039;s some more discussion of Deca over at &lt;a href=&quot;http://news.ycombinator.com/item?id=3413936&quot;&gt;Hacker News&lt;/a&gt;.&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/20">Lambda Calculus</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Sun, 01 Jan 2012 21:40:53 -0500</pubDate>
</item>
<item>
 <title>Thorn</title>
 <link>http://lambda-the-ultimate.org/node/4086</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.thorn-lang.org/&quot;&gt;Thorn&lt;/a&gt; is &lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;a dynamically-typed concurrent language in which lightweight isolated processes communicate by message passing. Thorn includes powerful aggregate data types, a class-based object system, first-class functions, an expressive module system, and a variety of features supporting the gradual evolution of prototype scripts into robust programs.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Thorn is implemented by a compiler targeting the JVM and a Java interpreter, and syntactically resembles Scala, at least superficially. &lt;/p&gt;
&lt;p &gt;One of those &quot;features&quot; is a unique (as far as I know) soft type system:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;In Thorn, the type dyn (for dynamic) is assumed as default (and never written explicitly). At the other extreme, Thorn supports concrete types, as used in statically typed programming languages. A variable of a concrete type T is guaranteed to refer to a value of that type (or a subtype). [...] While concrete types help with performance and correctness, they introduce restrictions on how software can be used and make rapid development more difficult; scripting languages do not favor them.&lt;/p&gt;
&lt;p &gt;As an intermediate step between the two, we propose like types, getting some of the safety of concrete types while retaining the flexibility of dynamic types. Concrete types for var x:T or fun f(x:T) are used in two main places. At a method call x.m(), a static type check ensures that x actually has an m method. At a binding or assignment, like x := y; or f(y), a static type check can ensure that y&#039;s value makes sense to assign to x, can reject it entirely, or can inspire a dynamic check. Like types, var x: like T or fun f(x:like T), give the expressive power of concrete type checks on method calls, but do not constrain binding or&lt;br &gt;
assignment. They do require runtime checks and thus may cause programs to fail with runtime type errors: sometimes fewer and never more than dynamic types do.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Concurrency is also a little odd:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;Every component (marked by the keyword spawn) runs in a different JVM. Component handles contains sufficient information to identify the node and port on which the component runs.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;A couple of papers are linked to the home page; &lt;a href=&quot;http://www.cs.purdue.edu/homes/jv/pubs/oopsla09.pdf&quot;&gt;&quot;Thorn - Robust, Concurrent, Extensible Scripting on the JVM&quot;&lt;/a&gt;, by Bard Bloom, et. al., is a general description of the language, from which come the quotes above; and &lt;a href=&quot;http://moscova.inria.fr/~zappa/projects/liketypes&quot;&gt;&quot;Integrating Typed and Untyped Code in a Scripting Language&quot;&lt;/a&gt;, by Tobias Wrigstad, et. al., with more information about like types.&lt;/p&gt;
&lt;p &gt;I have not seen Thorn here before. Apologies if I have just missed it.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/23">Cross language runtimes</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/16">Parallel/Distributed</category>
 <pubDate>Wed, 22 Sep 2010 18:22:40 -0400</pubDate>
</item>
<item>
 <title>Type Classes as Objects and Implicits</title>
 <link>http://lambda-the-ultimate.org/node/4039</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://ropas.snu.ac.kr/~bruno/papers/TypeClasses.pdf&quot;&gt;Type Classes as Objects and Implicits&lt;/a&gt;&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
&lt;em &gt;Type classes&lt;/em&gt; were originally developed in Haskell as a disciplined alternative to ad-hoc polymorphism. Type classes have been shown to provide a type-safe solution to important challenges in software engineering and programming languages such as, for example, &lt;em &gt;retroactive extension&lt;/em&gt; of programs. They are also recognized as a good mechanism for &lt;em &gt;concept&lt;/em&gt;-based &lt;em &gt;generic programming&lt;/em&gt; and, more recently, have evolved into a mechanism for type-level computation. This paper presents a lightweight approach to type classes in object-oriented (OO) languages with generics using the CONCEPT pattern and &lt;em &gt;implicits&lt;/em&gt; (a type-directed implicit parameter passing mechanism).&lt;/p&gt;
&lt;p &gt;This paper also shows how Scala’s type system conspires with implicits to enable, and even surpass, many common extensions of the Haskell type class system, making Scala ideally suited for generic programming in the large.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Martin Odersky and team&#039;s design decisions around how to do type classes in a unified OO and FP language continue to bear fascinating fruit. Implicits look less and less like &quot;poor man&#039;s type classes,&quot; and more and more like an improvement upon type classes, in my opinion given a quick read of this paper.&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/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/32">Scala</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Wed, 04 Aug 2010 18:25:48 -0400</pubDate>
</item>
<item>
 <title>Objects to Unify Type Classes and GADTs</title>
 <link>http://lambda-the-ultimate.org/node/3837</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.cs.mu.oz.au/~sulzmann/manuscript/objects-unify-type-classes-gadts.ps&quot;&gt;Objects to Unify Type Classes and GADTs&lt;/a&gt;, by Bruno C. d. S. Oliveira and Martin Sulzmann:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;We propose an Haskell-like language with the goal of unifying type classes and generalized algebraic datatypes (GADTs) into a single class construct. We treat classes as ﬁrst-class types and we use objects (instead of type class instances and data constructors) to define the values of those classes. We recover the ability to define functions by pattern matching by using sealed classes. The resulting language is simple and intuitive and it can be used to define, with similar convenience, the same programs that we would define in Haskell. Furthermore, unlike Haskell, dictionaries (or&lt;br &gt;
objects) can be explicitly (as well as implicitly) passed to functions and we can program in a simple object-oriented style directly.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;A very interesting paper on generalizing and unifying type classes and GADTs. Classes are now first-class values, resulting in a language that resembles a traditional, albeit more elegant, object-oriented language, and which supports a form of first-class &quot;lightweight modules&quot;.&lt;/p&gt;
&lt;p &gt;The language supports the traditional use of implicit type class dispatch, but also supports explicit dispatch, unlike Haskell. The authors suggest this could eliminate much of the duplication in the Haskell standard library of functions that take a type class or an explicit function, eg. insert/insertBy and sort/sortBy, although some syntactic sugar is needed to make this more concise.&lt;/p&gt;
&lt;p &gt;Classes are open to extension by default, although a class can also be explicitly specified as &quot;sealed&quot;, in which case extension is forbidden and you can pattern match on the cases. Furthermore, GADTs can now also carry methods, thus introducing dispatch to algebraic types. This fusion does not itself solve the expression problem, though it does ease the burden through the first-class support of both types of extension. You can see the Scala influences here.&lt;/p&gt;
&lt;p &gt;I found this paper via the &lt;a href=&quot;http://www.reddit.com/r/haskell/comments/b4o6g/objects_to_unify_type_classes_and_gadts_ps/&quot;&gt;Haskell sub-reddit&lt;/a&gt;, which also links to &lt;a href=&quot;http://sneezy.cs.nott.ac.uk/fun/feb-08/bruno-slides.pdf&quot;&gt;a set of slides&lt;/a&gt;. The authors acknowledge Scala as an influence, and as future work, suggest extensions like type families and to support more module-like features, such as nesting and opaque types.&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/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/14">OOP</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/19">Theory</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Mon, 22 Feb 2010 16:51:40 -0500</pubDate>
</item>
<item>
 <title>ActorScript(TM): Industrial strength integration of local and nonlocal concurrency for Client-cloud Computing</title>
 <link>http://lambda-the-ultimate.org/node/3717</link>
 <description>&lt;a href=&quot;http://arxiv.org/abs/0907.3330&quot;&gt;ActorScript(TM): Industrial strength integration of local and nonlocal concurrency for Client-cloud Computing&lt;/a&gt;
by Carl Hewitt, 2009.
&lt;blockquote &gt;
ActorScript is based on a mathematical model of computation that treats “Actors” as the universal primitives of concurrent digital computation [Hewitt, Bishop, and Steiger 1973; Hewitt 1977]. Actors been used both as a framework for a theoretical understanding of concurrency, and as the theoretical basis for several practical implementations of concurrent systems.&lt;/blockquote&gt;
I hope I do not need to introduce Carl Hewitt or his Actor model. This paper is a modern attempt to expose that model via a practical PL.</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/13">Logic/Declarative</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <pubDate>Mon, 14 Dec 2009 08:47:46 -0500</pubDate>
</item>
<item>
 <title>Factor Mixins</title>
 <link>http://lambda-the-ultimate.org/node/3463</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://factor-language.blogspot.com/2007/08/mixins.html&quot;&gt;Mixins&lt;/a&gt;, a very interesting post from Slava Pestov&#039;s Factor blog.&lt;/p&gt;
&lt;blockquote &gt;
&lt;p &gt;Factor&#039;s object system allows the following operations without forcing unnecessary coupling:&lt;/p&gt;
&lt;p &gt;    * Defining new operations over existing types&lt;br &gt;
    * Defining existing operations over new types&lt;br &gt;
    * Importing existing mixin method suites into new types&lt;br &gt;
    * Importing new method suites into existing types&lt;br &gt;
    * Defining new operations in existing mixin method suites&lt;br &gt;
    * Defining new mixin method suites which implement existing operations&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;That&#039;s pretty much what I want from an object-functional language.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/17">Software Engineering</category>
 <pubDate>Thu, 18 Jun 2009 00:00:16 -0400</pubDate>
</item>
<item>
 <title>Capabilities for External Uniqueness</title>
 <link>http://lambda-the-ultimate.org/node/3266</link>
 <description>&lt;p &gt;Philipp Haller and &lt;a href=&quot;http://lambda-the-ultimate.org/user/2865&quot;&gt;Martin Odersky&lt;/a&gt; have submitted &lt;a href=&quot;http://lamp.epfl.ch/~phaller/uniquerefs/&quot;&gt;Capabilities for External Uniqueness&lt;/a&gt; to OOPSLA&#039;09. &lt;/p&gt;
&lt;blockquote &gt;
&lt;p &gt;    Unique object references have many important applications in object-oriented programming. For instance, with sufficient encapsulation properties they enable safe and efficient transfer of message objects between concurrent processes. However, it is a long-standing challenge to integrate unique references into practical object-oriented programming languages.&lt;/p&gt;
&lt;p &gt;    This paper introduces a new approach to external uniqueness. The idea is to use capabilities for enforcing both aliasing constraints that guarantee external uniqueness, and linear consumption of unique references. We formalize our approach as a type system, and prove a type preservation theorem. Type safety rests on an alias invariant that builds on a novel formalization of external uniqueness.&lt;/p&gt;
&lt;p &gt;    We show how a capability-based type system can be used to integrate external uniqueness into widely available object-oriented programming languages. Practical experience suggests that our system allows adding uniqueness information to common collection classes in a simple and concise way.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;A prototype plugin for the Scala compiler can be found on the same page.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/16">Parallel/Distributed</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Thu, 09 Apr 2009 12:26:11 -0400</pubDate>
</item>
<item>
 <title>Generics of a Higher Kind</title>
 <link>http://lambda-the-ultimate.org/node/2579</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.cs.kuleuven.be/~adriaan/files/genericshk/tcpoly.pdf&quot;&gt;Generics of a Higher Kind&lt;/a&gt;. Adriaan Moors, Frank Piessens, and Martin Odersky.&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;With Java 5 and C# 2.0, first-order parametric polymorphism was introduced in mainstream object-oriented programming languages under the name of generics. Although the first-order variant of generics is very useful, it also imposes some restrictions: it is possible to abstract over a type, but the resulting type constructor cannot be abstracted over. This can lead to code duplication. We removed this restriction in Scala, by allowing type constructors as type parameters and abstract types. This paper presents the design and implementation of the resulting type constructor polymorphism. It combines type constructor polymorphism with implicit parameters to yield constructs similar to, and at times more expressive than, Haskell’s constructor type classes. The paper also studies interactions with other object-oriented language constructs, and discusses the gains in expressiveness.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Many readers will already be aware that Scala has added support for higher-kinded generics, related to Haskell&#039;s type constructor classes. I believe Scala is the first language to provide this capability in an OO &quot;generics&quot; framework. This ECOOP submission presents this work, with many practical examples.&lt;/p&gt;
&lt;p &gt;(Consider this penance for my last post...)&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/32">Scala</category>
 <pubDate>Thu, 20 Dec 2007 14:54:02 -0500</pubDate>
</item>
<item>
 <title>OCaml Light: A Formal Semantics For a Substantial Subset of the Objective Caml Language</title>
 <link>http://lambda-the-ultimate.org/node/2544</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.cl.cam.ac.uk/~so294/ocaml/&quot;&gt;OCaml Light: a formal semantics for a substantial subset of the Objective Caml language.&lt;/a&gt;&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
OCaml light is a formal semantics for a substantial subset of the Objective Caml language. It is written in Ott, and it comprises a small-step operational semantics and a syntactic, non-algorithmic type system. A type soundness theorem has been proved and mechanized using the HOL-4 proof assistant, thereby ensuring that the proof is free from errors. To ensure that the operational semantics accurately models Objective Caml, an executable version of the semantics has been created (and proved equivalent in HOL to the original, relational version) and tested on a number of small test cases.&lt;/p&gt;
&lt;p &gt;Note that while we have tried to make the semantics accurate, we are not part of the OCaml development team - this is in no sense a normative specification of the implemented language.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;From a team including Peter Sewell (&lt;a href=&quot;http://lambda-the-ultimate.org/node/163&quot;&gt;Acute&lt;/a&gt;, &lt;a href=&quot;http://lambda-the-ultimate.org/node/1460&quot;&gt;HashCaml&lt;/a&gt;, &lt;a href=&quot;http://lambda-the-ultimate.org/node/2002&quot;&gt;Ott&lt;/a&gt;).&lt;/p&gt;
&lt;p &gt;I continue to believe that things are heating up nicely in mechanized metatheory, which, in the multicore/multiprocessor world in which we now live, is extremely good news.&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/6">General</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/8">Implementation</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/29">Semantics</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/19">Theory</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Mon, 26 Nov 2007 13:33:45 -0500</pubDate>
</item>
<item>
 <title>Metaprogramming with Traits</title>
 <link>http://lambda-the-ultimate.org/node/2394</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://people.cs.uchicago.edu/~jhr/papers/2007/ecoop-traits.pdf&quot;&gt;Metaprogramming with Traits&lt;/a&gt;, Aaron Turon and John Reppy. ECOOP 2007&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
In many domains, classes have highly regular internal structure. For example, so-called business objects often contain boilerplate code for mapping database fields to class members. The boilerplate code must be repeated per-field for every class, because existing mechanisms for constructing classes do not provide a way to capture and reuse such member-level structure. As a result, programmers often resort to ad ho code generation. This paper presents a lightweight mechanism for specifying and reusing member-level structure in Java programs. The proposal is based on a modest extension to traits that we have termed trait-based metaprogramming. Although the semantics of the mechanism are straightforward, its type theory is difficult to reconcile with nominal subtyping. We achieve reconciliation by introducing a hybrid structural/nominal type system that extends Java&#039;s type system. The paper includes a formal calculus defined by translation to Featherweight Generic Java.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;This paper explains how to scratch an itch I&#039;ve had for a long, long time -- uniformly generating groups of fields and methods, including &lt;em &gt;computation&lt;/em&gt; of the field/method names. Something like this would be quite useful in an ML-like language&#039;s module system, too.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Mon, 13 Aug 2007 11:55:16 -0400</pubDate>
</item>
<item>
 <title>Python in Pardus Linux</title>
 <link>http://lambda-the-ultimate.org/node/2301</link>
 <description>&lt;p &gt;
&lt;a href=&quot;http://www.pardus.org.tr/eng/projects/comar/PythonInPardus.html&quot;&gt;Pardus Linux&lt;/a&gt; is a case study of functional Python.  It&#039;s a Linux distribution built from semi-scratch, the main focii being &lt;a href=&quot;http://www.pardus.org.tr/eng/projects/pisi/PiSi.html&quot;&gt;package management&lt;/a&gt; and init subsystems - places where C and shell script make poor sense.  A funded group has finally tackled these issues.
&lt;/p&gt;

&lt;p &gt;
&lt;blockquote &gt;
A package management software deals a lot with sets, lists, and dependency graphs....We have extensively used functional operators (map, filter, reduce) and list comprehensions, even metaclasses are used in a few places.
&lt;/blockquote&gt;
&lt;/p&gt;

&lt;p &gt;
Someone nudge Guido.  Scheme or Oz might have been the better choice, but give them credit.  They admit frankly to social acceptance issues.
&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/13">Logic/Declarative</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/26">Python</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/27">XML</category>
 <pubDate>Tue, 19 Jun 2007 18:55:33 -0400</pubDate>
</item>
<item>
 <title>Combining Total and Ad Hoc Extensible Pattern Matching in a Lightweight Language Extension</title>
 <link>http://lambda-the-ultimate.org/node/2224</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://research.microsoft.com/research/pubs/view.aspx?0rc=p&amp;amp;type=technical+report&amp;amp;id=1275&quot;&gt;Combining Total and Ad Hoc Extensible Pattern Matching in a Lightweight Language Extension&lt;/a&gt;. Don Syme, Gregory Neverov and James Margetson.&lt;br &gt;
&lt;blockquote &gt;&lt;p &gt;
Pattern matching of algebraic data types (ADTs) is a standard feature in typed functional programming languages but it is well known that it interacts poorly with abstraction. While several partial solutions to this problem have been proposed, few have been implemented or used. This paper describes an extension to the .NET language F# called ``Active Patterns&#039;&#039;, which supports pattern matching over abstract representations of generic heterogeneous data such as XML and term structures, including where these are represented via object models in other .NET languages. Our design is the first to incorporate both ad hoc pattern matching functions for partial decompositions and ``views&#039;&#039; for total decompositions, and yet remains a simple and lightweight extension. We give a description of the language extension along with numerous motivating examples. Finally we describe how this feature would interact with other reasonable and related language extensions: existential types quantified at data discrimination tags, GADTs, and monadic generalizations of pattern matching.&lt;/blockquote&gt;
&lt;p &gt;
Quite related to the recent discussions of the relationships between libraries, frameworks and language features.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/17">Software Engineering</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Thu, 03 May 2007 06:40:27 -0400</pubDate>
</item>
<item>
 <title>A Real-World Use of Lift, a Scala Web Application Framework</title>
 <link>http://lambda-the-ultimate.org/node/2147</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://blog.lostlake.org/index.php?/archives/45-A-real-world-use-of-lift.html#extended&quot;&gt;A Real-World Use of Lift&lt;/a&gt;&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Well, &lt;i &gt;lift&lt;/i&gt; is actually being used in production. I converted a Rails app to &lt;i &gt;lift&lt;/i&gt; and it was a very interesting experience...&lt;/p&gt;
&lt;p &gt;Then we did some benchmarking.  For single request processing, the &lt;i &gt;lift&lt;/i&gt; code, running inside Tomcat, ran 4 times faster than the Rails code running inside Mongrel.  However, the CPU utilization was less than 5% in the &lt;i &gt;lift&lt;/i&gt; version, where it was 100% of 1 CPU (on a dual core machine) for the Rails version.  For multiple simultaneous requests being made from multiple machines, we&#039;re seeing better than 20x performance of the &lt;i &gt;lift&lt;/i&gt; code versus the Rails code with 5 Mongrel instances.  Once again, the &lt;i &gt;lift&lt;/i&gt; code is not using very much CPU and the Rails code is pegging both CPUs.&lt;/p&gt;
&lt;p &gt;In terms of new features, we&#039;ve been able to add new features to the &lt;i &gt;lift&lt;/i&gt; code with fewer defects than with the Rails code.  Our Rails code had 70% code coverage.  We discovered that anything shy of 95% code coverage with Rails means that type-os turn into runtime failures.  We do not have any code coverage metrics for the &lt;i &gt;lift&lt;/i&gt; code, but we have seen only 1 defect that&#039;s been checked in in the 2 weeks since we started using &lt;i &gt;lift&lt;/i&gt; (vs. an average of 1 defect per checkin with the Rails code.)&lt;/p&gt;
&lt;p &gt;So, yes, I&#039;m pimping my own framework, and yes, I&#039;m able to do with &lt;i &gt;lift&lt;/i&gt; what guys like DHH are able to do with Rails, so the comparison is, in some ways, unfair.&lt;/p&gt;
&lt;p &gt;On the other hand, Scala and &lt;i &gt;lift&lt;/i&gt; code can be as brief and expressive as Ruby code.   &lt;i &gt;lift&lt;/i&gt; offers developers amazing productivity gains vs. traditional Java web frameworks, just as Rails does.  On the other hand, &lt;i &gt;lift&lt;/i&gt; code scales much better than Rails code.  &lt;i &gt;lift&lt;/i&gt; code is type-safe and the compiler becomes your friend (this does not mean you should not write tests, but it means that your tests can focus on the algorithm rather than making sure there are no type-os in variable and method names.)
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;I &lt;em &gt;promise&lt;/em&gt; that &quot;Dave Pollak&quot; is not a pseudonym for &quot;Paul Snively.&quot;&lt;/p&gt;
&lt;p &gt;&lt;b &gt;Update:&lt;/b&gt; I guess the self-deprecating humor hasn&#039;t worked, some 400+ reads later. Although the caveat that Dave offers about trying to objectively compare his own framework with Ruby on Rails is well-taken, I think that this nevertheless is an important marker in applying a very PLT-driven language and framework, Scala and lift, to a very realistic application, especially given that it&#039;s a rewrite from a currently-popular language and framework, Ruby and Rails. We admitted proponents of static typing and weird languages are constantly being asked for this sort of thing, and while it&#039;s doubtful that this adds anything to the PLT discussion &lt;i &gt;per se&lt;/i&gt;&amp;mdash;at least until we have a chance to dig into lift and see how Scala&#039;s design uniquely supports it&amp;mdash;I thought people might find the Scala connection worth commenting on.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/32">Scala</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/17">Software Engineering</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/27">XML</category>
 <pubDate>Thu, 22 Mar 2007 12:06:24 -0400</pubDate>
</item>
<item>
 <title>Threads in JavaScript?</title>
 <link>http://lambda-the-ultimate.org/node/2065</link>
 <description>&lt;p &gt;Threads in JavaScript? &quot;&lt;a href=&quot;http://weblogs.mozillazine.org/roadmap/archives/2007/02/threads_suck.html&quot;&gt;Over your dead body&lt;/a&gt;,&quot; says Brendan.&lt;/p&gt;
&lt;p &gt;But Neil Mix begs to differ -- &lt;a href=&quot;http://www.neilmix.com/2007/02/07/threading-in-javascript-17/&quot;&gt;they&#039;re already there&lt;/a&gt;!&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;http://www.neilmix.com/2007/02/07/threading-in-javascript-17/&quot;&gt;Neil&#039;s latest blog post&lt;/a&gt; presents a cool hack combining JavaScript 1.7&#039;s &lt;a href=&quot;http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Generators&quot;&gt;generators&lt;/a&gt; with &lt;a href=&quot;http://lambda-the-ultimate.org/classic/message2428.html&quot;&gt;trampolined style&lt;/a&gt; to implement very lightweight cooperative threads.&lt;/p&gt;
&lt;p &gt;The &lt;a href=&quot;http://www.neilmix.com/demos/js17threading/Thread.js&quot;&gt;implementation&lt;/a&gt; weighs in at a breathtakingly small 4k.&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/31">Javascript</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/16">Parallel/Distributed</category>
 <pubDate>Tue, 13 Feb 2007 19:43:50 -0500</pubDate>
</item>
<item>
 <title>Ralf Lammel: Stop dysfunctional programming</title>
 <link>http://lambda-the-ultimate.org/node/2007</link>
 <description>&lt;blockquote &gt;&lt;p &gt;
40 years after the invention of OO, I am ready to appreciate objects quite a bit because I can use them in combination with functional programming. Naturally, I call this mix functional OO programming. (I don’t quite count functional objects in C++ or ‘functors’ in Java, a misnomer BTW, as functional programming.)&lt;/blockquote&gt;
&lt;p &gt;
Ralf &lt;a href=&quot;http://blogs.msdn.com/ralflammel/archive/2007/01/19/stop-dysfunctional-programming-go-for-functional-oo-programming.aspx&quot;&gt;lists &lt;/a&gt; several of his papers that apply the notion of functional OO programming. He also shares his wish list for future versions of C#.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <pubDate>Sat, 27 Jan 2007 05:46:19 -0500</pubDate>
</item>
</channel>
</rss>

