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

Incredibly Strange Programming Languages - CodeMash 2017

Incredibly Strange Programming Languages - CodeMash 2017

If you’ve ever suspected that “all programming languages are pretty much the same; they just have different syntax,” well, you will never suspect that again! Covering languages from the unusually powerful (Idris) to the illuminated (قلب) to the profoundly limited (BlooP), and all points in between, these languages will help you think differently about approaches to software problems you face in your day job. Of course we’ll have a lot of fun, but these languages are no joke. The practical benefit of an impractical language is the power to find new approaches to common problems.

56e5c49368a2e0ab999848a8d9e3c116?s=128

Craig Stuntz

January 13, 2017
Tweet

Transcript

  1. Incredibly Strange Programming Languages! Craig Stuntz https://speakerdeck.com/craigstuntz

  2. print *,"Hello world!"

  3. Console.WriteLine("Hello, World!");

  4. S3 S1 S2 S3 c a t var aaa =

    new Regex("cat"); https://en.wikipedia.org/wiki/Van_cat#/media/File:Turkish_Van_Cat.jpg
  5. S3 S1 S2 S3 c a t var aaa =

    new Regex("cat"); https://en.wikipedia.org/wiki/Van_cat#/media/File:Turkish_Van_Cat.jpg
  6. https://upload.wikimedia.org/wikipedia/commons/0/06/Human_computers_-_Dryden.jpg

  7. <spoilers> • Today, many languages look mostly the same •

    “Mainstream” languages will change • There are specific reasons why they change • Just learning about certain languages can help you learn how to write interesting code
  8. None
  9. None
  10. http://jsforcats.com/

  11. https://www.flickr.com/photos/lenore-m/2514975647/

  12. https://commons.wikimedia.org/wiki/File:Kitchen-knife-santoku-form.jpg

  13. None
  14. https://www.flickr.com/photos/40726522@N02/9385054093/

  15. https://www.flickr.com/photos/40726522@N02/9385054093/

  16. None
  17. None
  18. var query = from total in Enumerable.Range(0,100).Reverse() select (total >

    0) ? string.Format("{0} bottles of beer on the wall\n{0} bottles of beer\nTake one down, around", total) : string.Format("{0} bottles left", total); foreach (var item in query) { Console.WriteLine(item); } http://rosettacode.org/wiki/99_Bottles_of_Beer
  19. plural = 's' 99.downto(1) do |i| puts "#{i} bottle#{plural} of

    beer on the wall," puts "#{i} bottle#{plural} of beer" puts "Take one down, pass it around!" plural = '' if i - 1 == 1 if i > 1 puts "#{i-1} bottle#{plural} of beer on the wall!" puts else puts "No more bottles of beer on the wall!" end end http://rosettacode.org/wiki/99_Bottles_of_Beer
  20. var beer = 99; while (beer > 0) { var

    verse = [ beer + " bottles of beer on the wall,", beer + " bottles of beer!", "Take one down, pass it around", (beer - 1) + " bottles of beer on the wall!" ].join("\n"); console.log(verse); beer--; } http://rosettacode.org/wiki/99_Bottles_of_Beer
  21. "#>,_ "#Beer Song>,_ #include <iostream> using namespace std; int main(){

    for( int b=-1; b<99; cout $% '\n') for ( int w=0; w<3; cout $% ".\n"){ if (w==2) cout $% (( b--) ?"Take one dow" "n and pass it arou" "nd":"Go to the sto" "re and buy some mo" "re"); if (b<0) b=99 ; do{ if (w) cout $% ", "; if (b) cout $% b; else cout $% ( (w) ? 'n' : 'N') $% "o more"; cout $% " bottle" ; if (b&'1) cout $% 's' ; cout $% " of beer"; if (w&'1) cout $% " on th" "e wall" ;} while (!w++);} return 0 ; } "# "# by barrym 2011-05-01 "# no bottles were harmed in the "# making of this program!!! http://rosettacode.org/wiki/99_Bottles_of_Beer
  22. def sing(b, end): print(b or 'No more','bottle'+('s' if b-1 else

    ''), end) for i in range(99, 0, -1): sing(i, 'of beer on the wall,') sing(i, 'of beer,') print('Take one down, pass it around,') sing(i-1, 'of beer on the wall.\n') http://rosettacode.org/wiki/99_Bottles_of_Beer
  23. https://www.quora.com/Are-all-programming-languages-based-on-C

  24. https://www.quora.com/Are-all-programming-languages-based-on-C

  25. Lineage 1960 1970 1980 ALGOL LISP APL ML Prolog ALGOL

    BCPL C C++ 1990 2000 C# Java JavaScript Ruby ML OCaml F# 2010 Swift LISP Scheme Clojure APL J SASL SASL Miranda Haskell Prolog Erlang Elixir PHP
  26. Lineage 1960 1970 1980 ALGOL LISP APL ML Prolog ALGOL

    BCPL C C++ 1990 2000 C# Java JavaScript Ruby ML OCaml F# 2010 Swift LISP Scheme Clojure APL J SASL SASL Miranda Haskell Prolog Erlang Elixir PHP
  27. Lineage 1960 1970 1980 ALGOL LISP APL ML Prolog ALGOL

    BCPL C C++ 1990 2000 C# Java JavaScript Ruby ML OCaml F# 2010 Swift LISP Scheme Clojure APL J SASL SASL Miranda Haskell Prolog Erlang Elixir PHP
  28. Lineage 1960 1970 1980 ALGOL LISP APL ML Prolog ALGOL

    BCPL C C++ 1990 2000 C# Java JavaScript Ruby ML OCaml F# 2010 Swift LISP Scheme Clojure APL J SASL SASL Miranda Haskell Prolog Erlang Elixir PHP
  29. Lineage 1960 1970 1980 ALGOL LISP APL ML Prolog ALGOL

    BCPL C C++ 1990 2000 C# Java JavaScript Ruby ML OCaml F# 2010 Swift LISP Scheme Clojure APL J SASL SASL Miranda Haskell Prolog Erlang Elixir PHP
  30. Mainstream Programming Paradigm Shifts 1950s “Beats machine code” (Assembler) 1960s

    - mid-1970s “Beats assembler” (FORTRAN, COBOL) mid-1970s - mid-1990s “The Great Leap Backwards” (C, C++) mid-1990s - today? “Safer, Web” (Java, JavaScript)
  31. Change is coming • Hardware: GPU / FPGA / Quantum

    computing • Distributed systems • End of Moore’s Law - Storage faster than CPU • Safety and privacy
  32. Is This Some Kind of Joke? HAI 1.2 CAN HAS

    STDIO? VISIBLE "HAI WORLD!!!1!" KTHXBYE http://lolcode.org/
  33. – Harold Abelson and Gerald Jay Sussman with Julie Sussman

    Structure and Interpretation of Computer Programs “Establishing new languages is a powerful strategy for controlling complexity in engineering design; we can often enhance our ability to deal with a complex problem by adopting a new language that enables us to describe (and hence to think about) the problem in a different way…”
  34. What’s In a Name?

  35. Console.WriteLine("Hello, World!");

  36. Console.WriteLine("你好世界");

  37. var hello = "Hello, World!".Substring(0, 5);

  38. http://www.unicode.org/reports/tr51/index.html#Emoji_ZWJ_Sequences

  39. http://www.unicode.org/reports/tr51/index.html#Emoji_ZWJ_Sequences " = U+1F1E8 REGIONAL INDICATOR SYMBOL LETTER C U+1F1E6

    REGIONAL INDICATOR SYMBOL LETTER A
  40. بلق http://nas.sr/%D9%82%D9%84%D8%A8/

  41. None
  42. None
  43. None
  44. http://nas.sr/%D9%82%D9%84%D8%A8/ “The Arabs have a rich tradition of calligraphy and

    poetry attached to the text of their language. Computer scientists have a strangely similar relationship with the text that they write as well, and that overlap was something I became fascinated with.” -Ramsey Nasser
  45. None
  46. None
  47. None
  48. http://nas.sr/بلق/

  49. Is Turing Completeness a Good Idea?

  50. “You theorized a machine that could solve any problem. It

    didn’t just do one thing; it did everything.” (fictional) Joan Clarke to (fictional) Alan Turing The Imitation Game (2014) http://theimitationgamemovie.com/#blog/104786411214 A Misunderstanding
  51. BlooP FlooP GlooP

  52. None
  53. BlooP DEFINE PROCEDURE “PRIME?” [N]: BLOCK 0: BEGIN IF N

    = 0 THEN: QUIT BLOCK O; CELL(0) (() 2; LOOP AT MOST MINUS [N,2] TIMES: BLOCK 1: BEGIN IF REMAINDER [N,CELL(0)] = 0, THEN: QUIT BLOCK 0; CELL(0) (() CELL(0) + 1; BLOCK 1: END; OUTPUT (() YES; BLOCK 0: END.
  54. FlooP MU-LOOP: BLOCK n: BEGIN . . . BLOCK n:

    END.
  55. GlooP

  56. None
  57. None
  58. Client Server Data Cyphertext Result Cyphertext Computation Data Plaintext Result

    Plaintext
  59. None
  60. Does Order of Operation Matter?

  61. https://www.flickr.com/photos/lusoldi/3018045218/

  62. C# if (true *+ LaunchMissiles()) { !" do stuff

  63. C# IEnumerable<int> stuff = from i in new[] { 1,

    2, 3 } select i * i; !" Line A DoStuff(); !" Line B DoStuffWithStuff(stuff); !" Line C
  64. “Now I'm a pretty lazy person and am prepared to

    work quite hard in order to avoid work.” Martin Fowler Refactoring https://www.flickr.com/photos/adewale_oshineye/2933030620/
  65. None
  66. None
  67. None
  68. None
  69. None
  70. None
  71. None
  72. f x = x + 1 g x = x

    + 3 composed = f . g
  73. f x = x + 1 g x = x

    + 3 composed = f . g
  74. f x = x + 1 g x = x

    + 3 composed = f . g
  75. f x = x + 1 g x = x

    + 3 composed = f . g
  76. None
  77. minimum :: Ord a &. [a] "→ a minimum =

    head . sort
  78. minimum :: Ord a &. [a] "→ a minimum =

    head . sort minimum [3, 2, 1] = head . sort $ [3, 2, 1]
  79. https://www.schoolofhaskell.com/

  80. If What Order Wrong Happen Things?

  81. None
  82. System A System B

  83. System A System B Possible Network Partition

  84. System A System B Possible Network Partition THEOREM Spec ⇒

    ☐NobodyGetsEaten
  85. System A System B Possible Network Partition THEOREM Spec ⇒

    ☐NobodyGetsEaten
  86. https://lorinhochstein.wordpress.com/2014/06/04/crossing-the-river-with-tla/

  87. None
  88. None
  89. http://research.microsoft.com/en-us/um/people/lamport/tla/formal-methods-amazon.pdf

  90. http://research.microsoft.com/en-us/um/people/lamport/tla/formal-methods-amazon.pdf

  91. http://research.microsoft.com/en-us/um/people/lamport/tla/hyperbook.html

  92. https://github.com/p-org/PSharp/

  93. https://github.com/p-org/PSharp/

  94. https://github.com/p-org/PSharp/

  95. None
  96. None
  97. None
  98. None
  99. http://p-org.github.io/PSharp/

  100. http://research.microsoft.com/pubs/260939/paper.pdf

  101. Is Real Privacy Even Possible?

  102. None
  103. https://github.com/jeanqasaur/jeeves/blob/master/demo/jcal/tests.py

  104. https://github.com/jeanqasaur/jeeves/blob/master/demo/jcal/jcal/models.py

  105. https://github.com/jeanqasaur/jeeves/blob/master/demo/jcal/jcal/models.py

  106. https://github.com/jeanqasaur/jeeves/blob/master/demo/jcal/jcal/models.py

  107. https://github.com/jeanqasaur/jeeves/blob/master/demo/jcal/tests.py

  108. http://arxiv.org/pdf/1507.03513v5.pdf

  109. http://jeeveslang.org/

  110. What Is the Fundamental Data Type?

  111. None
  112. C Bag of bits C# , Java Object (ref. types)

    Value types Lisp Atom List Haskell Algebraic data types Julia, MATLAB Vector, Matrix APL, J Array Idris Theorem
  113. None
  114. None
  115. None
  116. None
  117. None
  118. None
  119. None
  120. None
  121. None
  122. None
  123. None
  124. https://www.manning.com/books/type-driven-development-with-idris

  125. https://github.com/munificent/vigil

  126. None
  127. None
  128. None
  129. None
  130. None
  131. None
  132. None
  133. None
  134. None
  135. None
  136. What If Future Computers Aren’t Silicon?

  137. Weird Machines

  138. LIQUi|〉 let circUa = CompileUa N a qs "# Compile

    1 Shor step let count = circUa.GateCount() ∗ n∗2 let hits, misses = "# Get total gate count Gate.CacheStats() "# Get gate caching stats let gp = GrowPars(30, 2, false) "# Params for growing let circUa = circUa.GrowGates(k, gp ) "# Grow the circuit circUa.Dump() "# Dump circuit to file ShorRun circUa rslt n a qs "# Run Shor let m = Array.m api "# Accumulate all the ( fun i bit "→ bit <<< i ) rslt "# ..phase estim ation bits |> Array.sum "# ..m = quantum result let permG, permS, permN = k.Perms "# Get permutation stats http://stationq.github.io/Liquid/
  139. None
  140. None
  141. None
  142. http://stationq.github.io/Liquid/

  143. Kappa %agent: A(b,c) %agent: B(a,c) %agent: C(b,a) ## %var: ’V’

    1 %var: ’k1’ INF %var: ’k2’ 1.0E-4/’V’ %var: ’k_off’ 0.1 ## ’a.b’ A(b),B(a) "→ A(b!1),B(a!1) @ ’k2’ (’k1’) ’a.c’ A(c),C(a) "→ A(c!1),C(a!1) @ ’k2’ (’k1’) ’b.c’ B(c),C(b) "→ B(c!1),C(b!1) @ ’k2’ (’k1’) ## ’a..b’ A(b!a.B) "→ A(b) @ ’k_off’ ’a..c’ A(c!a.C) "→ A(c) @ ’k_off’ ’b..c’ B(c!b.C) "→ B(c) @ ’k_off’ ## %var: ’n’ 1000 ## %init: ’n’ A(),B(),C() %mod: [E] > 10000 do \$STOP %def: "dotSnapshots" "true"
  144. None
  145. None
  146. www.kappalanguage.org

  147. This Begs the Question:

  148. Why Don’t We Make a Lazy, Dependently Typed, Domain-Specific, Secure,

    Quantum Biological, Failsafe Language in Arabic?
  149. None
  150. Craig Stuntz @craigstuntz Craig.Stuntz@Improving.com http://www.craigstuntz.com http://www.meetup.com/Papers-We-Love-Columbus/ https://speakerdeck.com/craigstuntz