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


    목록
    번호 제목 이름 날짜 조회 추천
    공지 티타임 게시판 이용 규정 2 Toby 15/06/19 30611 6
    14607 요리/음식드디어 쓰는 쌀국수 투어 모음집 2편 11 + kogang2001 24/04/19 208 4
    14606 요리/음식드디어 쓰는 쌀국수 투어 모음집 1편 4 kogang2001 24/04/19 215 7
    14605 게임오픈월드를 통한 srpg의 한계 극복 13 kaestro 24/04/19 405 2
    14604 일상/생각개인위키 제작기 6 와짱 24/04/17 738 11
    14603 정치정치는 다들 비슷해서 재미있지만, 그게 내이야기가 되면... 9 닭장군 24/04/16 1115 6
    14602 오프모임5월 1일 난지도벙 재공지 8 치킨마요 24/04/14 727 2
    14601 꿀팁/강좌전국 아파트 관리비 조회 및 비교 사이트 11 무미니 24/04/13 842 6
    14600 도서/문학떡볶이는 좋지만 더덕구이는 싫은 사람들을 위하여 13 kaestro 24/04/13 1058 5
    14599 일상/생각가챠 등 확률성 아이템이 있는 도박성 게임에 안 지는 방법 20 골든햄스 24/04/12 1084 0
    14598 음악[팝송] 코난 그레이 새 앨범 "Found Heaven" 김치찌개 24/04/12 171 0
    14597 스포츠앞으로 다시는 오지않을 한국야구 최전성기 12 danielbard 24/04/12 988 0
    14596 정치이준석이 동탄에서 어떤 과정으로 역전을 했나 56 Leeka 24/04/11 2481 6
    14595 정치방송 3사 출구조사와 최종 결과 비교 4 Leeka 24/04/11 760 0
    14594 정치절반의 성공을 안고 몰락한 정의당을 바라보며 10 카르스 24/04/11 1325 18
    14593 정치홍차넷 선거결과 예측시스템 후기 11 괄하이드 24/04/11 904 6
    14592 정치2024 - 22대 국회의원 선거 불판. 197 코리몬테아스 24/04/10 5328 2
    14591 정치선거일 직전 끄적이는 당별관련 뻘글 23 the hive 24/04/09 1261 0
    14590 오프모임[5월1일 난지도 벙] 근로자 대 환영! 13 치킨마요 24/04/09 600 1
    14589 일상/생각지난 3개월을 돌아보며 - 물방울이 흐르고 모여서 시냇물을 만든 이야기 6 kaestro 24/04/09 384 3
    14588 일상/생각다정한 봄의 새싹들처럼 1 골든햄스 24/04/09 276 8
    14587 일상/생각탕후루 기사를 읽다가, 4 풀잎 24/04/09 421 0
    14586 음악VIRGINIA (퍼렐 윌리엄스) 신보 카라멜마끼아또 24/04/08 272 2
    14585 오프모임4월 9일 선릉역에 족발 드시러 가실분. 29 비오는압구정 24/04/08 793 4
    14583 정치총선 결과 맞추기 한번 해볼까요? 52 괄하이드 24/04/07 1444 0
    목록

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

    댓글