We present a case-study of using functional programming in the real world at a very large scale. At Standard Chartered Bank, Haskell is used in a core software library supporting the entire Markets division - a busine...
详细信息
We present a case-study of using functional programming in the real world at a very large scale. At Standard Chartered Bank, Haskell is used in a core software library supporting the entire Markets division - a business line with 3 billion USD operating income in 2023. Typed functional programming is used across the entire tech stack, including foundational APIs and CLIs for deal valuation and risk analysis, server-side components for long-running batches or sub-second RESTful services, and end-user GUIs. Thousands of users across Markets interact with software built using functional programming, and over one hundred write functional code. In this experience report we focus on how we leverage functional programming to orchestrate type-driven large-scale pricing workflows. The same API can be used to price one trade locally, or millions of trades across thousands of cloud nodes. Different parts of the computation can be run and inspected individually, and recomputing one part triggers recalculation of the dependent parts only. We build upon decades of research and experience in the functional programming community, relying on concepts such as monads, lenses, datatype generics, and closure serialisation. We conclude that the use of functional programming is one of the main drivers of the success of our project, and we see no significant downsides from it.
This paper reports on the experiences of using an early assessment intervention, specifically employing a Use-Modify-Create scaffold, to teach first-year undergraduate functional programming. The particular interventi...
详细信息
This paper reports on the experiences of using an early assessment intervention, specifically employing a Use-Modify-Create scaffold, to teach first-year undergraduate functional programming. The particular intervention that was trialled was the use of an early assessment instrument, in which students had to use code given to them, or slightly modify it, to achieve certain goals. The intended outcome was that the students would thus engage earlier with the functional language, enabling them to be better prepared for the second piece of assessment, where they create code to solve given problems. This intervention showed promise: the difference between a student's score on the Create assignment improved by an average of 9% in the year after the intervention was implemented, a small effect.
In recent years, there has been a renewed interest in functional programming (FP) as it has become a popular programming paradigm in several languages, including Python and JavaScript. Additionally, functional Program...
详细信息
ISBN:
(纸本)9798350328837;9798350328844
In recent years, there has been a renewed interest in functional programming (FP) as it has become a popular programming paradigm in several languages, including Python and JavaScript. Additionally, functional programming is the primary paradigm for increasingly used languages such as Clojure and Haskell, which have taken on significant importance for researchers and developers alike. FP has several benefits in software development, providing readable, maintainable, and scalable systems. However, despite these benefits, most of the literature related to software design currently lacks clear and detailed specifications concerning the functional paradigm. In contrast, Object-Oriented programming, for instance, possesses a vast array of design resources and tools. This and other challenges can make the adoption of FP difficult for developers who seek to integrate the FP paradigm in their systems. The objective of the research work is to present the state of the art of FP-oriented software design, covering methodologies, practices, and artefacts;analysing different proposals, and identifying open challenges. To arhieve the objective, a Systematic Literature Review (SRL) was conducted, following the Kitchenham's guidelines. We found a total of 14 primary studies published between 2012 and 2022, covering different artefacts and practices for software design under FP. Although Software design under FP is currently a little-explored topic in Software Engineering, its importance in software development is undeniable, and its use is expected to continue growing, being an interesting opportunity area for future research.
Although functional programming languages simplify writing safe parallel programs by helping programmers to avoid data races, they have traditionally delivered poor performance. Recent work improved performance by usi...
详细信息
Although functional programming languages simplify writing safe parallel programs by helping programmers to avoid data races, they have traditionally delivered poor performance. Recent work improved performance by using a hierarchical memory architecture that allows processors to allocate and reclaim memory independently without any synchronization, solving thus the key performance challenge afflicting functional programs. The approach, however, restricts mutation, or memory effects, so as to ensure "disentanglement", a low-level memory property that guarantees independence between different heaps in the hierarchy. This paper proposes techniques for supporting entanglement and for allowing functional programs to use mutation at will. Our techniques manage entanglement by distinguishing between disentangled and entangled objects and shielding disentangled objects from the cost of entanglement management. We present a semantics that formalizes entanglement as a property at the granularity of memory objects, and define several cost metrics to reason about and bound the time and space cost of entanglement. We present an implementation of the techniques by extending the MPL compiler for Parallel ML. The extended compiler supports all features of the Parallel ML language, including unrestricted effects. Our experiments using a variety of benchmarks show that MPL incurs a small time and space overhead compared to sequential runs, scales well, and is competitive with languages such as C++, Go, Java, OCaml. These results show that our techniques can marry the safety benefits of functional programming with performance.
functional programming (FP) lets users focus on the business logic of their applications by providing them with high-level and composable abstractions. However, both automatic memory management schemes traditionally u...
详细信息
ISBN:
(纸本)9789819722990;9789819723003
functional programming (FP) lets users focus on the business logic of their applications by providing them with high-level and composable abstractions. However, both automatic memory management schemes traditionally used for FP, namely tracing garbage collection and reference counting, may introduce latencies in places that can be hard to predict, which limits the applicability of the FP paradigm. We reevaluate the use of lazy reference counting in single-threaded functional programming with guaranteed constant-time memory management, meaning that allocation and deallocation take only a bounded and predictable amount of time. This approach does not leak memory as long as we use uniform allocation sizes. Uniform allocation sizes were previously considered impractical in the context of imperative programming, but we find it to be surprisingly suitable for FP. Preliminary benchmark results suggest that our approach is practical, as its performance is on par with Koka's existing state-of-the-art implementation of reference counting for FP, sometimes even outperforming it. We also evaluate the effect of different allocation sizes on application performance and suggest ways of allowing large allocation in non-mission-critical parts of the program via Koka's effect system. We believe this potentially opens the door to many new industrial applications of FP, such as its use in real-time embedded software. In fact, the development of a high-level domain-specific language for describing latency-critical quantum physics experiments was one of the original use cases that prompted us to initiate this work.
programming distributed systems is notoriously hard due to - among the others - concurrency, asynchronous execution, message loss, and device failures. Homogeneous distributed systems consist of similar devices that c...
详细信息
Serverless computing, also known as the Function-as-a-Service (FaaS) paradigm, has become a cornerstone of modern cloud-based applications, enabling developers to build and execute workflows by composing serverless fu...
详细信息
Language model-based code completion models have quickly grown in use, helping thousands of developers write code in many different programming languages. However, research on code completion models typically focuses ...
详细信息
ISBN:
(纸本)9798400706097
Language model-based code completion models have quickly grown in use, helping thousands of developers write code in many different programming languages. However, research on code completion models typically focuses on imperative languages such as Python and JavaScript, which results in a lack of representation for functional programming languages. Consequently, these models often perform poorly on functional languages such as Haskell. To investigate whether this can be alleviated, we evaluate the performance of two language models for code, CodeGPT and UniXcoder, on the functional programming language Haskell. We fine-tune and evaluate the models on Haskell functions sourced from a publicly accessible Haskell dataset on HuggingFace. Additionally, we manually evaluate the models using our novel translated HumanEval dataset. Our automatic evaluation shows that knowledge of imperative programming languages in the pre-training of LLMs may not transfer well to functional languages, but that code completion on functional languages is feasible. Consequently, this shows the need for more high-quality Haskell datasets. A manual evaluation on HumanEval-Haskell indicates CodeGPT frequently generates empty predictions and extra comments, while UniXcoder more often produces incomplete or incorrect predictions. Finally, we release HumanEval-Haskell, along with the fine-tuned models and all code required to reproduce our experiments on GitHub [41].
The paper presents and discusses our experience of teaching functional programming which has evolved during many years of teaching at different departments of Novosibirsk State University. We suggest students to learn...
详细信息
YOU'D EXPECT THE LONGEST ANDMOST COSTLY PHASE in the life cycle of a software productto be the intital development of the system, when all those great features are first imagined and then created. In fact, the har...
详细信息
YOU'D EXPECT THE LONGEST ANDMOST COSTLY PHASE in the life cycle of a software productto be the intital development of the system, when all those great features are first imagined and then created. In fact, the hardest part comes later, during the maintenance phase. that's when programmers pay the price for the shortcuts they took during development. center dot So why did they take shortcuts? Maybe they didn't realize that they were cutting any corners. Only when their code was deployed and exercised by a lot of users did its hidden flaws come to light. And maybe the developers were *** would almost guarantee antee that their software will contain more bugs than it would otherwise.
暂无评论