scholarly journals Higher-Order Spreadsheets with Spilled Arrays

Author(s):  
Jack Williams ◽  
Nima Joharizadeh ◽  
Andrew D. Gordon ◽  
Advait Sarkar

AbstractWe develop a theory for two recently-proposed spreadsheet mechanisms: gridlets allow for abstraction and reuse in spreadsheets, and build on spilled arrays, where an array value spills out of one cell into nearby cells. We present the first formal calculus of spreadsheets with spilled arrays. Since spilled arrays may collide, the semantics of spilling is an iterative process to determine which arrays spill successfully and which do not. Our first theorem is that this process converges deterministically. To model gridlets, we propose the grid calculus, a higher-order extension of our calculus of spilled arrays with primitives to treat spreadsheets as values. We define a semantics of gridlets as formulas in the grid calculus. Our second theorem shows the correctness of a remarkably direct encoding of the Abadi and Cardelli object calculus into the grid calculus. This result is the first rigorous analogy between spreadsheets and objects; it substantiates the intuition that gridlets are an object-oriented counterpart to functional programming extensions to spreadsheets, such as sheet-defined functions.

2020 ◽  
Vol 18 (2) ◽  
pp. 15-30
Author(s):  
Sergey S. Bogolepov

Kotlin is a statically typed programming language that supports object-oriented and functional programming. It supports JVM, JS and native platforms via LLVM (Kotlin / Native). The first two targets are backed with well-developed virtual machines that can perform advanced program optimizations at runtime. However, for native platforms, all optimizations must be performed at compile time. Currently Kotlin / Native lacks many optimizations, which is why the performance of the generated code is poor in many cases. This paper describes a way to solve this problem by introducing an additional SSA-based intermediate representation and implementing escape analysis using it. Experimental results have shown that this approach can significantly improve performance.


1994 ◽  
Vol 4 (3) ◽  
pp. 285-335 ◽  
Author(s):  
Mads Tofte

AbstractIn this paper we present a language for programming with higher-order modules. The language HML is based on Standard ML in that it provides structures, signatures and functors. In HML, functors can be declared inside structures and specified inside signatures; this is not possible in Standard ML. We present an operational semantics for the static semantics of HML signature expressions, with particular emphasis on the handling of sharing. As a justification for the semantics, we prove a theorem about the existence of principal signatures. This result is closely related to the existence of principal type schemes for functional programming languages with polymorphism.


2004 ◽  
Vol 14 (4) ◽  
pp. 429-472 ◽  
Author(s):  
BRIAN MCNAMARA ◽  
YANNIS SMARAGDAKIS

We describe the FC++ library, a rich library supporting functional programming in C++. Prior approaches to encoding higher order functions in C++ have suffered with respect to polymorphic functions from either lack of expressiveness or high complexity. In contrast, FC++ offers full and concise support for higher-order polymorphic functions through a novel use of C++ type inference. The FC++ library has a number of useful features, including a generalized mechanism to implement currying in C++, a “lazy list” class which enables the creation of “infinite data structures”, a subtype polymorphism facility, and an extensive library of useful functions, including a large part of the Haskell Standard Prelude. The FC++ library has an efficient implementation. We show the results of a number of experiments which demonstrate the value of optimizations we have implemented. These optimizations have improved the run-time performance by about an order of magnitude for some benchmark programs that make heavy use of FC++ lazy lists. We also make an informal performance comparison with similar programs written in Haskell.


Sign in / Sign up

Export Citation Format

Share Document