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

https://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


    목록
    번호 제목 이름 날짜 조회 추천
    11379 경제전통 자동차 브랜드는 파운드리를 꿈꾸는가? 6 lonely INTJ 21/01/25 4385 4
    10775 경제[펌] 착한 사장님들 씨가 마른 이유?? 10 Groot 20/07/14 4385 0
    10943 일상/생각이상형은 직감인가? 신기루인가? 6 순수한글닉 20/09/09 4385 0
    11397 철학/종교(번역)자크 엘륄: 우리가 자유롭다는 환상 6 ar15Lover 21/02/06 4385 6
    2123 기타which side are you on? 12 새의선물 16/01/26 4386 2
    8857 스포츠고지라를 쓰러뜨릴 수 없다면 도망쳐라 10 温泉卵 19/02/12 4386 10
    5440 경제[특징주] 안랩, 6거래일 연속 하락 16 Beer Inside 17/04/14 4386 0
    9623 게임젠지 팬에게 가을 젠지는 없었다. 1 싸펑피펑 19/09/04 4386 2
    9506 스포츠[MLB] 류현진 IL 7 김치찌개 19/08/03 4386 0
    11406 일상/생각최근 사용한? 것 두 가지 후기 (커블, 남자 수염 제모) 9 양라곱 21/02/09 4386 3
    11431 게임2021 IEM 월챔 프리뷰-스타2 207 the hive 21/02/20 4386 2
    758 영화[계층/네타] 러브라이브 극장판을 보고 왔습니다. 1 西木野真姫 15/08/09 4387 0
    1778 일상/생각변했을까? 2 레이드 15/12/15 4387 0
    4399 역사러일전쟁 - 펑톈 전투 4 눈시 16/12/16 4387 5
    10059 음악애꾸눈 키드선장의 고백 2 바나나코우 19/12/07 4387 4
    6365 도서/문학지난 달 Yes24 도서 판매 순위 1 AI홍차봇 17/10/03 4388 0
    11893 오프모임마감)7월 19일 월요일 19시 30분 광주상무지구 대광식당 육전묵읍시당. 50 Regenbogen 21/07/17 4388 5
    12614 정치푸틴은 어쩌다 '푸틀러'가 되었나 12 귀여운무민 22/03/12 4388 1
    4579 기타Shakespeare, a programming language 8 O Happy Dagger 17/01/09 4389 2
    5176 일상/생각똥 먹었습니다. 18 에밀 17/03/14 4389 6
    6169 사회법원 삼성 이재용 부회장 징역 5년 선고 30 empier 17/08/25 4389 0
    9575 역사안중근 의사의 동지 우덕순은 밀정확정? 안티파시즘 19/08/23 4389 11
    12156 경제정부가 대출을 막는 이유 27 Folcwine 21/10/11 4389 8
    2714 방송/연예[I.O.I] 스텐바이 I.O.I 2화 3 Leeka 16/04/30 4390 0
    3274 일상/생각. 32 리틀미 16/07/15 4390 0
    목록

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

    댓글