152 research outputs found
Extensible Scheduling in a Haskell-based Operating System
This thesis presents Lighthouse, an experimental branch of the Haskell-based House operating system which integrates Li et al.\u27s Lightweight Concurrency framework. First and foremost, it improves House\u27s viability as a real operating system by providing a new extensible scheduler framework which makes it easy to experiment with different scheduling policies. In particular, Lighthouse extends Concurrent Haskell with thread priority and implements a priority-based scheduler which significantly improves system responsiveness when compared with GHC\u27s normal round-robin scheduler. Even while doing this, it improves on House\u27s claim of being written in Haskell by moving a whole subsystem out of the complex C-based runtime system and into Haskell itself. In addition, Lighthouse also includes an alternate, simpler implementation of Lightweight Concurrency which takes advantage of House\u27s unique setting (running directly on uniprocessor x86 hardware). This experience sheds light on areas that need further attention before the system can truly be viable---primarily interactions between blackholing and interrupt handling. In particular, this thesis uncovers a potential case of self-deadlock and suggests potential solutions. Finally, this work offers further insight into the viability of using high-level languages such as Haskell for systems programming. Although laziness and blackholing present unique problems, many parts of the system are still much easier to express in Haskell than traditional languages such as C
PAEAN : portable and scalable runtime support for parallel Haskell dialects
Over time, several competing approaches to parallel Haskell programming have emerged. Different approaches support parallelism at various different scales, ranging from small multicores to massively parallel high-performance computing systems. They also provide varying degrees of control, ranging from completely implicit approaches to ones providing full programmer control. Most current designs assume a shared memory model at the programmer, implementation and hardware levels. This is, however, becoming increasingly divorced from the reality at the hardware level. It also imposes significant unwanted runtime overheads in the form of garbage collection synchronisation etc. What is needed is an easy way to abstract over the implementation and hardware levels, while presenting a simple parallelism model to the programmer. The PArallEl shAred Nothing runtime system design aims to provide a portable and high-level shared-nothing implementation platform for parallel Haskell dialects. It abstracts over major issues such as work distribution and data serialisation, consolidating existing, successful designs into a single framework. It also provides an optional virtual shared-memory programming abstraction for (possibly) shared-nothing parallel machines, such as modern multicore/manycore architectures or cluster/cloud computing systems. It builds on, unifies and extends, existing well-developed support for shared-memory parallelism that is provided by the widely used GHC Haskell compiler. This paper summarises the state-of-the-art in shared-nothing parallel Haskell implementations, introduces the PArallEl shAred Nothing abstractions, shows how they can be used to implement three distinct parallel Haskell dialects, and demonstrates that good scalability can be obtained on recent parallel machines.PostprintPeer reviewe
HasTEE: Programming Trusted Execution Environments with Haskell
Trusted Execution Environments (TEEs) are hardware-enforced memory isolation
units, emerging as a pivotal security solution for security-critical
applications. TEEs, like Intel SGX and ARM TrustZone, allow the isolation of
confidential code and data within an untrusted host environment, such as the
cloud and IoT. Despite strong security guarantees, TEE adoption has been
hindered by an awkward programming model. This model requires manual
application partitioning and the use of error-prone, memory-unsafe, and
potentially information-leaking low-level C/C++ libraries.
We address the above with \textit{HasTEE}, a domain-specific language (DSL)
embedded in Haskell for programming TEE applications. HasTEE includes a port of
the GHC runtime for the Intel-SGX TEE. HasTEE uses Haskell's type system to
automatically partition an application and to enforce \textit{Information Flow
Control} on confidential data. The DSL, being embedded in Haskell, allows for
the usage of higher-order functions, monads, and a restricted set of I/O
operations to write any standard Haskell application. Contrary to previous
work, HasTEE is lightweight, simple, and is provided as a \emph{simple security
library}; thus avoiding any GHC modifications. We show the applicability of
HasTEE by implementing case studies on federated learning, an encrypted
password wallet, and a differentially-private data clean room.Comment: To appear in Haskell Symposium 202
Profiling of parallel programs in a non-strict functional language
[Abstract]
Purely functional programming languages offer many benefits to parallel
programming. The absence of side effects and the provision for
higher-level abstractions eases the programming effort. In particular, nonstrict
functional languages allow further separation of concerns and provide
more parallel facilities in the form of semi-implicit parallelism. On
the other hand, because the low-level details of the execution are hidden,
usually in a runtime system, the process of debugging the performance
of parallel applications becomes harder. Currently available parallel profiling
tools allow programmers to obtain some information about the
execution; however, this information is usually not detailed enough to
precisely pinpoint the cause of some performance problems. Often, this
is because the cost of obtaining that information would be prohibitive for
a complete program execution. In this thesis, we design and implement
a parallel profiling framework based on execution replay. This debugging
technique makes it possible to simulate recorded executions of a program,
ensuring that their behaviour remains unchanged. The novelty of
our approach is to adapt this technique to the context of parallel profiling
and to take advantage of the characteristics of non-strict purely
functional semantics to guarantee minimal overhead in the recording
process. Our work allows to build more powerful profiling tools that do
not affect the parallel behaviour of the program in a meaningful way.We
demonstrate our claims through a series of benchmarks and the study
of two use cases.[Resumo]
As linguaxes de programación funcional puras ofrecen moitos beneficios
para a programación paralela. A ausencia de efectos secundarios e as abstraccións de alto nivel proporcionadas facilitan o esforzo de programación.
En particular, as linguaxes de programación non estritas permiten
unha maior separación de conceptos e proporcionan máis capacidades
de paralelismo na forma de paralelismo semi-implícito. Por outra
parte, debido a que os detalles de baixo nivel da execución están ocultos,
xeralmente nun sistema de execución, o proceso de depuración do
rendemento de aplicacións paralelas é máis difícil. As ferramentas de
profiling dispoñibles hoxe en día permiten aos programadores obter certa
información acerca da execución; non obstante, esta información non
acostuma a ser o suficientemente detallada para determinar de maneira
precisa a causa dalgúns problemas de rendemento. A miúdo, isto débese
a que o custe de obter esa información sería prohibitivo para unha
execución completa do programa. Nesta tese, deseñamos e implementamos
unha plataforma de profiling paralelo baseada en execution replay.
Esta técnica de depuración fai que sexa posible simular execucións previamente
rexistradas, asegurando que o seu comportamento se manteña
sen cambios. A novidade do noso enfoque é adaptar esta técnica para o
contexto do profiling paralelo e aproveitar as características da semántica
das linguaxes de programación funcional non estritas e puras para garantizar
unha sobrecarga mínima na recolección das trazas de execución.
O noso traballo permite construír ferramentas de profiling máis potentes
que non afectan ao comportamento paralelo do programa de maneira
significativa. Demostramos as nosas afirmacións nunha serie de benchmarks
e no estudo de dous casos de uso.[Resumen]Los lenguajes de programación funcional puros ofrecen muchos beneficios
para la programación paralela. La ausencia de efectos secundarios
y las abstracciones de alto nivel proporcionadas facilitan el esfuerzo de
programación. En particular, los lenguajes de programación no estrictos
permiten una mayor separación de conceptos y proporcionan más
capacidades de paralelismo en la forma de paralelismo semi-implícito.
Por otra parte, debido a que los detalles de bajo nivel de la ejecución están ocultos, generalmente en un sistema de ejecución, el proceso de
depuración del rendimiento de aplicaciones paralelas es más difícil. Las
herramientas de profiling disponibles hoy en día permiten a los programadores
obtener cierta información acerca de la ejecución; sin embargo,
esta información no suele ser lo suficientemente detallada para determinar
de manera precisa la causa de algunos problemas de rendimiento.
A menudo, esto se debe a que el costo de obtener esa información sería
prohibitivo para una ejecución completa del programa. En esta tesis, diseñamos
e implementamos una plataforma de profiling paralelo baseada
en execution replay. Esta técnica de depuración hace que sea posible simular
ejecuciones previamente registradas, asegurando que su comportamiento
se mantiene sin cambios. La novedad de nuestro enfoque es
adaptar esta técnica para el contexto del profiling paralelo y aprovechar
las características de la semántica de los lenguajes de programación funcional
no estrictos y puros para garantizar una sobrecarga mínima en la
recolección de las trazas de ejecución. Nuestro trabajo permite construir
herramientas de profiling más potentes que no afectan el comportamiento
paralelo del programa de manera significativa. Demostramos nuestras
afirmaciones en una serie de benchmarks y en el estudio de dos casos de
uso
Efficient and Reasonable Object-Oriented Concurrency
Making threaded programs safe and easy to reason about is one of the chief
difficulties in modern programming. This work provides an efficient execution
model for SCOOP, a concurrency approach that provides not only data race
freedom but also pre/postcondition reasoning guarantees between threads. The
extensions we propose influence both the underlying semantics to increase the
amount of concurrent execution that is possible, exclude certain classes of
deadlocks, and enable greater performance. These extensions are used as the
basis an efficient runtime and optimization pass that improve performance 15x
over a baseline implementation. This new implementation of SCOOP is also 2x
faster than other well-known safe concurrent languages. The measurements are
based on both coordination-intensive and data-manipulation-intensive benchmarks
designed to offer a mixture of workloads.Comment: Proceedings of the 10th Joint Meeting of the European Software
Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of
Software Engineering (ESEC/FSE '15). ACM, 201
Micro Virtual Machines: A Solid Foundation for Managed Language Implementation
Today new programming languages proliferate, but many of them
suffer from
poor performance and inscrutable semantics. We assert that the
root of
many of the performance and semantic problems of today's
languages is
that language implementation is extremely difficult. This
thesis
addresses the fundamental challenges of efficiently developing
high-level
managed languages.
Modern high-level languages provide abstractions over execution,
memory
management and concurrency. It requires enormous intellectual
capability
and engineering effort to properly manage these concerns.
Lacking such
resources, developers usually choose naive implementation
approaches
in the early stages of language design, a strategy which too
often has
long-term consequences, hindering the future development of the
language. Existing language development platforms have failed
to
provide the right level of abstraction, and forced implementers
to
reinvent low-level mechanisms in order to obtain performance.
My thesis is that the introduction of micro virtual machines will
allow
the development of higher-quality, high-performance managed
languages.
The first contribution of this thesis is the design of Mu, with
the
specification of Mu as the main outcome. Mu is
the first micro virtual machine, a robust, performant, and
light-weight
abstraction over just three concerns: execution, concurrency and
garbage
collection. Such a foundation attacks three of the most
fundamental and
challenging issues that face existing language designs and
implementations, leaving the language implementers free to focus
on the
higher levels of their language design.
The second contribution is an in-depth analysis of on-stack
replacement
and its efficient implementation. This low-level mechanism
underpins
run-time feedback-directed optimisation, which is key to the
efficient
implementation of dynamic languages.
The third contribution is demonstrating the viability of Mu
through
RPython, a real-world non-trivial language implementation. We
also did
some preliminary research of GHC as a Mu client.
We have created the Mu specification and its reference
implementation,
both of which are open-source. We show that that Mu's on-stack
replacement API can gracefully support dynamic languages such as
JavaScript, and it is implementable on concrete hardware. Our
RPython
client has been able to translate and execute non-trivial
RPython
programs, and can run the RPySOM interpreter and the core of the
PyPy
interpreter.
With micro virtual machines providing a low-level substrate,
language
developers now have the option to build their next language on a
micro
virtual machine. We believe that the quality of programming
languages
will be improved as a result
How functional programming mattered
In 1989 when functional programming was still considered a niche topic, Hughes wrote a visionary paper arguing convincingly ‘why functional programming matters’. More than two decades have passed. Has functional programming really mattered? Our answer is a resounding ‘Yes!’. Functional programming is now at the forefront of a new generation of programming technologies, and enjoying increasing popularity and influence. In this paper, we review the impact of functional programming, focusing on how it has changed the way we may construct programs, the way we may verify programs, and fundamentally the way we may think about programs
- …