Upgrade to Pro — share decks privately, control downloads, hide ads and more …

End the war on tabs (phpnw14)

End the war on tabs (phpnw14)

Igor Wiedler

October 04, 2014
Tweet

More Decks by Igor Wiedler

Other Decks in Programming

Transcript

  1. Something

  2. end ! the war on tabs

  3. @igorwhiletrue

  4. I ❤ \t

  5. programming = art

  6. war on tabs

  7. \t = freedom

  8. None
  9. \t

  10. None
  11. (whitespace)

  12. decision procedure

  13. meta-interpreter in 2927 lines

  14. meta-interpreter in 2927 lines

  15. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces!
  16. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces!
  17. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces!
  18. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces!
  19. stack machine

  20. instruction set • stack: push, dup, ref, swap, discard, slide

    • arithmetic: add, sub, mul, div, mod • heap: store, retrieve • flow: label, call, jump, jumpz, jumplz, ret, exit • i/o: write_char, write_num, read_char, read_num
  21. encoded in terms of \t (9) \n (10) (32)

  22. domain specific language

  23. environmentally friendly

  24. read between the lines

  25. loop + switch = stack machine

  26. stack: push/pop

  27. None
  28. None
  29. None
  30. None
  31. None
  32. None
  33. None
  34. None
  35. arithmetic: + - * / %

  36. 1 2 + 1 - 2 *

  37. 1 1 2 + 1 - 2 *

  38. 1 2 1 2 + 1 - 2 *

  39. 3 1 2 + 1 - 2 *

  40. 3 1 2 + 1 - 2 * 1

  41. 2 1 2 + 1 - 2 *

  42. 2 1 2 + 1 - 2 * 2

  43. 4 1 2 + 1 - 2 *

  44. heap: store/retrieve

  45. 0 1 2 3 0 33 store 1 retri eve

    0 retri eve
  46. 0 1 2 3 0 33 store 1 retri eve

    0 retri eve
  47. 0 1 2 3 0 33 store 1 retri eve

    0 retri eve
  48. 0 1 2 3 0 33 store 1 retri eve

    0 retri eve 33
  49. 0 1 2 3 0 33 store 1 retri eve

    33 0 retri eve
  50. 0 1 2 3 0 33 store 1 retri eve

    33 0 retri eve
  51. 0 1 2 3 0 33 store 1 retri eve

    33 0 retri eve 0
  52. 0 1 2 3 0 33 store 1 retri eve

    33 0 retri eve
  53. 0 1 2 3 0 33 store 1 retri eve

    33 0 retri eve
  54. 0 1 2 3 0 33 store 1 retri eve

    33 0 retri eve 33
  55. control flow

  56. your CPU considered harmful

  57. label 0 0 + jump 0 0 1

  58. label 0 0 + jump 0 0 1

  59. label 0 0 + jump 0 0 1 1

  60. label 0 0 + jump 0 1 1

  61. label 0 0 + jump 0 1 1

  62. label 0 0 + jump 0 1 1

  63. label 0 0 + jump 0 1 1 1

  64. label 0 0 + jump 0 2 1

  65. label 0 0 + jump 0 2 1

  66. label 0 0 + jump 0 2 1

  67. label 0 0 + jump 0 2 1 1

  68. label 0 0 + jump 0 3 1

  69. label 0 0 + jump 0 3 1

  70. label 0 0 + jumpnz 0 0 1 dup 2

    swap -
  71. label 0 0 + 0 1 dup 2 swap -

    jumpnz 0
  72. label 0 0 + 0 1 dup 2 swap -

    1 jumpnz 0
  73. label 0 0 + 1 dup 2 swap - 1

    jumpnz 0
  74. label 0 0 + 1 dup 2 swap - 1

    1 jumpnz 0
  75. 2 label 0 0 + 1 dup 2 swap -

    1 1 jumpnz 0
  76. 1 2 label 0 0 + 1 dup 2 swap

    - 1 jumpnz 0
  77. 1 label 0 0 + 1 dup 2 swap -

    1 jumpnz 0
  78. 1 label 0 0 + 1 dup 2 swap -

    1 jumpnz 0
  79. label 0 0 + 1 dup 2 swap - 1

    jumpnz 0
  80. label 0 0 + 1 dup 2 swap - 1

    jumpnz 0
  81. label 0 0 + 1 dup 2 swap - 1

    jumpnz 0 1
  82. label 0 0 + 1 dup 2 swap - 2

    jumpnz 0
  83. label 0 0 + 1 dup 2 swap - 2

    jumpnz 0 2
  84. 2 label 0 0 + 1 dup 2 swap -

    2 jumpnz 0 2
  85. 2 2 label 0 0 + 1 dup 2 swap

    - 2 jumpnz 0
  86. label 0 0 + 1 dup 2 swap - 2

    jumpnz 0 0
  87. label 0 0 + 1 dup 2 swap - 2

    jumpnz 0 0
  88. label 0 0 + 1 dup 2 swap - 2

    jumpnz 0
  89. label 0 0 + 1 dup 2 swap - 2

    jumpnz 0
  90. i/o

  91. None
  92. None
  93. turing completeness

  94. None
  95. meta-interpreter

  96. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces! CPU (x86)
  97. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces! PHP interpreter (C)
  98. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces! ws interpreter (PHP)
  99. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces! ws interpreter (ws)
  100. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces! ws interpreter (ws)
  101. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces! hello world (ws)
  102. $ (cat examples/wsinterws.ws; cat examples/hworld.ws; echo -ne "\n\n\nquit\n \n\n") |

    hhvm bin/interpreter examples/wsinterws.ws whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- whitespace interpreter written in whitespace made by oliver burghard [email protected] in his free time for your and his joy good time and join me to get whitespace ready for business for any other information dial 1-900-whitespace or get soon info at www.whitespace-wants-to-be-taken-serious.org please enter the program and terminate via 3xenter,'quit',3xenter -- ws interpreter ws ------------------------------------------- Hello, world of spaces!
  103. hello, world of spaces

  104. do not want to hear your questions • joind.in/12146 •

    @igorwhiletrue ! • esolangs.org/wiki/Whitespace • compsoc.dur.ac.uk/whitespace • github.com/igorw/whitespace-php • github.com/igorw/wsm