- 다양한 주제에 대해 자유롭게 글을 작성하는 게시판입니다.
Date 17/01/09 05:44:04
Name   O Happy Dagger
Subject   Shakespeare, a programming language
오늘 타임라인을 읽다가 moira님이 쓴 글이 보였어요.

https://www.redtea.kr/pb/view.php?id=timeline&no=16631

내용은 <만약 헤밍웨이가 자바스크립트로 코딩한다면: 피보나치, 팩토리얼, 행복수, 소수, 메서드 체인에 대한 문학 거장들의 기발한 해법>라는 책에 대한 소개와 더불어 개인적인 경험에 대한 이야기였는데, 그 글을 보면서 생각난게 좀 오래된 프로그래밍 언어중에 하나로 Shakespeare라는 프로그래밍 랭귀지예요. 이 언어는 실재로 코딩을 위한 언어라기보다는, 프로그래밍 언어가 어느정도까지 변형 혹은 그 폭이 될 수 있는가를 보여주는 언어인데요. 코딩을 하고나면 마치 희곡을 쓴 것 같은 느낌이 듭니다. 90년대 초에 나와서 컴파일러까지 개발이 되어 있어서 컴파일을 해 보고 싶으시면 sourceforge에서 컴파일러를 다운 받아서 해 보시면 될꺼예요.

http://shakespearelang.sourceforge.net/report/shakespeare/

위의 링크에 보면 예제가 있는데, 세익스피어로 소수를 찾는 프로그래밍을 하면 아래와같이 된다고 합니다. 엄청길고 쓸모없어보이지만... 약간의 문학적 향취가 느껴지기는 하나요???

Prime Number Computation in Copenhagen.

Romeo, a young man of Verona.
Juliet, a young woman.
Hamlet, a temporary variable from Denmark.
The Ghost, a limiting factor (and by a remarkable coincidence also
        Hamlet's father).


                    Act I: Interview with the other side.

                    Scene I: At the last hour before dawn.

[Enter the Ghost and Juliet]

The Ghost:
You pretty little warm thing! Thou art as prompt as the difference
between the square of thyself and your golden hair. Speak your mind.

Juliet:
Listen to your heart!

[Exit the Ghost]

[Enter Romeo]

Juliet:
Thou art as sweet as a sunny summer's day!


                    Act II: Determining divisibility.

                    Scene I: A private conversation.

Juliet:
Art thou more cunning than the Ghost?

Romeo:
If so, let us proceed to scene V.

[Exit Romeo]

[Enter Hamlet]

Juliet:
You are as villainous as the square root of Romeo!

Hamlet:
You are as lovely as a red rose.

                    Scene II: Questions and the consequences thereof.

Juliet:
Am I better than you?

Hamlet:
If so, let us proceed to scene III.

Juliet:
Is the remainder of the quotient between Romeo and me as good as
nothing?

Hamlet:
If so, let us proceed to scene IV.
Thou art as bold as the sum of thyself and a roman.

Juliet:
Let us return to scene II.

                    Scene III: Romeo must die!

[Exit Hamlet]

[Enter Romeo]

Juliet:
Open your heart.

[Exit Juliet]

[Enter Hamlet]

Romeo:
Thou art as rotten as the difference between nothing and the sum of a
snotty stinking half-witted hog and a small toad!
Speak your mind!

[Exit Romeo]

[Enter Juliet]

                    Scene IV: One small dog at a time.

[Exit Hamlet]

[Enter Romeo]

Juliet:
Thou art as handsome as the sum of thyself and my chihuahua!
Let us return to scene I.

                    Scene V: Fin.

[Exeunt]



2


    목록
    번호 제목 이름 날짜 조회 추천
    2903 음악SEVN THOMAS 8 눈부심 16/05/27 4095 3
    4448 과학/기술SEWOL X 40 하니n세이버 16/12/26 8540 0
    6362 과학/기술SF속 우주선이 현실로? 2 키스도사 17/10/02 5628 0
    5751 문화/예술Shaka, bruh! 14 elanor 17/06/06 5794 7
    4579 기타Shakespeare, a programming language 8 O Happy Dagger 17/01/09 5528 2
    726 음악Shawn Colvin - Sunny came home 2 새의선물 15/08/04 6613 0
    1974 기타Sherlock - 1~3시즌 전편를 OCN에서 방송합니다. 4 Beer Inside 16/01/08 5352 0
    12254 음악Silk Sonic - Smoking out the window 4 ikuk 21/11/08 5687 1
    811 음악Silly Sisters - My husband's got no courage in him 6 새의선물 15/08/18 5431 0
    684 음악Sinead O'Connor - This is a rebel song 4 새의선물 15/07/30 8049 0
    1880 음악Siúil A Rún/Johnny Has Gone for a Soldier/Gone the Rainbow 1 새의선물 15/12/29 7000 0
    774 음악Six Pence None the Richer - Kiss me 11 새의선물 15/08/11 5605 0
    13250 사회SK 데이터센터, 4시간前 ‘위험 경고’에도 배터리 화재 못막아 9 Leeka 22/10/20 3346 1
    8693 게임SKT vs 담원 '바론 한타' 뜯어보기.txt 6 Messi 18/12/28 4533 0
    5786 게임SKT 롤드컵 스킨 귀환 모션이 모두 공개되었습니다. 9 Leeka 17/06/13 4612 1
    3792 게임SKT와 ROX를 보며 97, 98년의 NBA를 떠올리다 (응원글) 14 Vinnydaddy 16/09/28 4927 6
    4037 게임SKT와 삼성이 롤드컵에서 당했던 밴들 정리 Leeka 16/10/29 4061 0
    917 IT/컴퓨터SKT의 LTE속도가 더 빨라졌습니다. 2 Leeka 15/09/04 4718 0
    2022 경제SK김창근 의장 직속 M&A 등 재무지원 독립조직 ‘IFST’ 신설!! 6 dbdksxk 16/01/13 6860 0
    2092 음악Sleeping At Last, Saturn 6 꽈리다방 16/01/22 6657 1
    14741 방송/연예SM, '매출 10% 못 주겠다'는 첸백시에 계약 이행 소송 4 도르맘무 24/06/13 3006 0
    2106 기타snow snow... 13 새의선물 16/01/24 4971 1
    11066 일상/생각SNS 가 없었다면 어땠을까 생각해봅니다. 4 nothing 20/10/18 5160 0
    4184 일상/생각SNS 이야기 5 nickyo 16/11/18 4030 6
    7692 도서/문학So sad today 감상평 2 DrCuddy 18/06/15 4920 6
    목록

    + : 최근 2시간내에 달린 댓글
    + : 최근 4시간내에 달린 댓글

    댓글