본문 바로가기
KERD
논문KCI 등재

인터프리터 구현을 통한 스칼라 언어의 함수형 프로그래밍에 대한 타당성 연구

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

1

조회

0

다운로드

0

인용

0

참고문헌

키워드

주제분류컴퓨터학

초록

본 논문에서는 스칼라 언어의 함수형 프로그래밍 기능의 타당성에 대해서 검토한다. 주된 관심사는 스칼라가 어느 정도까지 람다 식, 고차 함수, 제너릭 타입, 대수적 타입, 모나드 등 함수형프로그래밍의 주요 특성을 표현할 수 있는 가에 있다. 이 목적을 위하여 명령형 프로그래밍 언어의 인터프리터를 구현한다. 동일한 함수형 프로그래밍 기법을 적용하여 인터프리터를 하스켈과스칼라로 구현한 다음, 이 두 버전의 구현을 비교 분석한다. 명령형 프로그래밍 언어의 추상 구문트리는 스칼라의 제너릭스를 갖는 대수적 타입과 enum 클래스로서 표현되고, 명령형 프로그래밍의 상태 변환은 상태 모나드를 이용하여 구현된다. 또한 스칼라의 새로운 기능인 extension과given도 사용된다.

Abstract

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.

참고문헌 (10)

  1. M. Odersky, "Programming in Scala" (2021), artima
  2. M. Pilquist, "Functional Programming in Scala" (2022), Manning
  3. R. Urma, "Modern Java in Action: Lambdas, streams, functional and reactive programming" (2018), Manning
  4. M. Vermeulen, "Functional Programming in Kotli" (2021), Manning
  5. "Haskell homepage"[URL]
  6. 변석우, "상태 모나드를 이용한 명령형 언어 인터프리터", 한국정보기술학회논문지, 12(2), pp.145~152 (2014), 한국정보기술학회
  7. S. Peyton Jones, "Imperative Functional Programming", 20'th Symposium on Principles of Programming Languages (1993), ACM Press
  8. 변석우, "모나드를 이용한 비결정적 컴파일러 구현", 한국컴퓨터정보학회논문지, 19(2), pp.151~159 (2014), 한국컴퓨터정보학회
  9. Sugwoo Byun, "Functor and Monadic Programming in Haskell", Communications of the Korean Institute of Information Scientists and Engineers, 35(3), pp.33~40 (2017)
  10. "Operational Semantics"[URL]

관련 논문AI추천

이 간행물의 다른 논문 (25건)