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

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


    목록
    번호 제목 이름 날짜 조회 추천
    4641 기타as tears go by 2 O Happy Dagger 17/01/17 4743 2
    4635 기타On Reading Dictee 2 O Happy Dagger 17/01/16 4056 2
    4633 기타kilkelly 4 O Happy Dagger 17/01/16 3556 0
    4615 기타Ms. Hannigan... 11 O Happy Dagger 17/01/13 4215 7
    4602 기타푸코, 데리다, 들뢰즈... O Happy Dagger 17/01/12 3980 2
    4596 기타A Letter to Rora 11 O Happy Dagger 17/01/11 3503 0
    4595 기타We are the choices we make 6 O Happy Dagger 17/01/11 4565 0
    4579 기타Shakespeare, a programming language 8 O Happy Dagger 17/01/09 4524 2
    4563 기타On Diversity in the English Curriculum 12 O Happy Dagger 17/01/07 3924 1
    4550 음악La Llorona 2 O Happy Dagger 17/01/06 3724 4
    4542 기타if no one ever marries me 6 O Happy Dagger 17/01/05 4423 5
    4534 기타thy lips are warm. 8 O Happy Dagger 17/01/04 3537 4
    4535 음악House Carpenter O Happy Dagger 17/01/04 3556 0
    8685 일상/생각아무것도 아니라고 생각했던 때가 있었습니다. 1 Nuwara Eliya 18/12/26 4578 0
    3366 IT/컴퓨터어느 게임 회사 이야기 (후기) 53 NULLPointer 16/07/27 23459 42
    3356 IT/컴퓨터어느 게임 회사 이야기 (18) 24 NULLPointer 16/07/26 17559 11
    3351 IT/컴퓨터어느 게임 회사 이야기 (17) 26 NULLPointer 16/07/26 16535 5
    3346 IT/컴퓨터어느 게임 회사 이야기 (16) 17 NULLPointer 16/07/24 15389 5
    3344 IT/컴퓨터어느 게임 회사 이야기 (15) 16 NULLPointer 16/07/24 14302 3
    3334 IT/컴퓨터어느 게임 회사 이야기 (14) 11 NULLPointer 16/07/23 16099 3
    3331 IT/컴퓨터어느 게임 회사 이야기 (13) 13 NULLPointer 16/07/23 14812 4
    3329 IT/컴퓨터어느 게임 회사 이야기 (12) 9 NULLPointer 16/07/23 15445 8
    3327 IT/컴퓨터어느 게임 회사 이야기 (11) 15 NULLPointer 16/07/23 15336 4
    3325 IT/컴퓨터어느 게임 회사 이야기 (10) 10 NULLPointer 16/07/22 16625 6
    3319 IT/컴퓨터어느 게임 회사 이야기 (9) 23 NULLPointer 16/07/21 16095 10
    목록

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

    댓글