Skip to main content

Chapter 20: Graphical User Interfaces

  • Chapter
Common Lisp Recipes
  • 2039 Accesses

Abstract

Many a Lisp “newbie” has been seen complaining that while Common Lisp is a cool language, it is and always was pretty weak as far as graphical user interfaces (GUIs) are concerned.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    And while we’re talking about things way ahead of their time, in case you’ve never heard of CLIM, you might want to have a look at it because it is really worth studying (see https://en.wikipedia.org/wiki/Common_Lisp_Interface_Manager , and follow the links from there). On the other hand, while CLIM is interesting and some of it is even impressive, it is not an option for real-world applications that are supposed to run on today’s computers.

  2. 2.

    This is often due to the fact that these environments are backed by large companies giving away stuff for free because they make their money elsewhere. Unfortunately, the days when Lisp companies were large enough to do that are long gone.

  3. 3.

    See https://en.wikipedia.org/wiki/Cocoa_%28API%29 .

  4. 4.

    Specifically with no considerations about security or reasonable default behavior in the case of “stupid” user input.

  5. 5.

    Screenshot from Google Chrome on Windows 7.

  6. 6.

    See https://en.wikipedia.org/wiki/Single-page_application .

  7. 7.

    Available at https://jquery.com/ .

  8. 8.

    See https://en.wikipedia.org/wiki/Ajax_%28programming%29 .

  9. 9.

    You could even distribute a browser of your choice with your app so that you can, for example, start it in fullscreen “kiosk mode.”

  10. 10.

    See https://en.wikipedia.org/wiki/Canvas_element .

  11. 11.

    See https://en.wikipedia.org/wiki/Scalable_Vector_Graphics .

  12. 12.

    See https://en.wikipedia.org/wiki/WebGL .

  13. 13.

    See http://d3js.org/ .

  14. 14.

    See http://threejs.org/ .

  15. 15.

    See https://en.wikipedia.org/wiki/Content_delivery_network .

  16. 16.

    It doesn’t have to be a flat list like here. See the jQuery UI documentation for other options.

  17. 17.

    Note that symbols are automatically converted to strings here; see Recipe 1-9.

  18. 18.

    See http://www.activestate.com/activetcl . Tk was originally written for and is still tightly knit to the Tcl programming language, thus the name. But that doesn’t need to bother us if we just want to use Ltk.

  19. 19.

    See Recipe 22-6.

  20. 20.

    See Recipe 22-1.

  21. 21.

    See https://en.wikipedia.org/wiki/Sierpinski_carpet .

  22. 22.

    Screenshot from Tcl/Tk 8.5 on Windows 7.

  23. 23.

    See http://www.cliki.net/gui for a list (which is probably incomplete).

  24. 24.

    We use the term binding in a broader sense here. Most libraries really establish a binding in the sense that they call “foreign code” (see Chapter 19), while some, like Ltk, use a (network) stream to communicate with an external process.

  25. 25.

    See https://en.wikipedia.org/wiki/Tk_%28software%29 .

  26. 26.

    And Tcl/Tk itself is not particularly fast either…

  27. 27.

    And you might want to have a look at https://en.wikibooks.org/wiki/Common_Lisp/External_libraries/Ltk as well. A general understanding of Tk will also be helpful. For that, a good starting point is http://www.tkdocs.com/tutorial/index.html .

  28. 28.

    See https://en.wikipedia.org/wiki/Spinner_%28computing%29 .

  29. 29.

    Which, by the way, relies on modifying the Lisp reader. See more in Chapter 8

  30. 30.

    I was using ABCL 1.3.2 and according to their documentation the JINTERFACE-IMPLEMENTATION part is “partly not finished,” so you might want to check if there’s a newer version and if the API has changed.

  31. 31.

    Java also has some big disadvantages as not only Lisp hackers will happily attest. But I’ll refrain from pursuing this topic here…

  32. 32.

    Historical tidbit: did you know that the forebear of Apple’s Interface Builder was written in Lisp?

  33. 33.

    This is a very simple and unoptimized way of computing the Mandelbrot set (see https://en.wikipedia.org/wiki/Mandelbrot_set ).

  34. 34.

    Our aim is to implement a graphical representation of the Calkin-Wilf tree (see https://en.wikipedia.org/wiki/Calkin%E2%80%93Wilf_tree ; see also Recipe 4-5).

  35. 35.

    AllegroCL’s Common Graphics comes close, but according to their documentation currently (as of June 2015) uses GTK instead of Cocoa on Macs and can’t be used with SMP versions of the compiler unless you’re on Windows.

  36. 36.

    Some of them are listed at http://www.lispworks.com/success-stories/index.html .

  37. 37.

    The hierarchy of CAPI classes can be seen at http://weitz.de/capi-overview/ .

  38. 38.

    See https://en.wikipedia.org/wiki/Event_loop .

  39. 39.

    To be found at http://capi.plasticki.com/ .

  40. 40.

    See https://wukix.com/mocl .

  41. 41.

    See http://www.informatik.uni-kiel.de/~wg/clicc.html .

  42. 42.

    There are some good introductory screencasts at https://wukix.com/mocl-screencasts .

  43. 43.

    See https://sites.google.com/site/maximaonandroid/ .

  44. 44.

    See http://www.lispworks.com/documentation/lw70/LW/html/lw-123.htm and http://www.lispworks.com/documentation/lw70/LW/html/lw-119.htm for more information.

Author information

Authors and Affiliations

Authors

Electronic Supplementary Material

Below is the link to the electronic supplementary material.

chapter-20 (zip 4 kb)

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Edmund Weitz

About this chapter

Cite this chapter

Weitz, E. (2016). Chapter 20: Graphical User Interfaces. In: Common Lisp Recipes. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1176-2_20

Download citation

Publish with us

Policies and ethics