• Title/Summary/Keyword: Haskell

Search Result 34, Processing Time 0.021 seconds

Compiling Haskell to Java via an Intermediate Code L (중간언어 L-코드를 이용한 Haskell-Java 언어 번역기 구현)

  • Choi, Kwang-Hoon;Han, Tai-Sook
    • Journal of KIISE:Software and Applications
    • /
    • v.28 no.12
    • /
    • pp.955-965
    • /
    • 2001
  • We propose a systematic method of compiling Haskell based on the spineless Tagless G-machine (STGM) for the Java, Virtual Machine (JVM) We introduce an intermediate language called L-code to identify each micro-operation of the machine by its instruction, Each macro operation of the machine is identified by a binding Each instruction of the L-code can be easily translated into Java statements. After our determination on representation and L-code program from a STG program is translated into Java program according to out compilation rules. Our experiment shows that the execution times of translated benchmarks are competitive compared with those in Haskell interpreter Hugs, particularly when Glasgow Haskell compiler's STG -level optimizations are applied.

  • PDF

Solution for Knapsack Problem using DNA Computing with Code Optimized DNA-Haskell (코드 최적화 DNA-Haskell을 도입한 DNA 컴퓨팅에 의한 배낭 문제 해결)

  • 김은경;이상용
    • Proceedings of the Korean Institute of Intelligent Systems Conference
    • /
    • 2004.10a
    • /
    • pp.539-542
    • /
    • 2004
  • 배낭 문제는 조합 최적화 문제로서, 다항 시간(polynomial time)에 풀리지 않는 NP-hard 문제이다 이 문제를 해결하기 위해 기존에는 DNA 컴퓨팅 기법과 GA 등을 사용하여 해결하였다. 하지만 기존의 방법들은 DNA의 정확한 특성을 고려하지 않아, 실제 실험과의 결과 차이가 발생하고 있다. 본 논문에서는 DNA 컴퓨팅 실험 과정에서 발생하는 DNA 조작 오류를 최소화하고, 보다 정확한 예측을 위해 함수 언어인 Haskell을 이용한 코드 최적화 DNA-Haskell을 제안한다. 코드 최적화 DNA-Haskell은 배낭 문제 중 (0,1)-배낭 문제에 적용하였고, 그 결과 기존의 DNA 컴퓨팅 방법보다 실험적 오류를 최소화하였으며, 또한 적합한 해를 빠른 시간 내에 찾을 수 있었다.

  • PDF

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.

Package Data Type in Haskell (Haskell에서의 패키지 데이터 형)

  • 장학상;권기항
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2004.10a
    • /
    • pp.760-762
    • /
    • 2004
  • 순수 함수형 프로그래밍 언어 Haskell에서의 데이터 추상은 대수 데이터형과 관련 함수로 묶어진 모듈의 인터페이스만을 노출함으로써 이루어진다. 이러한 데이터 추상에 대한 제한된 용법은 프로그램 설계에 있어 유용하게 사용되는 패턴 매칭을 제약하고, 파일 단위의 추상을 요구함으로써 데이터 구조 단위의 데이터 추상을 불가능하게 한다. 본 논문은 Haskell의 제한된 데이터 추상 문제를 해결하기 위한 방법으로 패키지 데이터형을 제안한다. 패키지 데이터형은 더 작은 단위로 데이터 추상을 가능하게 하고 패턴 매칭을 제악하지 않고 자유롭게 사용할 수 있게 한다.

  • PDF

Improving Haskell GC-Tuning Time Using Divide and Conquer (분할 정복법을 이용한 Haskell GC 조정 시간 개선)

  • An, Hyungjun;Byun, Sugwoo;Woo, Gyun
    • Proceedings of the Korea Information Processing Society Conference
    • /
    • 2017.04a
    • /
    • pp.83-86
    • /
    • 2017
  • 단일 코어 프로세스의 성능 향상은 전력 소모, 발열 등의 이유로 한계에 달했다. 이에 대한 대안으로 멀티 코어가 등장했으며 매니 코어 기술에 대한 연구가 활발히 진행 중에 있다. 이렇듯 멀티 코어 환경이 보편화됨에 따라 병렬 프로그래밍의 중요성이 더욱 커졌다. 한편, 순수 함수형 언어 Haskell은 부수효과가 없고 다양한 병렬화 도구를 지원함으로써 다가오는 병렬 프로그래밍 시대에 적합한 언어라 할 수 있다. 이때 Haskell 병렬 프로그램의 성능은 메모리 재사용(Garbage Collection) 시간에 큰 영향을 받는다. 그래서 Haskell 병렬 프로그램의 성능 향상, 분석을 위한 메모리 프로파일링 도구가 필요하다. 이미 Haskell이 제공하는 메모리 프로파일링 도구로 ghc-gc-tune이 있지만 실행 속도 측면에서 개선이 필요하다. 본 연구에서는 분할 정복법을 이용해서 매 단계마다 탐색 영역을 4분의 1로 줄이도록 ghc-gc-tune을 개선했다. 개선된 ghc-gc-tune을 극대 독립 집합 프로그램과 K-means 프로그램에 적용한 결과, 평균 98%의 정확도로 실행 시간을 평균 7.78배 단축했다.

Apply A Pure Functional Language for Game Programming (게임 프로그래밍을 위한 순수 함수형 언어의 활용)

  • Lee Dong-Ju;Byun Suk-Woo;Woo Gyun
    • Proceedings of the Korea Contents Association Conference
    • /
    • 2005.05a
    • /
    • pp.464-469
    • /
    • 2005
  • The imperative programming language like C language is Generally used when we develop the game program. But there is the need of much effort and time on low-level-details in order to express the game program that has complicated and varied motion. I will try to take measures to use the pure functional language, Haskell as the method of simplifying complex game program. The pure functional programming language like Haskell has excellence of technology and it has become specific in many domains. In this paper I'll discuss the difference between The two languages and merits and demerits in the game development aspect. Also discuss the possibility of putting Haskell to practical use in the future.

  • 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.

Improving Haskell GC-Tuning Time Using Divide-and-Conquer (분할 정복법을 이용한 Haskell GC 조정 시간 개선)

  • An, Hyungjun;Kim, Hwamok;Liu, Xiao;Kim, Yeoneo;Byun, Sugwoo;Woo, Gyun
    • KIPS Transactions on Computer and Communication Systems
    • /
    • v.6 no.9
    • /
    • pp.377-384
    • /
    • 2017
  • The performance improvement of a single core processor has reached its limit since the circuit density cannot be increased any longer due to overheating. Therefore, the multicore and manycore architectures have emerged as viable approaches and parallel programming becomes more important. Haskell, a purely functional language, is getting popular in this situation since it naturally supports parallel programming owing to its beneficial features including the implicit parallelism in evaluating expressions and the monadic tools supporting parallel constructs. However, the performance of Haskell parallel programs is strongly influenced by the performance of the run-time system including the garbage collector. Though a memory profiling tool namely GC-tune has been suggested, we need a more systematic way to use this tool. Since GC-tune finds the optimal memory size by executing the target program with all the different possible GC options, the GC-tuning time takes too long. This paper suggests a basic divide-and-conquer method to reduce the number of GC-tune executions by reducing the search area by one-quarter for every searching step. Applying this method to two parallel programs, a maximally independent set and a K-means programs, the memory tuning time is reduced by 7.78 times with accuracy 98% on average.

Technology Trends of Haskell Parallel Programming in the Manycore Era (매니코어 시대를 대비하는 Haskell 병렬 프로그래밍 동향)

  • Kim, J.M.;Byun, S.W.;Kim, K.H.;Jeong, J.H.;Koh, K.W.;Cha, S.J.;Jung, S.J.
    • Electronics and Telecommunications Trends
    • /
    • v.29 no.5
    • /
    • pp.167-175
    • /
    • 2014
  • 매니코어 구조의 고성능 컴퓨팅 시대가 시작되고 있다. 매니코어의 성능을 활용하기 위해서는 병렬 프로그래밍이 필수적인데, 이 방식은 기존 프로그래밍에 비해 훨씬 더 복잡하고 어렵다. 또한 컴퓨터의 성능이 높아짐에 따라 소프트웨어의 규모와 복잡도 또한 증가하게 되며, 소프트웨어를 에러 없이 안전하게 개발하는 것은 매우 어려운 문제가 되고 있다. 이 문제해결에 도움을 줄 수 있는 한 방법으로 기존의 명령형 프로그래밍 언어 대신 Haskell과 같은 순수 함수형 언어의 이용을 고려한다. Haskell은 지난 수십 년 동안 람다 계산법, 타입 이론, 의미론 등의 강력한 이론적 배경하에 최신 기술을 수용하면서 발전하고 있는 순수 함수형 언어이다. 함수의 순수성은 결정적(deterministic) 병렬 프로그래밍을 표현하는데 매우 유리하다. 최근 이와 관련된 매우 고무적인 연구결과가 발표되고 있으며 여러 응용프로그램들이 개발되고 있다. Haskell은 여러 강력한 이론 덕택으로 병렬 프로그래밍뿐만 아니라 소프트웨어의 생산성 및 안정성과 관련된 많은 문제에 도움을 줄 수 있는 다목적 언어로써 주목 받고 있다.

  • PDF