• Title/Summary/Keyword: 함수형 언어

Search Result 88, Processing Time 0.05 seconds

Design and Implementation of a Lazy Functinal Language Compiler for Java Virtual Machine (자바가상기계를 대상으로 하는 지연계산기반 함수형 언어 컴파일러의 설계 및 구현)

  • 최광훈;임현일;한태숙
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2000.10a
    • /
    • pp.326-328
    • /
    • 2000
  • 본 논문에서는 지연계산기반 함수형 언어 프로그램을 받아 Java 프로그램을 목적 코드로 생성하는 컴파일러를 설계하고 구현한다. 이 컴파일러는 제한된 형태의 함수형 언어 Shared Term Graph(STG)를 입력언어로 하는 추상기계 Spineless Tagiess G-Machine (STGM)을 수행 모델로 한다. 본 논문에서는 명령형 언어 L-code를 제안하고 이를 입력언어로 하는 새로운 형태의 STGM인 L-Machine을 제안한다. STG 언어를 L-code로 변환하는 컴파일러와 L-code를 Java로 변환하는 컴파일러를 설계하고 구현함으로써 원하는 컴파일러를 구성한다. 그리고 Glasgow Haskell 컴파일러를 전단부로 하여 지연계산 기반 함수형 언어 Haskell로 작성된 프로그램들을 컴파일하여 STG 프로그램으로 변환한 다음 본 논문에서 구현한 컴파일러로 이를 Java 프로그램으로 변환한다. 변환된 Java 프로그램을 Sun JIT 컴파일러로 컴파일하여 수행한 성능 평가 결과를 제시한다.

  • PDF

Term Rewriting Semantics of Lazy Functional Programming Languages (지연 함수형 프로그래밍 언어의 항 개서 의미)

  • Byun, Sug-Woo
    • Journal of KIISE:Computer Systems and Theory
    • /
    • v.35 no.3
    • /
    • pp.141-149
    • /
    • 2008
  • Most functional programming languages allows programmers to write ambiguous rules, under the strategy that pattern-matching will be performed in a direction of 'from top to bottom' way. While providing programmers with convenience and intuitive understanding of defining default rules, such ambiguous rules may make the semantics of functional languages unclear. More specifically, it may fail to apply the equational reasoning, one of most significant advantage of functional programming, and may cause to obscure finding a formal way of translating functional languages into the ${\lambda}$-calculus; as a result, we only get an ad hoc translation. In this paper, we associate with separability of term rewriting systems, holding purely-declarative property, pattern-matching semantics of lazy functional languages. Separability can serve a formalism for translating lazy functional languages into the ${\lambda}$-calculus.

A design of the imperative functional language with state (상태를 갖는 명령형 함수언어의 설계)

  • 주형석
    • Journal of the Korea Computer Industry Society
    • /
    • v.2 no.10
    • /
    • pp.1261-1268
    • /
    • 2001
  • Despite of various useful features, functional languages do not provide an efficient way of representing states. To improve expressiveness of functional language, it is required a method representing explicit state without violating of functional semantic properties. In this paper, imperative functional language, $\lambda$st-calculus is designed to represent states without compromising the properties of pure functional languages. And we construct an algorithm to reduce proposed imperative functional language. $\lambda$st-calculus model which is an extension of the $\lambda$-calculus model with explicit state constructor without violating their semantic properties. it improves expressiveness of syntax through a concept of state composition and simplified reduction rules.

  • PDF

Exeution Model for Functional Programming Language with States (상태를 갖는 함수형 프로그래밍 언어의 수행모델)

  • Ju, Hyeong-Seok;Kim, Hong-Eup;Yu, Won-Hui
    • The Transactions of the Korea Information Processing Society
    • /
    • v.4 no.3
    • /
    • pp.846-858
    • /
    • 1997
  • Despite elaegant semantics and a lot of features, pure functional programming languages do not provide an affcient way of represnting states.Many researches have been done to resolve the problem, however, another problem arises that it is hard to implement becaese of the complex type system and redujction rule.Therefore, the scheme which simplifies the reduction rule and maintains states effciently is needed to have the implemen-taiton dffetive.This paper proposes st-calculus, the excution model of a functinal language with states and proves that the proposed model satistiies the church-Rosser theorem.It has simple reduction rules and the ability of rerpresenting states without, and the difficulties with implementation may be reduced by simplifving the reduction rules.

  • PDF

Compiling Lazy Functional Programs to Java on the basis of Spineless Taxless G-Machine with Eval-Apply Model (Eval-Apply 모델의 STGM에 기반하여 지연 계산 함수형 프로그램을 자바로 컴파일하는 기법)

  • Nam, Byeong-Gyu;Choi, Kwang-Hoon;Han, Tai-Sook
    • Journal of KIISE:Software and Applications
    • /
    • v.29 no.5
    • /
    • pp.326-335
    • /
    • 2002
  • Recently there have been a number of researches to provide code mobility to lazy functional language (LFL) programs by translating LFL programs to Java programs. These approaches are basically baled on architectural similarities between abstract machines of LFLs and Java. The abstract machines of LFLs and Java programming language, Spineless Tagless G-Machine(STGM) and Java Virtual Machine(JVM) respectively, share important common features such as built- in garbage collector and stack machine architecture. Thus, we can provide code mobility to LFLs by translating LFLs to Java utilizing these common features. In this paper, we propose a new translation scheme which fully utilizes architectural common features between STGM and JVM. By redefining STGM as an eval-apply evaluation model, we have defined a new translation scheme which utilizes Java Virtual Machine Stack for function evaluation and totally eliminates stack simulation which causes array manipulation overhead in Java. Benchmark program translated to Java programs by our translation scheme run faster on JDK 1.3 than those translated by the previous schemes.

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

Improvement of YAWS implemented by ERLANG (ERLANG으로 구현한 웹서버 YAWS의 기능개선)

  • 장재원;양하영;유정목;이만호
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2004.04a
    • /
    • pp.394-396
    • /
    • 2004
  • 함수형 언어를 사용하여 작성한 응용 어플리케이션은 성능이 떨어진다는 생각이 지배적이다. 함수형 언어 ERLANG은 성능이 우수한 통신응용프로그램을 작성하기 위하여 개발되었다. ERLANG으로 작성한 웹서버인 YAWS는 범용 웹서버와 성능면에서 뒤지지 않지만 모든 웹 프로그래밍 언어를 지원하지 않는다. 본 연구는 Jsp/Servlets을 서비스 할 수 있도록 YAWS의 기능을 개선하였다.

  • PDF

Avoiding Security Analysis Inaccuracy of SLam Calculus after CPS Transform (CPS 변환 후에도 함수형 SLam 언어의 안전성 정확하게 분석하기)

  • 장성순;이광근
    • Proceedings of the Korean Information Science Society Conference
    • /
    • 2001.04a
    • /
    • pp.76-78
    • /
    • 2001
  • Secure Lambda calculus(SLam)는 정보 보안을 보장해주는 언어이나, Continuation Passing Style(CPS) 변환 후에는 안전성 분석의 정확도가 떨어진다. CPS의 논리적인 성질(ordered linearity)을 반영하여 변환 후에도 정확도가 떨어지지 않는 타입 시스템을 고안하고 무간섭성을 증명하였다. 함수형 SLam 언어에서 정확도가 떨어지는 경우는 앞으로 계산할 값의 인자가 쓰이지 않는 경우임을 밝혀내었다.

Functional Monadic Programming (함수형 모나드 프로그래밍)

  • 변석우
    • Journal of the Korea Institute of Information and Communication Engineering
    • /
    • v.5 no.1
    • /
    • pp.192-201
    • /
    • 2001
  • It has been a long standing problem in research of pure functional programming to program side-effect, input/output, exception handling, nondeterminism, and etc, preserving declarative property and lazy-evaluation of pure functional languages. Being introduced in 1989, Monadic approach has been suggested as a solution to this problem. In this paper, we introduce the principle of functional monadic programming and its various application techniques using the Pure functional language Haskell.

  • PDF

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.