- 다양한 주제에 대해 자유롭게 글을 작성하는 게시판입니다.
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


    목록
    번호 제목 이름 날짜 조회 추천
    9454 일상/생각청혼에 대한 기억... 22 o happy dagger 19/07/20 6047 22
    9426 일상/생각기억... 5 o happy dagger 19/07/11 6114 28
    7492 기타시카고 대학의 에세이... 24 o happy dagger 18/05/08 7575 2
    7068 음악Dar Williams - February o happy dagger 18/02/08 4462 1
    5180 기타full fathom five 3 O Happy Dagger 17/03/14 5829 2
    5121 기타잡생각들... 13 O Happy Dagger 17/03/09 5177 4
    5113 기타Joan Baez - Love Is Just A Four Letter Word 2 O Happy Dagger 17/03/08 4833 1
    5019 기타Banks of the Ohio 3 O Happy Dagger 17/02/27 5745 1
    4787 음악ELP - The Great Gates of Kiev 5 O Happy Dagger 17/02/06 5671 1
    4776 음악American Pie 11 O Happy Dagger 17/02/05 7904 6
    4683 기타Nick Cave & Kylie Minogue - Where The Wild Roses Grow O Happy Dagger 17/01/24 6298 1
    4654 기타Filthy 15 4 O Happy Dagger 17/01/19 7298 0
    4641 기타as tears go by 2 O Happy Dagger 17/01/17 5616 2
    4635 기타On Reading Dictee 2 O Happy Dagger 17/01/16 4957 2
    4633 기타kilkelly 4 O Happy Dagger 17/01/16 4304 0
    4615 기타Ms. Hannigan... 11 O Happy Dagger 17/01/13 5141 7
    4602 기타푸코, 데리다, 들뢰즈... O Happy Dagger 17/01/12 4841 2
    4596 기타A Letter to Rora 11 O Happy Dagger 17/01/11 4242 0
    4595 기타We are the choices we make 6 O Happy Dagger 17/01/11 5505 0
    4579 기타Shakespeare, a programming language 8 O Happy Dagger 17/01/09 5585 2
    4563 기타On Diversity in the English Curriculum 12 O Happy Dagger 17/01/07 4829 1
    4550 음악La Llorona 2 O Happy Dagger 17/01/06 4470 4
    4542 기타if no one ever marries me 6 O Happy Dagger 17/01/05 5212 5
    4534 기타thy lips are warm. 8 O Happy Dagger 17/01/04 4343 4
    4535 음악House Carpenter O Happy Dagger 17/01/04 4272 0
    목록

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

    댓글