Spelling suggestions: "subject:"[een] FUNCTIONAL PROGRAMMING"" "subject:"[enn] FUNCTIONAL PROGRAMMING""
91 |
Evaluating cyclomatic complexity on functional JavaScriptHåkansson, Jesper, Badran, Sherief January 2016 (has links)
Bugs in software is a very common problem, code reviews can help to catch bugs early on and detect which code is the most complex and may introduce bugs but when the code base is very large it can be costly to review all the code. Cyclomatic complexity can be used to give an indication of how complex the system source code is and help the developers to select which code they should review. But when measuring cyclomatic complexity on code written according to the functional paradigm, McCabe’s formula will not be sufficient since it is a formula most suitable for imperative code. Therefore we are making adaptations to a formula suited for pure functional languages in order to fit functional JavaScript. We are using an inductive empirical quantitative measurement method to calculate cyclomatic complexity on a directed graph implementation in order to define adaptations for functional JavaScript. Our results show a working adapted version of the formula. We have measured on a graph implemented in Haskell and on a corresponding functional JavaScript version which results in a cyclomatic complexity difference at only 0.375.
|
92 |
Une approche fonctionnelle pour la conception et l'exploration architecturale de systèmes numériques / A Functional Approach to Digital System Modeling and Design Space ExplorationToczek, Tomasz 15 June 2011 (has links)
Ce manuscrit présente une méthode de conception au niveau système reposant sur la programmation fonctionnelle typée et visant à atténuer certains des problèmes complexifiant le développement des systèmes numériques modernes, tels que leurs tailles importantes ou la grande variété des blocs les constituant. Nous proposons un ensemble de mécanismes permettant de mélanger au sein d'un même design plusieurs formalismes de description distincts («modèles de calcul») se situant potentiellement à des niveaux d'abstraction différents. De plus, nous offrons au concepteur la possibilité d'expliciter directement les paramètres explorables de chaque sous-partie du design, puis d'en déterminer des valeurs acceptables via une étape d'exploration partiellement ou totalement automatisée réalisée à l'échelle du système. Les gains qu'apportent ces stratégies nouvelles sont illustrés sur plusieurs exemples. / This work presents a novel system-level design method based on typed functional programming and aiming at mitigating some of the issues making the development of modern digital systems complex, such as their increasing sizes and the variety of their subcomponents. We propose a range of mechanisms allowing to mix within a single design several description formalisms (``models of computation''), possibly at different abstraction levels. Moreover, the designer is provided with means to directly express the explorable parameters of each part of their design, and to find acceptable values for them through a partially or totally automatic system-wide architectural exploration step. The advantages brought by those new strategies are illustrated on several examples.
|
93 |
Uma implementação paralela do AIRS em Scala / A parallel implementation of AIRS in ScalaFilipe Ferraz Salgado 15 September 2010 (has links)
Com o avanço tecnológico dos últimos anos passou a ser normal vermos microprocessadores com múltiplos núcleos (cores). A expectativa é de que o crescimento da quantidade de núcleos passe a ser maior do que o crescimento da velocidade desses núcleos. Assim, além de se preocuparem em otimizar algoritmos sequenciais, os programadores começaram a dar mais atenção às possibilidades de aproveitamento de toda a capacidade oferecida pelos diversos cores. Existem alguns modelos de programação que permitem uma abordagem concorrente. O modelo de programação concorrente mais adotado atualmente é o baseado em threads, que utiliza memória compartilhada e é adotado em Java. Um outro modelo é o baseado em troca de mensagens, no qual as entidades computacionais ativas são denominadas atores. Nesse trabalho, estudamos a linguagem Scala e seu modelo de atores. Além disso, implementamos em Scala uma versão paralela de um algoritmo de classicação que simula o sistema imunológico dos animais, o AIRS paralelo, e comparamos seu desempenho com a versão em Java. / With the technological advance of the last years it has been normal to see microprocessors with multiple cores. The expectation is that the growth of number of cores becomes greater than the growth of the speed of these cores. This way, besides worrying about optimizing sequential algorithms, developers started to give more attention to the possibilities of proting from all capacity offered by the cores. There exists a few programming models that allow a concurrent approach. In these days, the most adopted concurrent programming model is the one based on threads, which uses shared memory and is adopted in Java. Other model is based on message passing, on which the active computational entities are called actors. In this project, we studied Scala language and its model based on actors. Besides that, we implemented in Scala a parallel version of a classification algorithm that simules the immune system of the animals, parallel AIRS, and compared its performance with the Java version.
|
94 |
Diffusion de modules compilés pour le langage distribué Termite SchemeHamel, Frédéric 03 1900 (has links)
Ce mémoire décrit et évalue un système de module qui améliore la migration de code dans le
langage de programmation distribuée Termite Scheme. Ce système de module a la possibilité
d’être utilisé dans les applications qu’elles soient distribuées ou pas. Il a pour but de faciliter
la conception des programmes dans une structure modulaire et faciliter la migration de code
entre les nœuds d’un système distribué. Le système de module est conçu pour le système
Gambit Scheme, un compilateur et interprète du langage Scheme utilisé pour implanter
Termite. Le système Termite Scheme est utilisé pour implémenter les systèmes distribués.
Le problème qui est résolu est la diffusion de code compilé entre les nœuds d’un système
distribué quand le nœud destination n’a aucune connaissance préalable du code qu’il reçoit.
Ce problème est difficile car les nœuds sont hétérogènes, ils ont différentes architectures (x86,
ARM).
Notre approche permet d’identifier les modules de façon unique dans un contexte dis-
tribué. La facilité d’utilisation et la portabilité ont été des facteurs importants dans la
conception du système de module.
Le mémoire décrit la structure des modules, leur implémentation dans Gambit et leur
application. Les qualités du système de module sont démontrées par des exemples et la
performance est évaluée expérimentallement. / This thesis presents a module system for Termite Scheme that supports distributed computing.
This module system facilitates application modularity and eases code migration
between the nodes of a distributed system. This module system also works for developing
non-distributed applications. The Gambit Scheme system is used to implement the
distributed Termite and the Module system.
The problem that is solved is the migration of compiled code between nodes of a distributed
system when the receiving node has no prior knowledge of the code. This is a
challenging problem because the nodes are not homogenous, they have different architectures
(ARM, x86).
Our approach uses a naming model for the modules that uniquely identifies them in a
distributed context. Both ease of use and portability were important factors in the design
of the module system.
The thesis describes a module system and how it was integrated into Gambit. The
system allows developing distributed modular systems. The features of this system are
shown through application examples and the performance is evaluated experimentally.
|
95 |
A synchronous functional language with integer clocks / Un langage synchrone fonctionnel avec horloges entièresGuatto, Adrien 07 January 2016 (has links)
Cette thèse traite de la conception et implémentationd’un langage de programmation pour les systèmes detraitement de flux en temps réel, comme l’encodagevidéo. Le modèle des réseaux de Kahn est bien adaptéà ce domaine et y est couramment utilisé. Dans cemodèle, un programme consiste en un ensemble deprocessus parallèles communicant à travers des filesmono-producteur, mono-consommateur. La force dumodèle réside en son déterminisme.Les langages synchrones fonctionnels comme Lustresont dédiés aux systèmes embarqués critiques. Un programmeLustre définit un réseau de Kahn synchronequi peut être exécuté avec des files bornées et sans blocage.Cette propriété est garantie par un système detypes dédié, le calcul d’horloge, qui établit une échellede temps globale à un programme. Cette échelle detemps globale est utilisée pour définir les horloges, sé-quences booléennes indiquant pour chaque file, et àchaque pas de temps, si un processus produit ou consommeune donnée. Cette information sert non seulementà assurer la synchronie mais également à générerdu logiciel ou matériel à état fini.Nous proposons et étudions les horloges entières, unegénéralisation des horloges booléennes autorisant desentiers naturels arbitrairement grands. Les horlogesentières décrivent la production ou consommation deplusieurs valeurs depuis une même file au cours d’uninstant. Nous les utilisons pour définir la constructiond’échelle de temps locale, qui peut masquer despas de temps cachés par un sous-programme au contexteenglobant.Ces principes sont intégrés à un calcul d’horloge pourun langage fonctionnel d’ordre supérieur. Nous étudionsses propriétés et prouvons en particulier que lesprogrammes bien typés ne bloquent pas. Nous compilonsles programmes typés vers des circuits numériquessynchrones en adaptant le schéma de générationde code dirigé par les horloges de Lustre. L’informationde typage contrôle certains compromis entre temps etespace dans les circuits générés. / This thesis addresses the design and implementationof a programming language for real-time streaming applications,such as video decoding. The model of Kahnprocess networks is a natural fit for this area and hasbeen used extensively. In this model, a program consistsin a set of parallel processes communicating via singlereader, single writer queues. The strength of the modellies in its determinism.Synchronous functional languages such as Lustre arededicated to critical embedded systems. A Lustre programdefines a synchronous Kahn process network, thatis, which can be executed using finite queues and withoutdeadlocks. This is enforced by a dedicated type system,the clock calculus, which establishes a global timescale throughout a program. The global time scale isused to define clocks: per-queue boolean sequences indicating,for each time step, whether a process producesor consumes a token in the queue. This information isused both for enforcing synchrony and for generatingfinite-state software or hardware.We propose and study integer clocks, a generalizationof boolean clocks featuring arbitrarily big natural numbers.Integer clocks model the production or consumptionof several values from the same queue in the courseof a time step. We then rely on integer clocks to definethe local time scale construction, which may hide timesteps performed by a sub-program from the surroundingcontext.These principles are integrated into a clock calculus fora higher-order functional language. We study its properties,proving among other results that well-typed programsdo not deadlock. We adjust the clock-directedcode generation scheme of Lustre to generate finite-statedigital synchronous circuits from typed programs. Thetyping information controls certain trade-offs betweentime and space in the generated circuits.
|
96 |
CuneiformBrandt, Jörgen 29 January 2021 (has links)
In der Bioinformatik und der Next-Generation Sequenzierung benötigen wir oft große und komplexe Verarbeitungsabläufe um Daten zu analysieren. Die Werkzeuge und Bibliotheken, die hierin die Verarbeitungsschritte bilden, stammen aus unterschiedlichen Quellen und exponieren unterschiedliche Schnittstellen, was ihre Integration in Datenanalyseplattformen erschwert. Hinzu kommt, dass diese Verarbeitungsabläufe meist große Datenmengen prozessieren weshalb Forscher erwarten, dass unabhängige Verarbeitungsschritte parallel laufen. Der Stand der Technik im Feld der wissenschaftlichen Datenverarbeitung für Bioinformatik und Next-Generation Sequenzierung sind wissenschaftliche Workflowsysteme. Ein wissenschaftliches Workflowsystem erlaubt es Forschern Verarbeitungsabläufe als Workflow auszudrücken. Solch ein Workflow erfasst die Datenabhängigkeiten in einem Verarbeitungsablauf, integriert externe Software und erlaubt es unabhängige Verarbeitungsschritte zu erkennen, um sie parallel auszuführen.
In dieser Arbeit präsentieren wir Cuneiform, eine Workflowsprache, und ihre verteilte Ausführungsumgebung. Für Cuneiform's Design nehmen wir die Perspektive der Programmiersprachentheorie ein. Wir lassen Methoden der funktionalen Programmierung einfließen um Komposition und Datenabhängigkeiten auszudrücken. Wir nutzen operationelle Semantiken um zu definieren, wann ein Workflow wohlgeformt und konsistent ist und um Reduktion zu erklären. Für das Design der verteilten Ausführungsumgebung nehmen wir die Perspektive der verteilten Systeme ein. Wir nutzen Petri Netze um die Kommunikationsstruktur der im System beteiligten Agenten zu erklären. / Bioinformatics and next-generation sequencing data analyses often form large and complex pipelines. The tools and libraries making up the processing steps in these pipelines come from different sources and have different interfaces which hampers integrating them into data analysis frameworks. Also, these pipelines process large data sets. Thus, users need to parallelize independent processing steps. The state of the art in large-scale scientific data analysis for bioinformatics and next-generation sequencing are scientific workflow systems. A scientific workflow system allows researchers to describe a data analysis pipeline as a scientific workflow which integrates external software, defines the data dependencies forming a data analysis pipeline, and parallelizes independent processing steps. Scientific workflow systems consist of a workflow language providing a user interface, and an execution environment. The workflow language determines how users express workflows, reuse and compose workflow fragments, integrate external software, how the scientific workflow system identifies independent processing steps, and how we derive optimizations from a workflow's structure. The execution environment schedules and runs data processing operations.
In this thesis we present Cuneiform, a workflow language, and its distributed execution environment. For Cuneiform's design we take the perspective of programming languages. We adopt methods from functional programming towards composition and expressing data dependencies. We apply operational semantics and type systems to define well-formedness, consistency, and reduction of Cuneiform workflows. For the design of the distributed execution environment we take the perspective of distributed systems. We apply Petri nets to define the communication patterns among the distributed execution environment's agents.
|
97 |
Efficient multiple hypothesis tracking using a purely functional array languageNolkrantz, Marcus January 2022 (has links)
An autonomous vehicle is a complex system that requires a good perception of the surrounding environment to operate safely. One part of that is multiple object tracking, which is an essential component in camera-based perception whose responsibility is to estimate object motion from a sequence of images. This requires an association problem to be solved where newly estimated object positions are mapped to previously predicted trajectories, for which different solution strategies exist. In this work, a multiple hypothesis tracking algorithm is implemented. The purpose is to demonstrate that measurement associations are improved compared to less compute-intensive alternatives. It was shown that the implemented algorithm performed 13 percent better than an intersection over union tracker when evaluated using a standard evaluation metric. Furthermore, this work also investigates the usage of abstraction layers to accelerate time-critical parallel operations on the GPU. It was found that the execution time of the tracking algorithm could be reduced by 42 percent by replacing four functions with implementations written in the purely functional array language Futhark. Finally, it was shown that a GPU code abstraction layer can reduce the knowledge barrier required to write efficient CUDA kernels.
|
98 |
Relativistic Causal Ordering A Memory Model for Scalable Concurrent Data StructuresTriplett, Josh 01 January 2012 (has links)
High-performance programs and systems require concurrency to take full advantage of available hardware. However, the available concurrent programming models force a difficult choice, between simple models such as mutual exclusion that produce little to no concurrency, or complex models such as Read-Copy Update that can scale to all available resources. Simple concurrent programming models enforce atomicity and causality, and this enforcement limits concurrency. Scalable concurrent programming models expose the weakly ordered hardware memory model, requiring careful and explicit enforcement of causality to preserve correctness, as demonstrated in this dissertation through the manual construction of a scalable hash-table item-move algorithm. Recent research on "relativistic programming" aims to standardize the programming model of Read-Copy Update, but thus far these efforts have lacked a generalized memory ordering model, requiring data-structure-specific reasoning to preserve causality. I propose a new memory ordering model, "relativistic causal ordering", which combines the scalabilty of relativistic programming and Read-Copy Update with the simplicity of reader atomicity and automatic enforcement of causality. Programs written for the relativistic model translate to scalable concurrent programs for weakly-ordered hardware via a mechanical process of inserting barrier operations according to well-defined rules. To demonstrate the relativistic causal ordering model, I walk through the straightforward construction of a novel concurrent hash-table resize algorithm, including the translation of this algorithm from the relativistic model to a hardware memory model, and show through benchmarks that the resulting algorithm scales far better than those based on mutual exclusion.
|
99 |
A Performance Comparison of Java Streams and Imperative Loops / En prestandajämförelse av Java streams och imperativa looparÅkerfeldt, Magnus January 2023 (has links)
The Stream API was added in Java 8. With the help of lambda expressions (anonymous functions), streams enable functional-style operations on sequences of elements. In this project, we evaluate how streams perform in comparison to imperative loops in terms of execution time, from the perspective of how streams are commonly used in public GitHub repositories. Additionally, two algorithms are implemented with and without streams, to assess the impact of stream usage on algorithmic performance. Parallel streams are only examined briefly due to their infrequent usage. We find that sequential streams in general are slower than imperative loops. However, stream performance heavily relies on how many elements are being processed, which is referred to as input size. For input sizes smaller than 100, most stream pipelines are several times slower than imperative loops. Meanwhile, for input sizes between 10 000 and 1 000 000, streams are on average only 39% to 74% slower than loops, and in some cases, they even slightly outperform them. Additionally, we observe that using streams when implementing algorithms in some cases leads to much slower execution times, while in other cases, it barely affects the execution time at all. We conclude that stream performance primarily depends on input size, presumably because of the high overhead abstraction cost of creating streams, but their performance also depends on other factors, such as operation type and pipeline length. / Med Java 8 introducerades streams. Med hjälp av lambda-uttryck (anonyma funktioner) möjliggör streams användandet av funktionella operationer på sekvenser av element. I detta projekt mäter vi hur streams presterar i jämförelse med imperativa loopar med hänsyn till exekveringstid, från perspektivet av hur streams vanligen används i publika GitHub-projekt. Parallella streams undersöks endast i begränsad utsträckning, på grund av hur sällan de används. Resultaten visar att streams överlag är långsammare än imperativa loopar. Skillnaden i prestanda beror dock starkt på indatastorleken, det vill säga hur många element som streamen bearbetar. För indatastorlekar mindre än 100 element är streams ofta flera gånger långsammare än deras imperativa motsvarigheter. Samtidigt är streams i genomsnitt endast 39% till 74% långsammare än imperativa motsvarigheter för indatastorlekar mellan 10 000 och 1 000 000 element, och i några fall är de till och med något snabbare än imperativ kod. Vidare observerar vi att användning av streams vid implementation av algoritmer i vissa fall leder till mycket längre exekveringstider, medan det i andra fall knappt påverkar exekveringstiden alls. Vi drar slutsatsen att prestandan av streams främst beror på indatastorlek, men också på andra faktorer, såsom operationstyp och hur många operationer som används i en pipeline.
|
100 |
Sur l’utilisation du langage de programmation Scheme pour le développement de jeux vidéoSt-Hilaire, David 10 1900 (has links)
Ce mémoire vise à recenser les avantages et les inconvénients de
l'utilisation du langage de programmation fonctionnel dynamique
Scheme pour le développement de jeux vidéo. Pour ce faire, la
méthode utilisée est d'abord basée sur une approche plus théorique. En
effet, une étude des besoins au niveau de la programmation exprimés
par ce type de développement, ainsi qu'une description détaillant les
fonctionnalités du langage Scheme pertinentes au développement de
jeux vidéo sont données afin de bien mettre en contexte le sujet. Par
la suite, une approche pratique est utilisée en effectuant le
développement de deux jeux vidéo de complexités croissantes: Space Invaders et
Lode Runner. Le développement de ces jeux vidéo a mené à l'extension du
langage Scheme par plusieurs langages spécifiques au domaine et
bibliothèques, dont notamment un système de programmation orienté
objets et un système de coroutines. L'expérience acquise par le
développement de ces jeux est finalement comparée à celle d'autres
développeurs de jeux vidéo de l'industrie qui ont utilisé Scheme
pour la création de titres commerciaux. En résumé, l'utilisation de ce
langage a permis d'atteindre un haut niveau d'abstraction favorisant
la modularité des jeux développés sans affecter les performances de
ces derniers. / This master's thesis aims at pinpointing the pros and cons of using
the dynamic functionnal language Scheme for developing video
games. The method used is first based on a theoretical
approach. Indeed, the specific requirements for video game programming
and a detailed description of relevant Scheme features are presented.
Then, a practical approach is taken by presenting two video games
developed using the Scheme language: Space Invaders and Lode Runner. Their
development resulted in the creation of various domain-specific
languages and libraries, such as an objec- oriented system and a
coroutine system. Each of these are presented separately in their respective
chapter. Finally, the experience achieved in this process is compared
to the experience acquired by some video game companies that also used
Scheme for the developpement of their titles. The use of
Scheme allowed us to perform various high-level abstractions that
improved the modularity of the video games developed, without
affecting their performance.
|
Page generated in 0.071 seconds