• Title/Summary/Keyword: 하스켈

Search Result 10, Processing Time 0.026 seconds

Deterministic Parallelism for Symbolic Execution Programs based on a Name-Freshness Monad Library

  • Ahn, Ki Yung
    • Journal of the Korea Society of Computer and Information
    • /
    • v.26 no.2
    • /
    • pp.1-9
    • /
    • 2021
  • In this paper, we extend a generic library framework based on the state monad to exploit deterministic parallelism in a purely functional language Haskell and provide benchmarks for the extended features on a multicore machine. Although purely functional programs are known to be well-suited to exploit parallelism, unintended squential data dependencies could prohibit effective parallelism. Symbolic execution programs usually implement fresh name generation in order to prevent confusion between variables in different scope with the same name. Such implementations are often based on squential state management, working against parallelism. We provide reusable primitives to help developing parallel symbolic execution programs with unbound-genercis, a generic name-binding library for Haskell, avoiding sequential dependencies in fresh name generation. Our parallel extension does not modify the internal implementation of the unbound-generics library, having zero possibility of degrading existing serial implementations of symbolic execution based on unbound-genecrics. Therefore, our extension can be applied only to the parts of source code that need parallel speedup.

Development of an Assembly Language Interpreter Using Monad (모나드를 이용한 어셈블리 언어 인터프리터 개발)

  • Byun, Sug-Woo
    • Journal of KIISE:Software and Applications
    • /
    • v.37 no.5
    • /
    • pp.403-410
    • /
    • 2010
  • Monad in Haskell allows one to do imperative-style programming as well as pure functional programming. In this work, we characterize monadic abstraction and its programming technique by restructuring an assembly language interpreter coded in pure functional style into the one by the monadic style. Monad programming consists of two phases; the State monad is applied to a stack and a symbol table, and then a State Monad Transformer integrating these two monads is constructed. As a result, we can see that the program code by monad programming is much clearer and more intuitive than one written in the pure functional style.

Feasibility Study Of Functional Programming In Scala Language By Implementing An Interpreter

  • Sugwoo, Byun
    • Journal of the Korea Society of Computer and Information
    • /
    • v.28 no.2
    • /
    • pp.111-119
    • /
    • 2023
  • In this paper, we investigate the feasibility of functional programming in the Scala language. The main issue is to what extent Scala is able to handle major properties of functional programming such as lambda expression, high-order functions, generic types, algebraic data types, and monads. For this purpose, we implement an interpreter of an imperative language. In this implementation, the same functional programming techniques are applied to both Haskell and Scala languages, and then these two versions of implementations are compared and analyzed. The abstract syntax tree of an imperative language is expressed as algebraic data types with generics and enum classes in Scala, and the state transition of imperative languages is implemented by using state monad. Extension and given, new features of Scala, are used as well.

Real-Time Functional Reactive Program Translator for Embedded Systems (임베디드 시스템을 위한 실시간 함수형 반응적 프로그램 변환기)

  • Lee, Dong-Ju;Woo, Gyun
    • The KIPS Transactions:PartA
    • /
    • v.13A no.6 s.103
    • /
    • pp.481-488
    • /
    • 2006
  • FRP(Functional Reactive Programming) is a kind of embedded language in Haskell, it declaratively program reactive system based on two essential high-order types named behavior and events. This Paper design and implementation RT-FRP(Real-time Functional Reactive Programming) translator for using FRP in embedded systems with many constraints. The RT-FRP translator generates a C Program from an RT-FRP program according to the operational semantics of the RT-FRP language. To show the effectiveness of the RT-FRP translator, we loaded and executed the test program generated by the translator onto a real embedded system, LEGO Mindstorm. According to the experimental result, the reactive system software can be programmed more concisely using RT-FRP than using an imperative counter part although the size of the binary code is rather increased.

Exception Handling Technique in Lazy Functional Language from the Viewpoint of Program Synthesis (프로그램 합성 관점에서 지연 함수형 언어의 예외처리 기법)

  • Lee, Dong-Ju;Woo, Gyun
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2006.10b
    • /
    • pp.586-589
    • /
    • 2006
  • 순수 함수형 언어에서 예외처리를 구현하는 것은 매우 까다로운 문제이다. 지연계산, 참조투명성과 같은 주요 특징은 예외 처리와 상반된 성질을 가지는 때문이다. 예외의 처리순서는 계산순서와 관계가 있고, 예외의 발생순서는 참조투명성과 밀접한 관계가 있다. 본 논문은 현재 하스켈(Haskell)에서 구현된 예외처리 방법의 분석을 통해, 프로그램 수행 시 효율적인 예외처리 방법에 대해서 제시한다. 합성된 프로그램에서 예외 발생할 때 예외가 전달되는 것을 사전에 차단하는 방법을 이용한다. 실제 예외가 발생한 프로그램을 작성하고, 프로파일링을 통하여 이 방법의 효율성을 점검한다.

  • PDF

Implementation of Nondeterministic Compiler Using Monad (모나드를 이용한 비결정적 컴파일러 구현)

  • Byun, Sugwoo
    • Journal of the Korea Society of Computer and Information
    • /
    • v.19 no.2
    • /
    • pp.151-159
    • /
    • 2014
  • We discuss the implementation of a compiler for an imperative programming language, using monad in Haskell. This compiler involves a recursive-descent parser conducting nondeterministic parsing, in which backtracking occurs to try with other rules when the application of a production rule fails to parse an input string. Haskell has some strong facilities for parsing. Its algebraic types represent abstract syntax trees in a smooth way, and program codes by monad parsing are so concise that they are highly readable and code size is reduced significantly, comparing with other languages. We also deal with the runtime environment of the assembler and code generation whose target is the Stack-Assembly language based on a stack machine.

Parallelization of a Purely Functional Bisimulation Algorithm

  • Ahn, Ki Yung
    • Journal of the Korea Society of Computer and Information
    • /
    • v.26 no.1
    • /
    • pp.11-17
    • /
    • 2021
  • In this paper, we demonstrate a performance boost by parallelizing a purely functional bisimulation algorithm on a multicore processor machine. The key idea of this parallelization is exploiting the referential transparency of purely functional programs to minimize refactoring of the original implementation without any parallel constructs. Both original and parallel implementations are written in Haskell, a purely functional programming language. The change from the original program to the parallel program is minuscule, maintaining almost original structure of the program. Through benchmark, we show that the proposed parallelization doubles the performance of the bisimulation test compared to the original non-parallel implementation. We also shaw that similar performance boost is also possible for a memoized version of the bisimulation implementation.

Lock-free unique identifier allocation for parallel macro expansion

  • Son, Bum-Jun;Ahn, Ki Yung
    • Journal of the Korea Society of Computer and Information
    • /
    • v.27 no.4
    • /
    • pp.1-8
    • /
    • 2022
  • In this paper, we propose a more effective unique identifier allocation method for macro expansion in a single-process multicore parallel computing environment that does not require locks. Our key idea for such an allocation method is to remove sequential dependencies using the remainder operation. We confirmed that our lock-free method is suitable for improving the performance of parallel macro expansion through the following benchmark: we patched an existing library, which is based on a sequential unique identifier allocation, with our proposed method, and compared the performances of the same program but using two different versions of the library, before and after the patch.

Performance Comparison between Haskell Eval Monad and Cloud Haskell (Haskell Eval 모나드와 Cloud Haskell 간의 성능 비교)

  • Kim, Yeoneo;An, Hyungjun;Byun, Sugwoo;Woo, Gyun
    • Journal of KIISE
    • /
    • v.44 no.8
    • /
    • pp.791-802
    • /
    • 2017
  • Competition in the modern CPU market has shifted from speeding up the clock speed of a single core to increasing the number of cores. As such, there is a growing interest in parallel programming to maximize the use of resources of many core processors. In this paper, we propose parallel programming models in Haskell to find an advisable parallel programming model for many-core environments. Specifically, we used Eval monad and Cloud Haskell to develop two versions of parallel programs: plagiarism detection and K-means. Then, we evaluated the performance of the developed programs in 32-core and 120-core environments. The results of our experiment show that the Eval monad is highly efficient in an environment with a small number of cores. On the other hand, the Cloud Haskell runtime shows 37% improvement over Eval monad and the scalability shows a 134% improvement over Eval monad as the number of cores increases.

Tuning the Performance of Haskell Parallel Programs Using GC-Tune (GC-Tune을 이용한 Haskell 병렬 프로그램의 성능 조정)

  • Kim, Hwamok;An, Hyungjun;Byun, Sugwoo;Woo, Gyun
    • KIISE Transactions on Computing Practices
    • /
    • v.23 no.8
    • /
    • pp.459-465
    • /
    • 2017
  • Although the performance of computer hardware is increasing due to the development of manycore technologies, software lacking a proportional increase in throughput. Functional languages can be a viable alternative to improve the performance of parallel programs since such languages have an inherent parallelism in evaluating pure expressions without side-effects. Specifically, Haskell is notably popular for parallel programming because it provides easy-to-use parallel constructs based on monads. However, the scalability of parallel programs in Haskell tends to fluctuate as the number of cores increases, and the garbage collector is suspected to be the source of this fluctuations because it affects both the space and the time needed to execute the programs. This paper uses the tuning tool, GC-Tune, to improve the scalability of the performance. Our experiment was conducted with a parallel plagiarism detection program, and the scalability improved. Specifically, the fluctuation range of the speedup was narrowed down by 39% compared to the original execution of the program without any tuning.