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


    목록
    번호 제목 이름 날짜 조회 추천
    4595 기타We are the choices we make 6 O Happy Dagger 17/01/11 5422 0
    4594 기타. 41 삼공파일 17/01/11 5924 5
    4588 기타보드게임 소모임 관련해서~ 13 Leeka 17/01/10 5266 0
    4582 기타정모 퀴즈 문제 공개 21 Toby 17/01/09 5764 0
    4579 기타Shakespeare, a programming language 8 O Happy Dagger 17/01/09 5500 2
    4563 기타On Diversity in the English Curriculum 12 O Happy Dagger 17/01/07 4750 1
    4548 기타과부제조기 V-22 오스프리 18 모모스 17/01/06 10526 4
    4542 기타if no one ever marries me 6 O Happy Dagger 17/01/05 5132 5
    4534 기타thy lips are warm. 8 O Happy Dagger 17/01/04 4250 4
    4517 기타. 17 삼공파일 17/01/02 5524 1
    4508 기타고양이와 톡소포자충 6 모모스 17/01/01 5383 2
    4490 기타수학 잘함 = 공간 감각 좋음? 10 OPTIK 16/12/31 4295 1
    4483 기타고양이와 DNA감식 7 모모스 16/12/30 6265 4
    4454 기타. 38 삼공파일 16/12/27 5697 1
    4449 기타. 11 삼공파일 16/12/26 4679 3
    4439 기타초등교사에게 학기말 통지표란? 10 솔구름 16/12/24 5341 0
    4406 기타. 23 삼공파일 16/12/17 5149 0
    4403 기타. 21 삼공파일 16/12/17 4559 2
    4397 기타머리에 꽃 꽂은 그녀 3 nickyo 16/12/16 4828 5
    4396 기타딸바보와 바보딸 27 민달팽이 16/12/16 5675 22
    4394 기타신조어 퍼빙 12 까페레인 16/12/16 6147 0
    4392 기타the first cut is the deepest 새의선물 16/12/16 4144 5
    4390 기타왕을 맡은 배우중에 특이한 이력들 4 피아니시모 16/12/15 4826 0
    4389 기타네이버 2016년 월별 검색어가 공개되었습니다 7 Leeka 16/12/15 4031 0
    4371 기타. 22 삼공파일 16/12/13 4877 0
    목록

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

    댓글