├── .gitignore ├── README.md ├── examples ├── Blank Example │ ├── LICENSE │ ├── README.md │ ├── empty.html │ ├── example.html │ └── js │ │ ├── jqconsole.js │ │ ├── jquery.js │ │ ├── lodash.js │ │ ├── peg.js │ │ ├── plt.js │ │ └── sugar.js ├── README.md ├── TreesPlease │ ├── js │ │ ├── jqconsole.js │ │ ├── jquery.js │ │ ├── lodash.js │ │ ├── peg.js │ │ ├── plt.js │ │ └── sugar.js │ ├── treesplease.html │ └── treesplease.js └── whenever.js │ ├── README.md │ ├── example.we │ ├── lib │ └── grammar.txt │ ├── package.json │ └── whenever.js └── slides ├── lib └── stopwork │ ├── compiler.rb │ ├── css │ ├── iconic │ │ ├── iconic_fill.afm │ │ ├── iconic_fill.css │ │ ├── iconic_fill.eot │ │ ├── iconic_fill.json │ │ ├── iconic_fill.otf │ │ ├── iconic_fill.svg │ │ ├── iconic_fill.ttf │ │ └── iconic_fill.woff │ ├── skeleton-base.css │ ├── style.css │ ├── transition-fade.css │ └── transition-slide.css │ ├── exporter.rb │ ├── ext.rb │ ├── js │ ├── jquery.js │ └── stopwork.js │ ├── server.rb │ ├── slideshow.mustache │ ├── slideshow.rb │ ├── stopwork.rb │ └── types │ ├── cloudapp.rb │ ├── hostedvideo.rb │ ├── image.rb │ ├── imgur.rb │ ├── text.rb │ ├── twitter.rb │ ├── types.rb │ ├── video.rb │ └── web.rb └── talkingtomachines.stpwrk.html /.gitignore: -------------------------------------------------------------------------------- 1 | **/node_modules/* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Talking to Machines (Those A**Holes) 2 | 3 | In this class, we will discuss what it means to envision speaking to machines as a special case of using language as opposed to a special case of math or magical incantations. We will explore the artistic and aesthetic possibilities of creating our own distoring languages. 4 | 5 | ### Timeline 6 | ##### Day 1: Talking to Machines, PLT Through the Ages 7 | * Discuss the history of PLT & talking to machines, including esolangs 8 | * On Distortion, Exercises in Style 9 | * Learn about parsing expression grammars 10 | * Set Up tools 11 | 12 | ##### Day 2: Making Our Own 13 | * Working alone or in teams to make a distortion language with either [PLTJS](https://github.com/nasser/pltjs) or [Ohm](https://github.com/cdglabs/ohm) 14 | 15 | ### Pre-Class Resources 16 | If you aren't familiar with basic programming concepts, particularly in Javascript, I'd recommend taking the time to do the basic [Codecademy Javascript track](https://www.codecademy.com/tracks/javascript) or the [Code School lessons](https://www.codeschool.com/paths/javascript). 17 | 18 | If you'd like to read about esolangs and just get really excited, check out: [Esoteric.codes](http://esoteric.codes/), Daniel Temkin's blog, or the [Esolangs Wiki](http://esolangs.org/wiki/Main_Page) and [Rosetta Code](http://rosettacode.org/wiki/Rosetta_Code) 19 | 20 | Programming history and background books: 21 | * [Code] (http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319/ref=sr_1_1?ie=UTF8&qid=1437497973&sr=8-1&keywords=code) 22 | * [10 PRINT CHR](http://www.amazon.com/10-PRINT-CHR-205-5-RND/dp/0262526743/ref=sr_1_1?ie=UTF8&qid=1437497981&sr=8-1&keywords=10+Print) 23 | 24 | Interesting videos: 25 | * [Future of Programming](http://worrydream.com/dbx/) 26 | * [Sketchpad](https://www.youtube.com/watch?v=USyoT_Ha_bA) [Part 2](https://www.youtube.com/watch?v=BKM3CmRqK2o) 27 | * [Mother of All Demos](https://www.youtube.com/watch?v=yJDv-zdhzMY) 28 | 29 | -------------------------------------------------------------------------------- /examples/Blank Example/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Ramsey Nasser 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /examples/Blank Example/README.md: -------------------------------------------------------------------------------- 1 | plt.js 2 | ====== 3 | A programming language design prototyping tool 4 | 5 | Overview 6 | -------- 7 | plt.js is an environment for writing and testing programming language grammars. You write your language's grammar and example code in an HTMLish syntax, and plt.js will parse your code against your grammar and display the result. It will also provide you with a [REPL](http://en.wikipedia.org/wiki/REPL) interface into your language, so you can get a feel for it right away. 8 | 9 | It looks like this: 10 | 11 | ```html 12 | 13 | start = '(' '+' space a:number ' ' b:number space ')' { return a + b } 14 | number = d:digit+ { return parseInt( d.join('') ) } 15 | digit = [0123456789] 16 | space = ' '* 17 | 18 | 19 |

Addition

20 | (+ 5 10) 21 | (+7 13) 22 | (+ 7 13) 23 | ``` 24 | 25 | Which would output 26 | 27 | ``` 28 | Addition 29 | 30 | (+ 5 10) 31 | ↳ 15 32 | (+7 13) 33 | ↳ 20 34 | (+ 7 13) 35 | ↳ 20 36 | ``` 37 | 38 | And if you type `(+ 12 89)` and hit enter, you should see 39 | 40 | ``` 41 | > (+ 12 89) 42 | 101 43 | ``` 44 | 45 | Try it. It's great fun. 46 | 47 | Usage 48 | ----- 49 | 1. Download and extract [plt.js](https://github.com/nasser/pltjs/archive/master.zip) 50 | 2. Copy `example.html` to `your-language.html` 51 | 3. Open `your-language.html` in a browser 52 | 4. Replace the `` tag with the name of your language 53 | 5. Replace the `<grammar>` tag with the [PEG grammar](http://pegjs.majda.cz/documentation#grammar-syntax-and-semantics) of your language 54 | 6. Write examples of correct syntax in `<code>` tags. plt.js will parse them and display the result 55 | 7. Write examples of incorrect syntax in `<code bad>` tags. plt.js will parse them and display the result 56 | 8. Write any other HTML to annotate your examples 57 | 9. Open `your-language.html` file in a browser 58 | 59 | `plt.js` is designed to work offline. The only constraint is that your `your-language.html` file must be in the same folder as the `js/` folder where plt.js keeps its files. 60 | 61 | Name 62 | ---- 63 | PLT is short for [Programming Language Theory](http://en.wikipedia.org/wiki/Programming_language_theory), the branch of computer science that deals with the design and implementation of programming languages. 64 | 65 | Acknowledgments 66 | --------------- 67 | plt.js comes out of my time as an [Eyebeam](http://eyebeam.org) Fellow exploring code as a medium of self expression. It was further developed as a teaching tool for my [programming language design class](http://itplanguages.tumblr.com/) at [NYU ITP](http://itp.nyu.edu/itp/). 68 | 69 | Legal 70 | ----- 71 | Copyright © 2014 Ramsey Nasser. Released under the MIT License. 72 | 73 | [PEG.js](http://pegjs.majda.cz/) Copyright © 2010–2013 David Majda 74 | 75 | [Sugar.js](http://sugarjs.com/) Copyright © 2011 Andrew Plummer 76 | -------------------------------------------------------------------------------- /examples/Blank Example/empty.html: -------------------------------------------------------------------------------- 1 | <meta charset="utf-8"> 2 | 3 | <script src="js/jquery.js"></script> 4 | <script src="js/jqconsole.js"></script> 5 | <script src="js/sugar.js"></script> 6 | <script src="js/peg.js"></script> 7 | <script src="js/plt.js"></script> 8 | 9 | <script type="text/javascript"> 10 | // uncomment next line to enable refresh 11 | // PLT.refresh = true 12 | 13 | // write helper functions and semantics here 14 | </script> 15 | 16 | <title>Language 17 | 18 | 31 | 32 | 33 | 34 | start = expr+ / str / rev 35 | 36 | rev = '~~' s:str '~~' { return s.reverse(); } 37 | 38 | str = '??' c:char+ '??' { return c.join('') } 39 | char = [a-zA-Z 0-9] 40 | 41 | expr = '(' op:operators space a:(expr/number)+ ')' space { 42 | return a.reduce(function(prev, next){ 43 | return eval(prev + op + next); 44 | }); 45 | } 46 | 47 | operators = '+' / '-' / '*' / '/' 48 | 49 | number = d:digit+ space { return +d.join('') } 50 | digit = [0-9] 51 | space = [ ]* 52 | 53 | 54 | 55 | 56 |

Examples

57 | (+ 3 10) 58 | (+ 3 10 33) 59 | (/ (+ (+ 44 1) (- 4 5)) 21) 60 | 61 | ??cat?? 62 | ??cat butt 55?? 63 | 64 | ~~??cookie??~~ -------------------------------------------------------------------------------- /examples/Blank Example/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | Numbers 17 | 18 | 34 | 35 | start = '(' '+' space a:(start / number) ' ' b:(start / number) space ')' { return a + b } 36 | 37 | number = d:digit+ { return parseInt( d.join('') ) } 38 | digit = [0123456789] 39 | 40 | space = ' '* 41 | 42 | 43 |

Addition

44 | (+ 5 10) 45 | (+7 13) 46 | (+ 7 13) 47 | (+ 7 13 ) 48 | (+ 7 15 ) 49 | -------------------------------------------------------------------------------- /examples/Blank Example/js/jqconsole.js: -------------------------------------------------------------------------------- 1 | (function(){var t,e,i,s,r,o,n,h,p,c,a,l,u,_,f,m,d,$,y,v,g,x,b,k,w,C,T,S,M,P,H,E,L,I,W,D,A,R=function(t,e){return function(){return t.apply(e,arguments)}},U=[].slice;t=jQuery;I=0;W=1;D=2;w=13;H=9;x=46;g=8;T=37;P=39;E=38;b=40;C=36;k=35;M=33;S=34;p="jqconsole-";r=""+p+"cursor";o=""+p+"header";c=""+p+"prompt";h=""+p+"old-prompt";n=""+p+"input";s=""+p+"blurred";y="keypress";m="";_="
";f=":empty";L="\n";u=">>> ";l="... ";a=2;i=""+p+"ansi-";d="";$=/\[(\d*)(?:;(\d*))*m/;e=function(){t.prototype.COLORS=["black","red","green","yellow","blue","magenta","cyan","white"];function t(){this.stylize=R(this.stylize,this);this._closeSpan=R(this._closeSpan,this);this._openSpan=R(this._openSpan,this);this.getClasses=R(this.getClasses,this);this._style=R(this._style,this);this._color=R(this._color,this);this._remove=R(this._remove,this);this._append=R(this._append,this);this.klasses=[]}t.prototype._append=function(t){t=""+i+t;if(this.klasses.indexOf(t)===-1){return this.klasses.push(t)}};t.prototype._remove=function(){var t,e,s,r,o,n;s=1<=arguments.length?U.call(arguments,0):[];n=[];for(r=0,o=s.length;r'+t};t.prototype._closeSpan=function(t){return""+t+""};t.prototype.stylize=function(t){var e,i,s,r,o,n;t=this._openSpan(t);s=0;while((s=t.indexOf(d,s))&&s!==-1){if(i=t.slice(s).match($)){n=i.slice(1);for(r=0,o=n.length;r'+(e||"")+""};v=function(){function i(i,s,r,n){this._HideComposition=R(this._HideComposition,this);this._ShowComposition=R(this._ShowComposition,this);this._UpdateComposition=R(this._UpdateComposition,this);this._EndComposition=R(this._EndComposition,this);this._StartComposition=R(this._StartComposition,this);this._CheckComposition=R(this._CheckComposition,this);this._ProcessMatch=R(this._ProcessMatch,this);this._HandleKey=R(this._HandleKey,this);this._HandleChar=R(this._HandleChar,this);this.isMobile=!!navigator.userAgent.match(/iPhone|iPad|iPod|Android/i);this.isIos=!!navigator.userAgent.match(/iPhone|iPad|iPod/i);this.isAndroid=!!navigator.userAgent.match(/Android/i);this.$window=t(window);this.header=s||"";this.prompt_label_main=typeof r==="string"?r:u;this.prompt_label_continue=n||l;this.indent_width=a;this.state=W;this.input_queue=[];this.input_callback=null;this.multiline_callback=null;this.history=[];this.history_index=0;this.history_new="";this.history_active=false;this.shortcuts={};this.$container=t("
").appendTo(i);this.$container.css({top:0,left:0,right:0,bottom:0,position:"absolute",overflow:"auto"});this.$console=t('
').appendTo(this.$container);this.$console.css({margin:0,position:"relative","min-height":"100%","box-sizing":"border-box","-moz-box-sizing":"border-box","-webkit-box-sizing":"border-box"});this.$console_focused=true;this.$input_container=t(_).appendTo(this.$container);this.$input_container.css({position:"absolute",width:1,height:0,overflow:"hidden"});this.$input_source=this.isAndroid?t(""):t("