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

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


    목록
    번호 제목 이름 날짜 조회 추천
    4839 문화/예술제가 좋아하는 스탠드업 코미디언들 (약간 19금) 6 ffs 17/02/11 6567 2
    4829 기타. 21 삼공파일 17/02/10 4923 2
    4788 창작내게 등을 돌리고 자는 너 9 마투잘렘 17/02/06 3953 2
    4785 사회송곳 5부가 연재를 재개했습니다 1 二ッキョウ니쿄 17/02/06 4741 2
    4766 경제(팟캐스트) 주진형의 경제, 알아야 바꾼다 16 뜻밖의 17/02/04 7737 2
    8394 게임노루가 문제다 10 헬리제의우울 18/10/19 6026 2
    4755 창작그 남자, 그 여자 전화로 연결되다 13 마투잘렘 17/02/03 3972 2
    4744 음악하림, 사랑이 다른 사랑으로 잊혀지네 10 진준 17/02/02 4873 2
    4725 음악하루 한곡 015. 김광석 - 서른즈음에 5 하늘깃 17/01/30 4291 2
    4724 기타나무위키의 “젠더 이퀄리즘” 날조 사건 29 April_fool 17/01/30 8862 2
    4702 음악하루 한곡 011. 이승환 - 화양연화 4 하늘깃 17/01/26 4297 2
    9165 게임[LOL] 5월 10일 금요일 오늘의 일정 8 발그레 아이네꼬 19/05/08 4599 2
    9162 음악모아나의 연인 4 바나나코우 19/05/07 4096 2
    9161 게임[LOL] 5월 7일 화요일 오늘의 일정 8 발그레 아이네꼬 19/05/06 4565 2
    4645 기타[불판] 오늘 저녁 스타크래프트 빅매치!! 이영호vs이제동 156 김치찌개 17/01/17 9326 2
    4641 기타as tears go by 2 O Happy Dagger 17/01/17 5576 2
    4635 기타On Reading Dictee 2 O Happy Dagger 17/01/16 4919 2
    5746 일상/생각심심해서 써보는 공포경험담. 6 쉬군 17/06/05 4172 2
    7389 일상/생각쓸데없이 알차게 보낸 이번주 주말 끄적임... 1 알겠슘돠 18/04/15 4944 2
    4606 역사컬트. 짐 존즈. 2 은머리 17/01/12 5081 2
    4602 기타푸코, 데리다, 들뢰즈... O Happy Dagger 17/01/12 4796 2
    7386 여행대한항공 프랑크푸르트 - 인천 B747-8 퍼스트 탑승기 15 졸려졸려 18/04/15 7741 2
    4590 영화메릴 스트립의 Cecil B. DeMille 상 수상 소감 9 Beer Inside 17/01/10 5497 2
    4580 요리/음식돼지 보쌈 집에서 만들기 18 Liebe 17/01/09 8452 2
    4579 기타Shakespeare, a programming language 8 O Happy Dagger 17/01/09 5545 2
    목록

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

    댓글