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


    목록
    번호 제목 이름 날짜 조회 추천
    4579 기타Shakespeare, a programming language 8 O Happy Dagger 17/01/09 5603 2
    4578 게임레드티에서도 보드게임모임있나요? + 어썌신크리드4:블랙프래그리뷰 8 mathematicgirl 17/01/09 4901 0
    4577 요리/음식안주로도 반찬으로도 괜찮은 양송이 버섯 구이 21 녹풍 17/01/09 14192 3
    4576 일상/생각픽션 - 어떤 대회이야기 7 JUFAFA 17/01/09 4875 0
    4575 역사여요전쟁 - 4. 개경 함락 7 눈시 17/01/08 4888 4
    4574 역사여요전쟁 - 3. 의군천병 2 눈시 17/01/08 5337 3
    4573 도서/문학댓글부대 10 알료사 17/01/08 5499 3
    4572 IT/컴퓨터[소개] Swift Calcs - 최고의 온라인 계산기 8 April_fool 17/01/08 9603 10
    4571 일상/생각간단한 정모후기입니다 27 줄리엣 17/01/08 6075 6
    4570 일상/생각정모 후기는 아니고 그냥 기억입니다. 26 깊은잠 17/01/08 5773 6
    4569 일상/생각정모 후기. 좋은 사람들과의 시간. 6 Credit 17/01/08 5620 5
    4568 일상/생각정모후기 입니다 16 와이 17/01/08 4915 3
    4567 일상/생각눈 마주치기 31 은머리 17/01/08 5784 5
    4566 일상/생각정모후기 27 The Last of Us 17/01/08 5975 4
    4565 일상/생각사람을 만나는 이유 12 레이드 17/01/08 5640 6
    4564 IT/컴퓨터두 대의 구글 챗봇이 대화하는 채널 12 Azurespace 17/01/07 6825 2
    4563 기타On Diversity in the English Curriculum 12 O Happy Dagger 17/01/07 4840 1
    4562 문화/예술[불판] 홍차넷 신년회 정모 138 Toby 17/01/07 8366 1
    4561 꿀팁/강좌연말정산 설명 영상 1 Toby 17/01/07 5288 1
    4560 일상/생각병원은 왜? 간만에 친구를 만난 단상 1. 10 홍차의오후 17/01/07 5705 7
    4554 일상/생각신년 맞이 보이스피싱 맞은 이야기 (2) 8 DoubleYellowDot 17/01/06 4525 2
    4553 음악곽진언, 그 쓸쓸함에 대하여 9 진준 17/01/06 4286 1
    4552 일상/생각. 7 DoubleYellowDot 17/01/06 4621 1
    4551 창작안개의 인사 (시) 제주감귤 17/01/06 4321 0
    4550 음악La Llorona 2 O Happy Dagger 17/01/06 4484 4
    목록

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

    댓글