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


    목록
    번호 제목 이름 날짜 조회 추천
    6467 오프모임동해도 푸드파이팅을 할지 말지 고민중입니다 27 T.Robin 17/10/26 5816 2
    11090 도서/문학1984 원서를 간신히 완독했습니다. 5 저녁의바람내음 20/10/25 5815 14
    10324 역사1271년 5월, 삼별초 토벌 직전에 벌어졌던 촌극 11 메존일각 20/02/26 5815 8
    9597 일상/생각잠재의식이 음악 선곡에 미치는 영향.. 4 프링 19/08/29 5815 4
    4900 과학/기술발렌타인데이를 맞아 뫼비우스띠 비디오 2 뜻밖의 17/02/17 5815 1
    1948 일상/생각현실적인 긍정적 사고 5 Obsobs 16/01/05 5815 1
    9406 음악거짓말쟁이 그녀 6 바나나코우 19/07/07 5814 2
    3947 IT/컴퓨터유쁠 매장에서 아이폰7 수령해왔습니다. 20 Leeka 16/10/18 5814 0
    3481 게임증강현실이 게임 중계에도 도입됐네요. (TI6) 11 Las Salinas 16/08/09 5814 0
    6994 오프모임[캡틴아메리카의 방학수학특강] "무한, ∞, Infinity" 2차 공지 16 캡틴아메리카 18/01/24 5813 4
    5603 음악불심으로 대동단결! 김길수 아닌 불꽃심장 4 천도령 17/05/10 5813 0
    12405 경제2021년 5대백화점 매출 순위가 공개되었습니다 2 Leeka 22/01/05 5813 0
    3084 정치영남권 신공항 건설 또 백지화 32 NightBAya 16/06/21 5813 0
    13606 정치재밌네요... 이재명 체포동의안 투표 결과.. 36 Picard 23/02/28 5812 0
    11324 일상/생각지금 이대로도 완전할까 7 right 21/01/07 5812 8
    6249 IT/컴퓨터T맵이 평소랑 다른 길을 안내할 때... 13 Toby 17/09/08 5812 0
    3282 게임국내 겜이 왜 그런지 알거 같기도 하고... 22 김덕배 16/07/17 5812 0
    5196 일상/생각자존감이야기 45 기아트윈스 17/03/15 5811 20
    4579 기타Shakespeare, a programming language 8 O Happy Dagger 17/01/09 5811 2
    10555 게임갖고있는 스위치 게임 단상 15 ebling mis 20/05/06 5810 0
    4351 일상/생각. 41 삼공파일 16/12/11 5810 1
    3355 영화[부산행] 한국에서 만들어진 헐리웃 공식 재난영화(스포 포함) 18 shadowtaki 16/07/26 5810 0
    10451 IT/컴퓨터앱스토어, 동영상 다운로드앱에 한해서 수수료 면제 적용 Leeka 20/04/02 5809 0
    8234 기타2018 GSL 시즌3 코드S 결승전 우승 "조성주" 2 김치찌개 18/09/16 5809 1
    6518 일상/생각직장 동료가 원수가 되었습니다. 22 엘멜 17/11/03 5809 0
    목록

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

    댓글