상위 질문
타임라인
채팅
관점

라쿠 (프로그래밍 언어)

펄 6로 알려진 컴퓨터 언어 위키백과, 무료 백과사전

라쿠 (프로그래밍 언어)
Remove ads

라쿠(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
 }
Remove ads

각주

외부 링크

Loading content...
Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads