wisp-lisp-alternative.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. title: Wisp: Lisp, minus the parentheses
  2. date: 2015-09-23 17:05
  3. author: Christine Lemmer-Webber
  4. tags: wisp, scheme, lisp, hacking, foss
  5. slug: wisp-lisp-alternative
  6. ---
  7. <p>
  8. <a href="http://draketo.de/">Arne Babenhauserheide</a>
  9. has built a really cool syntax alternative for Scheme,
  10. <a href="http://draketo.de/english/wisp">Wisp</a>
  11. (not to be confused with a
  12. <a href="https://github.com/Gozala/wisp">different lisp-related-wisp</a>),
  13. or in standards version,
  14. <a href="http://srfi.schemers.org/srfi-119/srfi-119.html">SRFI 119</a>.
  15. It looks pretty nice:
  16. </p>
  17. <blockquote>
  18. <pre>
  19. ;; hello world example
  20. display ; (display
  21. string-append "Hello " "World!" ; (string-append "Hello " "World!"))
  22. display "Hello Again!" ; (display "Hello Again!")
  23. ;; hello world function
  24. define : hello who ; (define (hello who)
  25. display ; (display
  26. string-append "Hello " who "!" ; (string-append "Hello " who "!")))
  27. </pre>
  28. </blockquote>
  29. <p>
  30. Actually, let's see that in emacs, just to be sure.
  31. </p>
  32. <p class="centered">
  33. <img src="/etc/images/blog/wisp_emacs_hello.png" alt="Wisp and hello world" />
  34. </p>
  35. <p>
  36. How about something slightly more substantial? How about a real life
  37. Guix package for GNU Grep:
  38. </p>
  39. <p class="centered">
  40. <img src="/etc/images/blog/wisp_emacs_guix_grep.png" alt="Wisp, Emacs, Guix and Grep" />
  41. </p>
  42. <p>Wow, not bad... not bad at all! I'd say that's quite readable!
  43. (Too bad the lines don't line up exactly in that screenshot; that's
  44. not the code but rather my emacs theme bolding the wisp code.)</p>
  45. <p>
  46. What's nice is that unlike most s-expression alternatives, it doesn't
  47. lack any of the power of Lisp; it's "just lisp" with the parentheses
  48. hidden by vaguely pythonesque indentation, which means even macros
  49. work.
  50. </p>
  51. <p>
  52. Now me personally? I've learned to love the parens, and there's
  53. nothing that beats an editor that knows how to do cool structural
  54. s-expression editing and navigation. But I admit that learning to read
  55. through all the parentheses was a tough thing for me initally, and
  56. certainly for many others. Maybe this can help boil the lisp frog for
  57. some.
  58. </p>
  59. <p>
  60. Now what would <em>really</em> be hylarious would be to port this to
  61. <a href="http://hylang.org/">Hy</a>...
  62. </p>