<?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>Platonic C# - Managing Referential Transparency through Unique Types</title>
 <link>http://lambda-the-ultimate.org/node/5666</link>
 <description>&lt;p &gt;The idea of &lt;a href=&quot;https://github.com/cdiggins/Platonic.CSharp&quot;&gt;Platonic C#&lt;/a&gt; is to enforce referential transparency within the context of C#, by enforcing a set of rules around defaulting to immutability of data structures and requiring uniqueness of instances of mutable types. &lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <pubDate>Sat, 04 Mar 2023 20:11:56 +0000</pubDate>
</item>
<item>
 <title>RustBelt: Securing the Foundations of the Rust Programming Language</title>
 <link>http://lambda-the-ultimate.org/node/5448</link>
 <description>&lt;p &gt;&lt;a href=&quot;https://www.ralfj.de/blog/2017/07/08/rustbelt.html&quot;&gt;RustBelt: Securing the Foundations of the Rust Programming Language&lt;/a&gt; by Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, Derek Dreyer:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Rust is a new systems programming language that promises to overcome the seemingly fundamental tradeoff between high-level safety guarantees and low-level control over resource management. Unfortunately, none of Rust’s safety claims have been formally proven, and there is good reason to question whether they actually hold. Specifically, Rust employs a strong, ownership-based type system, but then extends the expressive power of this core type system through libraries that internally use unsafe features. In this paper, we give the first formal (and machine-checked) safety proof for a language representing a realistic subset of Rust. Our proof is extensible in the sense that, for each new Rust library that uses unsafe features, we can say what verification condition it must satisfy in order for it to be deemed a safe extension to the language. We have carried out this verification for some of the most important libraries that are used throughout the Rust ecosystem.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Rust is definitely pushing the envelope in a new direction, but there&#039;s always a little wariness around using libraries that make use of unsafe features, since &quot;safety with performance&quot; is a main reason people want to use Rust. So this is a great step in the right direction!&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/21">Type Theory</category>
 <pubDate>Mon, 10 Jul 2017 15:14:45 +0000</pubDate>
</item>
<item>
 <title>Automating Ad hoc Data Representation Transformations</title>
 <link>http://lambda-the-ultimate.org/node/5378</link>
 <description>&lt;p &gt;&lt;a href=&quot;https://yanniss.github.io/adrt-oopsla15.pdf&quot;&gt;Automating Ad hoc Data Representation Transformations&lt;/a&gt; by Vlad Ureche, Aggelos Biboudis, Yannis Smaragdakis, and Martin Odersky:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
To maximize run-time performance, programmers often specialize their code by hand, replacing library collections and containers by custom objects in which data is restructured for efficient access. However, changing the data representation is a tedious and error-prone process that makes it hard to test, maintain and evolve the source code.&lt;/p&gt;
&lt;p &gt;We present an automated and composable mechanism that allows programmers to safely change the data representation in delimited scopes containing anything from expressions to entire class definitions. To achieve this, programmers define a transformation and our mechanism automatically and transparently applies it during compilation, eliminating the need to manually change the source code.&lt;/p&gt;
&lt;p &gt;Our technique leverages the type system in order to offer correctness guarantees on the transformation and its interaction with object-oriented language features, such as dynamic dispatch, inheritance and generics.&lt;/p&gt;
&lt;p &gt;We have embedded this technique in a Scala compiler plugin and used it in four very different transformations, ranging from improving the data layout and encoding, to&lt;br &gt;
retrofitting specialization and value class status, and all the way to collection deforestation. On our benchmarks, the technique obtained speedups between 1.8x and 24.5x.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;This is a realization of an idea that has been briefly discussed here on LtU a few times, whereby a program is written using high-level representations, and the user has the option to provide a lowering to a more efficient representation after the fact.&lt;/p&gt;
&lt;p &gt;This contrasts with the typical approach of providing efficient primitives, like primitive unboxed values, and leaving it to the programmer to compose them efficiently up front.&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/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/17">Software Engineering</category>
 <pubDate>Thu, 22 Sep 2016 18:29:03 +0000</pubDate>
</item>
<item>
 <title>Type Checking Modular Multiple Dispatch with Parametric Polymorphism and Multiple Inheritance</title>
 <link>http://lambda-the-ultimate.org/node/5322</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.mpi-sws.org/~skilpat/papers/multipoly.pdf&quot;&gt;Type Checking Modular Multiple Dispatch with Parametric Polymorphism and Multiple Inheritance&lt;/a&gt; by Eric Allen, Justin Hilburn, Scott Kilpatrick, Victor Luchangco, Sukyoung Ryu, David Chase, Guy L. Steele Jr.:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
In previous work, we presented rules for defining overloaded functions that ensure type safety under symmetric multiple dispatch in an object-oriented language with multiple inheritance, and we showed how to check these rules without requiring the entire type hierarchy to be known, thus supporting modularity and extensibility. In this work, we extend these rules to a language that supports parametric polymorphism on both classes and functions.&lt;/p&gt;
&lt;p &gt;In a multiple-inheritance language in which any type may be extended by types in other modules, some overloaded functions that might seem valid are correctly rejected by our rules. We explain how these functions can be permitted in a language that additionally supports an exclusion relation among types, allowing programmers to declare “nominal exclusions” and also implicitly imposing exclusion among different instances of each polymorphic type. We give rules for computing the exclusion relation, deriving many type exclusions from declared and implicit ones.&lt;/p&gt;
&lt;p &gt;We also show how to check our rules for ensuring the safety of overloaded functions. In particular, we reduce the problem of handling parametric polymorphism to one of determining subtyping relationships among universal and existential types. Our system has been implemented as part of the open-source Fortress compiler.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;&lt;a href=&quot;http://lambda-the-ultimate.org/node/4570&quot;&gt;Fortress&lt;/a&gt; was briefly covered here a couple of times, as were multimethods and &lt;a href=&quot;http://lambda-the-ultimate.org/node/3061&quot;&gt;multiple dispatch&lt;/a&gt;, but this paper really generalizes and nicely summarizes &lt;a href=&quot;http://web.cs.ucla.edu/~todd/research/iandc.pdf&quot;&gt;previous work&lt;/a&gt; on statically typed modular multimethods, and does a good job explaining the typing rules in an accessible way. The integration with parametric polymorphism I think is key to applying multimethods in other domains which may want modular multimethods, but not multiple inheritance.&lt;/p&gt;
&lt;p &gt;The &lt;a href=&quot;http://www.cs.yale.edu/homes/jieung/Publication/cpp_paper.pdf&quot;&gt;Formalization in COQ&lt;/a&gt; might also be of interest to some.&lt;/p&gt;
&lt;p &gt;Also, another interesting point is Fortress&#039; use of second-class intersection and union types to simplify type checking.&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/19">Theory</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Fri, 01 Apr 2016 01:25:22 +0000</pubDate>
</item>
<item>
 <title>Xavier Leroy will receive the Royal Society&#039;s 2016 Milner Award </title>
 <link>http://lambda-the-ultimate.org/node/5254</link>
 <description>&lt;p &gt;The &lt;A href=&quot;https://royalsociety.org/&quot;&gt;Royal Society&lt;/A&gt; will award &lt;A href=&quot;http://pauillac.inria.fr/~xleroy&quot;&gt;Xavier Leroy&lt;/A&gt; the &lt;A href=&quot;https://royalsociety.org/grants-schemes-awards/awards/milner-award/&quot;&gt;Milner Award 2016&lt;/A&gt;&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;... in recognition of his research on the OCaml functional programming language and on the formal verification of compilers.&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p &gt;Xavier&#039;s replied:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;It is very moving to see how far we have come, from Milner&#039;s great ideas of the 1970s to tools as powerful and as widely used as OCaml and Coq.&lt;/BLOCKQUOTE&gt;&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/14">OOP</category>
 <pubDate>Fri, 18 Sep 2015 14:48:40 +0000</pubDate>
</item>
<item>
 <title>Reagents: Expressing and Composing Fine-grained Concurrency</title>
 <link>http://lambda-the-ultimate.org/node/5237</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.ccs.neu.edu/home/turon/reagents.pdf&quot;&gt;Reagents: Expressing and Composing Fine-grained Concurrency&lt;/a&gt;, by Aaron Turon:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;Efficient communication and synchronization is crucial for finegrained parallelism. Libraries providing such features, while indispensable, are difficult to write, and often cannot be tailored or composed to meet the needs of specific users. We introduce &lt;em &gt;reagents&lt;/em&gt;, a set of combinators for concisely expressing concurrency algorithms. Reagents scale as well as their hand-coded counterparts, while providing the composability existing libraries lack.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;This is a pretty neat approach to writing concurrent code, which lies somewhere between manually implementing low-level concurrent algorithms and STM. Concurrent algorithms are expressed and composed semi-naively, and Reagents automates the retries for you in case of thread interference (for transient failure of CAS updates), or they block waiting for input from another thread (in case of permanent failure where no input is available).&lt;/p&gt;
&lt;p &gt;The core seems to be k-CAS with synchronous communication between threads to coordinate reactions on shared state. The properties seem rather nice, as Aaron describes:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;When used in isolation, reagents are &lt;eM &gt;guaranteed&lt;/eM&gt; to perform only the CASes that the hand-written algorithm would, so they introduce no overhead on shared-memory operations; by recoding an algorithm use reagents, you lose nothing. Yet unlike hand-written algorithms, reagents can be composed using choice, tailored with new blocking behavior, or combined into larger atomic blocks.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;The benchmarks in section 6 look promising. This appears to be work towards Aaron&#039;s &lt;a href=&quot;https://www.mpi-sws.org/~turon/turon-thesis.pdf&quot;&gt;thesis&lt;/a&gt; which provides many more details.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/11">Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/8">Implementation</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <pubDate>Mon, 24 Aug 2015 23:05:12 +0000</pubDate>
</item>
<item>
 <title> Don Syme receives a medal for F#</title>
 <link>http://lambda-the-ultimate.org/node/5193</link>
 <description>&lt;p &gt;&lt;A href=&quot;http://research.microsoft.com/en-us/people/dsyme/&quot;&gt;Don Syme&lt;/A&gt; receives the Royal Academy of Engineering&#039;s &lt;A href=&quot;http://www.raeng.org.uk/grants-and-prizes/prizes-and-medals/individual-awards/silver-medal&quot;&gt;Silver Medal&lt;/A&gt; for &lt;A href=&quot;http://www.raeng.org.uk/news/news-releases/2015/july/pioneering-innovators-to-receive-academy-silver-me&quot;&gt;his work on F#&lt;/A&gt;. The citation reads:&lt;br &gt;
&lt;BLOCKQUOTE &gt;&lt;br &gt;
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.&lt;br &gt;
&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p &gt;Congratulations!&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/5">Fun</category>
 <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/14">OOP</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/10">Paradigms</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/17">Software Engineering</category>
 <pubDate>Fri, 03 Jul 2015 19:16:06 +0000</pubDate>
</item>
<item>
 <title>Pure Subtype Systems</title>
 <link>http://lambda-the-ultimate.org/node/4835</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://stuff.thedeemon.com/pure-subtype-systems-popl10-hutchins.pdf&quot;&gt;Pure Subtype Systems&lt;/a&gt;, by DeLesley S. Hutchins:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;This paper introduces a new approach to type theory called pure subtype systems. Pure subtype systems differ from traditional approaches to type theory (such as pure type systems) because the theory is based on subtyping, rather than typing. Proper types and typing are completely absent from the theory; the subtype relation is defined directly over objects. The traditional typing relation is shown to be a special case of subtyping, so the loss of types comes without any loss of generality.&lt;/p&gt;
&lt;p &gt;Pure subtype systems provide a uniform framework which seamlessly integrates subtyping with dependent and singleton types. The framework was designed as a theoretical foundation for several problems of practical interest, including mixin modules, virtual classes, and feature-oriented programming.&lt;/p&gt;
&lt;p &gt;The cost of using pure subtype systems is the complexity of the meta-theory. We formulate the subtype relation as an abstract reduction system, and show that the theory is sound if the underlying reductions commute. We are able to show that the reductions commute locally, but have thus far been unable to show that they commute globally. Although the proof is incomplete, it is &quot;close enough&quot; to rule out obvious counter-examples. We present it as an open problem in type theory.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;A thought-provoking take on type theory using subtyping as the foundation for all relations. He collapses the type hierarchy and unifies types and terms via the subtyping relation. This also has the side-effect of combining type checking and partial evaluation. Functions can accept &quot;types&quot; and can also return &quot;types&quot;.&lt;/p&gt;
&lt;p &gt;Of course, it&#039;s not all sunshine and roses. As the abstract explains, the metatheory is quite complicated and soundness is still an open question. Not too surprising considering type checking &lt;a href=&quot;http://www.cs.nott.ac.uk/~txa/publ/msfp08.pdf&quot;&gt;Type:Type is undecidable&lt;/a&gt;.&lt;/p&gt;
&lt;p &gt;&lt;a href=&quot;https://www.era.lib.ed.ac.uk/handle/1842/3937&quot;&gt;Hutchins&#039; thesis&lt;/a&gt; is also available for a more thorough treatment. This work is all in pursuit of Hitchens&#039; goal of &lt;a href=&quot;http://www.infosun.fim.uni-passau.de/cl/publications/docs/TOPLAS10.pdf&quot;&gt;feature-oriented programming&lt;/a&gt;.&lt;/p&gt;</description>
 <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/14">OOP</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Fri, 08 Nov 2013 23:53:24 +0000</pubDate>
</item>
<item>
 <title>Types for Flexible Objects</title>
 <link>http://lambda-the-ultimate.org/node/4808</link>
 <description>&lt;p &gt;&lt;a href=&quot;https://pl.cs.jhu.edu/projects/big-bang/papers/types-for-flexible-objects.pdf&quot;&gt;Types for Flexible Objects&lt;/a&gt;, by Pottayil Harisanker Menon, Zachary Palmer, Alexander Rozenshteyn, Scott Smith:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Scripting languages are popular in part due to their extremely flexible objects. These languages support numerous object features, including dynamic extension, mixins, traits, and first-class messages. While some work has succeeded in typing these features individually, the solutions have limitations in some cases and no project has combined the results.&lt;/p&gt;
&lt;p &gt;In this paper we define TinyBang, a small typed language containing only functions, labeled data, a data combinator, and pattern matching. We show how it can directly express all of the aforementioned flexible object features and still have sound typing. We use a subtype constraint type inference system with several novel extensions to ensure full type inference; our algorithm reï¬nes parametric polymorphism for both flexibility and efficiency. We also use TinyBang to solve an open problem in OO literature: objects can be extended after being messaged without loss of width or depth subtyping and without dedicated metatheory. A core subset of TinyBang is proven sound and a preliminary implementation has been constructed.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;An interesting paper I stumbled across quite by accident, it purports quite an ambitious set of features: generalizing &lt;a href=&quot;http://lambda-the-ultimate.org/node/4394&quot;&gt;previous work on first-class cases&lt;/a&gt; while supporting subtyping, mutation, and polymorphism all with full type inference, in an effort to match the flexibility of dynamically typed languages.&lt;/p&gt;
&lt;p &gt;It does so by introducing a host of new concepts that are almost-but-not-quite generalizations of existing concepts, like &quot;onions&quot; which are kind of a type-indexed extensible record, and &quot;scapes&quot; which are sort of a generalization of pattern matching cases.&lt;/p&gt;
&lt;p &gt;Instead of approaching objects via a record calculus, they approach it using its dual as variant matching. Matching functions then have degenerate dependent types, which I first saw in the paper &lt;a href=&quot;http://www.cs.cmu.edu/~aldrich/FOOL/FOOL11/FCM.pdf&quot;&gt;Type Inference for First-Class Messages with Match-Functions&lt;/a&gt;. Interesting aside, Scott Smith was a coauthor on this last paper too, but it isn&#039;t referenced in the &quot;flexible objects&quot; paper, despite the fact that &quot;scapes&quot; are &quot;match-functions&quot;.&lt;/p&gt;
&lt;p &gt;Overall, quite a dense and ambitous paper, but the resulting TinyBang language looks very promising and quite expressive. Future work includes making the system more modular, as it currently requires whole program compilation, and adding first-class labels, which in past work has led to &lt;a href=&quot;http://research.microsoft.com/pubs/64501/fclabels.pdf&quot;&gt;interesting results as well&lt;/a&gt;. Most work exploiting row polymorphism is particularly interesting because it supports efficient compilation to index-passing code for both records and variants. It&#039;s not clear if onions and scapes are also amenable to this sort of translation.&lt;/p&gt;
&lt;p &gt;Edit: a previous paper was published in 2012, &lt;a href=&quot;http://pl.cs.jhu.edu/big-bang/fool12.pdf&quot;&gt;A Practical, Typed Variant Object Model -- Or, How to Stand On Your Head and Enjoy the View&lt;/a&gt;. &lt;a href=&quot;http://pl.cs.jhu.edu/big-bang/&quot;&gt;BigBang&lt;/a&gt; is their language that provides syntactic sugar on top of TinyBang.&lt;/p&gt;
&lt;p &gt;Edit 2: commas fixed, thanks!&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</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>Wed, 04 Sep 2013 16:57:12 +0000</pubDate>
</item>
<item>
 <title>Dependent Types for JavaScript</title>
 <link>http://lambda-the-ultimate.org/node/4700</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://cseweb.ucsd.edu/~rchugh/research/nested/djs.pdf&quot;&gt;Dependent Types for JavaScript&lt;/a&gt;, by Ravi Chugh, David Herman, Ranjit Jhala:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
We present Dependent JavaScript (DJS), a statically-typed dialect of the imperative, object-oriented, dynamic language. DJS supports the particularly challenging features such as run-time type-tests, higher-order functions, extensible objects, prototype inheritance, and arrays through a combination of nested reï¬nement types, strong updates to the heap, and heap unrolling to precisely track prototype hierarchies. With our implementation of DJS, we demonstrate that the type system is expressive enough to reason about a variety of tricky idioms found in small examples drawn from several sources, including the popular book JavaScript: The Good Parts and the SunSpider benchmark suite.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Some good progress on inferring types for a very dynamic language. Explicit type declarations are placed in comments that start with &quot;/*:&quot;.&lt;/p&gt;
&lt;pre &gt;
/*: xâˆ¶Top â†’ {Î½ âˆ£ite Num(x) Num(Î½) Bool(Î½)} */
function negate(x) {
    if (typeof x == &quot;number&quot;) { return 0 - x; }
    else { return !x; }
}
&lt;/pre&gt;&lt;br &gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</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>Sat, 23 Mar 2013 15:08:40 +0000</pubDate>
</item>
<item>
 <title>Tool Demo: Scala-Virtualized</title>
 <link>http://lambda-the-ultimate.org/node/4522</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://lampwww.epfl.ch/~phaller/doc/pepm2012.pdf&quot;&gt;Tool Demo: Scala-Virtualized&lt;/a&gt;&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
This paper describes Scala-Virtualized, which extends the Scala language and compiler with a small number of features that enable combining the beneï¬ts of shallow and deep embeddings of DSLs. We demonstrate our approach by showing how to embed three different domain-speciï¬c languages in Scala. Moreover, we summarize how others have been using our extended compiler in their own research and teaching. Supporting artifacts of our tool include web-based tutorials, nightly builds, and an Eclipse update site hosting an up-to-date version of the Scala IDE for Eclipse based on the Virtualized Scala compiler and standard library.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Scala has always had a quite good EDSL story thanks to implicits, dot- and paren-inference, and methods-as-operators. Lately there are proposals to provide it with both macros-in-the-camlp4-sense and support for multi-stage programming. This paper goes into some depth on the foundations of the latter subject.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/24">DSL</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/8">Implementation</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <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/29">Semantics</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Sat, 26 May 2012 22:28:59 +0000</pubDate>
</item>
<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>Mon, 02 Jan 2012 02:40:53 +0000</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 22:22:40 +0000</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 22:25:48 +0000</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 21:51:40 +0000</pubDate>
</item>
</channel>
</rss>
