라쿠 (프로그래밍 언어)

위키백과, 우리 모두의 백과사전.

라쿠
패러다임멀티 패러다임
설계자래리 월
최근 버전6.d 'Diwali'[1]
최근 버전 출시일2020년 10월 24일(3년 전)(2020-10-24)
자료형 체계동적, 정적, 점진적
운영 체제크로스 플랫폼
라이선스GNU GPL, 아티스틱 라이선스
웹사이트raku.org
주요 구현체
라쿠도
영향을 받은 언어
하스켈,[2] 자바스크립트, 펄 5, 루비, 스몰토크

라쿠(Raku, 과거 명칭: 펄 6/Perl 6)는 프로그래밍 언어의 주요 버전이다. 현대의 수많은 역사적인 언어들의 요소들이 도입되어 있다. 초기 버전의 펄과의 하위 호환성이 목적은 아니지만 호환성 모드는 규격의 일부이다. 라쿠의 디자인 설계는 2000년에 시작되었다.

구현체[편집]

Niecza는 최적화 및 효율적인 구현 연구에 초점을 맞추고 있으며 공통 언어 기반을 대상으로 한다.[3]

예제[편집]

Hello world 프로그램[편집]

 say 'Hello, world'

퀵소트(Quicksort)[편집]

 # Empty list sorts to the empty list
 multi quicksort([]) { () }

 # Otherwise, extract first item as pivot...
 multi quicksort([$pivot, *@rest]) {
     # Partition.
     my @before = @rest.grep(* < $pivot);
     my @after  = @rest.grep(* >= $pivot);

     # Sort the partitions.
     (quicksort(@before), $pivot, quicksort(@after))
 }

하노이 탑(Tower of Hanoi)[편집]

 multi sub hanoi(0, $, $, $) { }                         # No disk, so do not do anything
 multi sub hanoi($n, $a = 'A', $b = 'B', $c = 'C') {     # Start with $n disks and three pegs A, B, C
     hanoi $n - 1, $a, $c, $b;                           # firstly move top $n - 1 disks from A to B
     say "Move disk $n from peg $a to peg $c";           # then move last disk from A to C
     hanoi $n - 1, $b, $a, $c;                           # lastly move $n - 1 disks from B to C
 }

각주[편집]

  1. “Announce: Raku Perl 6 'Diwali' 6.d Language Specification Release”. 《blogs.perl.org》. Zoffix Znet. 2018년 11월 5일. 2022년 8월 19일에 확인함. 
  2. “Glossary of Terms and Jargon”. 《Perl Foundation Perl 6 Wiki》. The Perl Foundation. February 28. 2012년 1월 21일에 원본 문서에서 보존된 문서. 2012년 2월 9일에 확인함. 
  3. O'Rear, Stefan (2011년 11월 29일). “Niecza README.pod”. 2012년 1월 12일에 확인함. 

외부 링크[편집]