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


    목록
    번호 제목 이름 날짜 조회 추천
    11405 스포츠[MLB] 오타니 쇼헤이 에인절스와 2년 850만달러 계약 김치찌개 21/02/09 5819 0
    3196 정치한국장학재단 이사장 “청년들, 빚 있어야 파이팅” 13 바코드 16/07/05 5820 0
    11324 일상/생각지금 이대로도 완전할까 7 right 21/01/07 5820 8
    11802 의료/건강SBS, 혈소판감소성 혈전증 항체 검사 관련 보도설명자료 외 8 다군 21/06/18 5820 1
    12898 정치민주당은 어떻게 되나 42 매뉴물있뉴 22/06/08 5820 5
    2328 기타인도네시아 이야기 26 Hitam 16/03/01 5821 10
    2629 방송/연예[스포] 무한도전 젝스키스 게릴라 콘서트. 4 Bergy10 16/04/16 5821 1
    3947 IT/컴퓨터유쁠 매장에서 아이폰7 수령해왔습니다. 20 Leeka 16/10/18 5821 0
    4285 정치홈플러스 노조에 대한 공격이 시작되었다네요. 13 nickyo 16/12/03 5821 12
    8220 게임[하스스톤] 9월 2주차 난투 부활사제덱 9 CIMPLE 18/09/13 5821 0
    11476 게임[LOL] LPL, 현 시점에서의 웨이보 인기투표 라인별 1~3위 Leeka 21/03/09 5821 2
    3355 영화[부산행] 한국에서 만들어진 헐리웃 공식 재난영화(스포 포함) 18 shadowtaki 16/07/26 5822 0
    6884 기타신발 모으기.jpg 8 김치찌개 18/01/03 5822 1
    7580 방송/연예양현석이 올해 보여준 모습 10 Leeka 18/05/24 5822 2
    10428 사회말라리아 치료제로 COVID-19를 극복할 수 있을까? 10 치킹 20/03/24 5822 7
    12449 일상/생각겨울방학이 끝나고.. 10 풀잎 22/01/17 5822 13
    5205 일상/생각나의 상환일대기 10 김피곤씨 17/03/17 5823 13
    8952 음악[클래식] Polovtsian Dances 폴로베츠인의 춤 - 보로딘 10 ElectricSheep 19/03/11 5823 5
    8032 영화밤은짧아걸어아가씨야 감상 4 제로스 18/08/10 5823 2
    11238 경제'코로나19'가 가져온 소비 행태의 변화 2 - 하나 12 다군 20/12/16 5823 4
    11346 영화홍콩의 화양연화4 -질서와 욕망의 변주 1 간로 21/01/17 5823 9
    13606 정치재밌네요... 이재명 체포동의안 투표 결과.. 36 Picard 23/02/28 5823 0
    2172 영화이번 주 CGV 흥행 순위 5 AI홍차봇 16/02/04 5824 0
    3481 게임증강현실이 게임 중계에도 도입됐네요. (TI6) 11 Las Salinas 16/08/09 5824 0
    4579 기타Shakespeare, a programming language 8 O Happy Dagger 17/01/09 5824 2
    목록

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

    댓글