566,928 research outputs found
In the Age of Web: Typed Functional-First Programming Revisited
Most programming languages were designed before the age of web. This matters
because the web changes many assumptions that typed functional language
designers take for granted. For example, programs do not run in a closed world,
but must instead interact with (changing and likely unreliable) services and
data sources, communication is often asynchronous or event-driven, and programs
need to interoperate with untyped environments.
In this paper, we present how the F# language and libraries face the
challenges posed by the web. Technically, this comprises using type providers
for integration with external information sources and for integration with
untyped programming environments, using lightweight meta-programming for
targeting JavaScript and computation expressions for writing asynchronous code.
In this inquiry, the holistic perspective is more important than each of the
features in isolation. We use a practical case study as a starting point and
look at how F# language and libraries approach the challenges posed by the web.
The specific lessons learned are perhaps less interesting than our attempt to
uncover hidden assumptions that no longer hold in the age of web.Comment: In Proceedings ML/OCaml 2014, arXiv:1512.0143
A Context-Oriented Extension of F#
Context-Oriented programming languages provide us with primitive constructs
to adapt program behaviour depending on the evolution of their operational
environment, namely the context. In previous work we proposed ML_CoDa, a
context-oriented language with two-components: a declarative constituent for
programming the context and a functional one for computing. This paper
describes the implementation of ML_CoDa as an extension of F#.Comment: In Proceedings FOCLASA 2015, arXiv:1512.0694
Mainstream parallel array programming on cell
We present the E] compiler and runtime library for the ‘F’ subset of
the Fortran 95 programming language. ‘F’ provides first-class support for arrays,
allowing E] to implicitly evaluate array expressions in parallel using the SPU coprocessors
of the Cell Broadband Engine. We present performance results from
four benchmarks that all demonstrate absolute speedups over equivalent ‘C’ or
Fortran versions running on the PPU host processor. A significant benefit of this
straightforward approach is that a serial implementation of any code is always
available, providing code longevity, and a familiar development paradigm
Introspecting Preferences in Answer Set Programming
This paper develops a logic programming language, ASP^EP, that extends answer set programming language with a new epistemic operator >~_x where x in {#,supseteq}. The operator are used between two literals in rules bodies, and thus allows for the representation of introspections of preferences in the presence of multiple belief sets: G >~_# F expresses that G is preferred to F by the cardinality of the sets, and G >~_supseteq F expresses G is preferred to F by the set-theoretic inclusion. We define the semantics of ASP^EP, explore the relation to the languages of strong introspections, and study the applications of ASP^EP by modeling the Monty Hall problem and the principle of majority
Factorization in the Cloud: Integer Factorization Using F# and Windows Azure
Implementations are presented of two common algorithms for integer factorization, Pollard’s “p – 1” method and the SQUFOF method. The algorithms are implemented in the F# language, a functional programming language developed by Microsoft and officially released for the first time in 2010. The algorithms are thoroughly tested on a set of large integers (up to 64 bits in size), running both on a physical machine and a Windows Azure machine instance.
Analysis of the relative performance between the two environments indicates comparable performance when taking into account the difference in computing power. Further analysis reveals that the relative performance of the Azure implementation tends to improve as the magnitudes of the integers increase, indicating that such an approach may be suitable for larger, more complex factorization tasks.
Finally, several questions are presented for future research, including the performance of F# and related languages for more efficient, parallelizable algorithms, and the relative cost and performance of factorization algorithms in various environments, including physical hardware and commercial cloud computing offerings from the various vendors in the industry
Curry-style type Isomorphisms and Game Semantics
Curry-style system F, ie. system F with no explicit types in terms, can be
seen as a core presentation of polymorphism from the point of view of
programming languages. This paper gives a characterisation of type isomorphisms
for this language, by using a game model whose intuitions come both from the
syntax and from the game semantics universe. The model is composed of: an
untyped part to interpret terms, a notion of game to interpret types, and a
typed part to express the fact that an untyped strategy plays on a game. By
analysing isomorphisms in the model, we prove that the equational system
corresponding to type isomorphisms for Curry-style system F is the extension of
the equational system for Church-style isomorphisms with a new, non-trivial
equation: forall X.A = A[forall Y.Y/X] if X appears only positively in A.Comment: Accept\'e \`a Mathematical Structures for Computer Science, Special
Issue on Type Isomorphism
AD in Fortran, Part 1: Design
We propose extensions to Fortran which integrate forward and reverse
Automatic Differentiation (AD) directly into the programming model.
Irrespective of implementation technology, embedding AD constructs directly
into the language extends the reach and convenience of AD while allowing
abstraction of concepts of interest to scientific-computing practice, such as
root finding, optimization, and finding equilibria of continuous games.
Multiple different subprograms for these tasks can share common interfaces,
regardless of whether and how they use AD internally. A programmer can maximize
a function F by calling a library maximizer, XSTAR=ARGMAX(F,X0), which
internally constructs derivatives of F by AD, without having to learn how to
use any particular AD tool. We illustrate the utility of these extensions by
example: programs become much more concise and closer to traditional
mathematical notation. A companion paper describes how these extensions can be
implemented by a program that generates input to existing Fortran-based AD
tools
- …