- 다양한 주제에 대해 자유롭게 글을 작성하는 게시판입니다.
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
이 게시판에 등록된 O Happy Dagger님의 최근 게시물
|
저런 류 언어들을 esolang(esoteric programming language)이라고 하는데, 생각보다 어마어마하게 많습니다. (그리고 지금도 꾸준히 생겨나고 있습니다.)
CS 학부에서 compiler 수업을 듣다보면 간단한 언어를 만드는게 생각보다 어렵지 않다는 것을 알게 되고, 잉여력 넘치는 덕후 들은 자신의 입맛에 맞는 언어들을 한번쯤은 만들어보고 싶어하죠.
esolang wiki(https://esolangs.org/wiki/Main_Page)에 가보시면 세상에 잉여로운 CS 덕후들이 만든 esolang들의 리스트를 보실 수 있습니다.
CS 학부에서 compiler 수업을 듣다보면 간단한 언어를 만드는게 생각보다 어렵지 않다는 것을 알게 되고, 잉여력 넘치는 덕후 들은 자신의 입맛에 맞는 언어들을 한번쯤은 만들어보고 싶어하죠.
esolang wiki(https://esolangs.org/wiki/Main_Page)에 가보시면 세상에 잉여로운 CS 덕후들이 만든 esolang들의 리스트를 보실 수 있습니다.
목록 |
|