|
|||||||||||||
|
|
|
|
|
|
|
|
|
||||||
|
|
|||||||||||||
![]() ![]() ![]() ![]() ![]() ![]() |
Tech CornerTech Corner features technical tips, techniques, and the latest updates to apply when using Allegro CL. Information in this section is updated frequently, so check back periodically. The entries on this page are short, with links to a fuller discussion. In most cases the title is linked. (Some short entries are complete and have no associated longer discussion.) We have grouped the articles under the headings:
Older articles can be found in our archive.
Use our RSS feed
Most recent five articles
New products and features
Coding examples
Product details
Release Announcements
Other topics
send-mail and send-letter enhancements allow using SSL and starting STARTTLS negotiationsSMTP support has been enhanced to allow for SSL connections and STARTTLS negotiation ('TLS' stands for Transport Layer Security and is another name for SSL.) The enhancement is implemented by allowing information to be included in the value of the mail-server argument to send-smtp, send-smtp-auth and send-letter. See here for more information. CG Class Grid and Object Editor dialog display instances and slot valuesTwo new tools added to Common Graphics in release 8.1 are the Class Grid and the Object Editor. While they have been around for a while, we have not until now mentioned them in a Tech Corner article.
Neither tool comes in a pre-built form: you must create a customized version for your particular classes. But once made, they are useful for examining and specifying lists of instances (for the Class Grid) and slot values (for the Object Editor). There is a worked out example in the document Creating an Object-Editor Dialog or Class-Grid Programmatically. We show the dialogs created by that example with some commentary here. SSL update allows better protocol and cipher specificationThe SSL (Secure Socket Layer) has been supported in Allegro CL on most platforms for some time. See Secure Socket Layer (SSL) in socket.htm. When an SSL connection is established, a handshake protocol must be agreed on and a cipher used to encode the data being sent must be chosen. In a recent update to Allegro CL, the functions that create SSL client and server streams (make-ssl-client-stream and make-ssl-server-stream) have been enhanced to allow more precise specification of the handshake protocol and specification of the cipher to be used. Previously you could only specify that the SSL version 2 or 3 protocol would be used (but you could not specify which: the highest available on both sides would be selected) or that the TLS protocol would be used. Now you can specify that the best available protocol from SSL2, SSL3, and TLS be used, or that specifically SSL2, SSL3, or TLS be used, or that SSL3 or TLS be used but an error signaled if only SSL2 is available. (SSL2 is not considered secure.) As to ciphers, you can now specify the named ciphers you wish to use or not use. You normally specify several choices and the strongest common cipher on the list of the server and client is then chosen. See http://www.openssl.org/docs/apps/ciphers.html for information on ciphers. Previously, the openssl DEFAULT cipher list (described on the linked website) was always used. Here is an example of a call: (setf ssl-stream (make-ssl-client-stream sock :ciphers "DEFAULT:-LOW:-EXPORT")) This sets the cipher selection list to the default list, minus 64 or 56 bit ciphers and minus United States "export grade" encryption algorithms (including 40 and 56 bits algorithms). Again, the meaning and format of cipher lists are described at http://www.openssl.org/docs/apps/ciphers.html. New version of Allegro CL 8.1 ExpressAllegro 8.1 Express is the free version of Allegro CL which allows people to try out the product. It is available for Windows, FreeBSD, Linux, and Mac OS X (for Intel processors). Allegro CL Express is available for download here. A new version of Allegro CL 8.1 Express was released in late June, 2008. The most important changes are:
Current Allegro CL Express users should simply update in the usual way, using sys:update-allegro or, on Windows, the Download Patches dialog. The new features will be available when the update is complete. AllegroGraph 3.0 released!Version 3.0 of AllegroGraph 64-bit RDFStoreTM has been released. AllegroGraph is a tool for efficiently processing billions of RDF triples. Among the enhancements in version 3.0 are the following:
Also improved are efficiency, performance, error handling, server security, and much else. See the AllegroGraph 3.0 Change History for details and links to documentation describing the new features. Read more about AllegroGraph in general here. Some notes on the Lisp heap sizeYou may see an error like this when using Allegro CL if you have loaded a lot of data into Lisp: Error: An allocation request for 483032 bytes caused a need for 12320768 more bytes of heap. The operating system will not make the space available. [condition type: STORAGE-CONDITION] This error indicates the Lisp has run out of heap space. This note explains the most common cause of this problem and how to fix things. The fix is usually easy: you just need to build a new image suited to your specific data needs. The note also has links to the documentation essays and and the FAQ entries relevant to this issue. A Web Application Delivery Framework for AllegroServeA simple framework for delivering AllegroServe web applications. Includes built-in code to run server as a daemon or service on windows platforms, allows on the fly reloading of the published application, offers telnet access for debugging from the localhost only, and automatically sets up logging with additional support for log rotation. Includes a sample web application to demo these capabilities. A major CLIM update on all platformsThe update was made available in mid-March. There are different Windows and UNIX/UN*X-like versions. Updates are downloaded with sys:update-allegro or, on Windows using the IDE, with the Download Patches dialog accessible from the Help menu. The following issues are among those dealt with in the update:
All CLIM users should get the update. The CLIM documentation has not changed. Lisp as a shared library on UNIX revisionsWe have revised the documentation and the example for having Lisp be a shared library on UNIX, which allows Lisp functionality to be called from C/C++ applications. The new example is simpler. It is described in detail in the new documentation unix-shared-library.htm. This essay discusses what has changed and shows off the example. New string+ function for fast and easy string concatenationThe new function util.string:string+, added in a recent update to Allegro CL 8.0 and 8.1, takes any number of any Lisp objects as arguments and returns a fresh simple string which is the concatenation of the printed representation of the objects. string+ is designed to allow quick and efficient creation of labels, names, etc. made with integers, characters, strings, and symbols. For example: (util.string:string+ "version-" 1 #\. 3) RETURNS "version-1.3"
string+
is optimized for shorter strings and for symbols, strings, characters,
and fixnums as arguments, but it will accept any Lisp object and will
work with any string length. Its simple calling sequence and the fact
that it does the conversion of non-strings to strings makes it easier
to use than string+ is part of a new module designed to hold string-manipulation functions, the util-string module. It is described in the new document string-utilities.htm. Defining and Displaying Google Maps from LispWe show how to display google maps with Common Graphics. On Windows, the Common Graphics HTML widget is used; on Linux, an external browser. Maps can be displayed showing locations identified by address or by longitude and latitude. Regular, hybrid, or satellite maps can be specified. Click here to see the article. A text indexer using B-treesAn example of a fast and efficient text indexer is provided in this note. It uses AllegroCache and B-trees. The code for the example is available. Click here to see the article. Read more about AllegroCache here. 64-bit Allegro CL 8.1 (x86-64) for Mac OS X Leopard (10.5) is now available.64-bit Allegro CL 8.1 (x86-64) for Mac OS X Leopard (10.5) is now available. This new version joins our other eight 64-bit Allegro CL ports, including the 64-bit Mac OS X (PPC) version. 64-bit Allegro CL 8.1 on Mac OS X 10.5 produces native x86-64 code which has access to the entire 64-bit address space on Leopard. Applications written for 64-bit Allegro CL are source code compatible with 32-bit Allegro CL. Lamp widget in Common Graphics enhancedThe lamp widget, which displays a LED-like image with user-selectable colors, on and off states, a variety of shapes, and customizable labels and borders, has been enhanced in release 8.1. Among the changes is better support for arrays of lamps, which now allows the individual lamps to have their own on-color and off-color. New functions also allow better labeling of the lamps in the array. Finally, support is provided for placing lamps in grid-widgets. See the description of the lamp widget for details and a code example, which creates the following window with a simple lamp widget plus a more complex lamp widget that contains a labeled array of lamp images (some of which, as you will see if you run the example, are blinking): Allegro CL 8.1 has been releasedThe Enterprise, Professional and Express Editions of Allegro CL 8.1 have been released. Some of the features/improvements: significant performance improvements over 8.0; updated SOAP and jLinker modules; many Common Graphics and IDE improvements and fixes; ISO 8601 date/time module; PAM support; X.509 certificates (SSL); MIME message construction support; AllegroCache 2.0; Allegro Btrees, the same btree module that AllegroCache uses is now available to users; AllegroGraph 2.1, our persistent, scalable triple-store database, for use in Semantic Web applications; and much more. Read more about it here. New symbolic debugger support in Allegro CL 8.1Allegro CL 8.1 has added support for symbolic debuggers like gdb, dbx, and windbg. These are all products separate from Allegro CL. They allow you to run a program (like Allegro CL) as a subprocess that you can interrupt. Once interrupted, the values in registers and other locations can be examined. You must be familiar with the appropriate debugger for your platform (different products are available on different platforms and not all platforms have a supported debugger). The hooks provided allow you to use these products more easily. See here for more information. New Common Graphics menus for many choices in Allegro CL 8.1Suppose you need a user to choose among a large number (tens or hundreds or more) of different possibilities. How would you have the user make the choice? Well, there are many possible answers, and Common Graphics provides support for implementing many of these methods. In release 8.1, Common Graphics provides a new method with a simple interface: so long as your choices have alphanumeric names and you have an ordered list of possibilities, a new Common Graphics utility allows you to present the choices in a cascade of menus, with the choices becoming more and more specific (i.e. showing more and more of the identifying name) until an actual choice is made. We give an example here. New Common Graphics Chart Widget in 8.1The new Chart Widget, available in Allegro CL 8.1 (which is in beta release) allows drawing bar and line charts of data with many options for labeling, coloring, etc. See here for a discussion with illustrations. Support for TCP MD5 Signature Option on LinuxThe new function set-tcp-md5-sig provides an interface to the TCP_MD5SIG (RFC2385) socket option. It sets the key to be used for TCP connections from an address. make-socket has been modified to accept new keyword arguments tcp-md5-sig-key and tcp-md5-sig-key-ef. This new feature is available on Linux platforms only. An update for Allegro 8.0 with these additions was released in May, 2007. Support for SSL X.509 certificatesAllegro CL has for some time supported SSL (Secure Socket Layer) sockets. See the section Secure Socket Layer (SSL) in socket.htm. An update released in late March, 2007, enhances this facility to provide support for X.509 certificates. You can now:
A new class, x509-certificate, allowing representation of such certificates in Lisp has been added, along with supporting functionality. The generic function ssl-do-handshake initiates a handshake between the client and the server. Other generic functions include get-ssl-verify-result and get-ssl-peer-certificate. See also make-ssl-server-stream and make-ssl-client-stream, existing operators which have been modified in light of the new functionality. Simulating Symmetric Multi-Processing with fork()This article discusses example code that uses excl.osi:fork on non-Windows platforms to utilize all available processors for Lisp computations. It assumes that your application has compute bound parts which can be run in parallel. Complete source code provided. How the New Daylight Saving Time rules affect Allegro CLCountries around the world use different rules for Daylight Saving Time. What's more, the rules in the United States are changing in 2007 so that its Daylight Saving Time is scheduled to start earlier and last longer than it has in previous years. This article describes how Allegro CL uses Daylight Saving Time and how Allegro CL determines that a time is in Daylight Saving Time. The article also describes how you can check that an Allegro CL running in the United States is on a host updated to the new United States rules, and how you can use the new United States rules in Allegro CL even if the host has not been updated to the new rules. Support for any newline format in text inputExchanging text between computer systems is easy thanks to character encoding standards such as ASCII, Unicode, and other widely used standards. The ease of text exchange, though, is marred by different computer systems using different line break conventions: UNIX uses an ASCII linefeed, DOS uses an ASCII carriage-return followed by a linefeed, and Macintosh systems traditionally use only the ASCII carriage-return. This problem is an issue for Common Lisp since the ANSI Common Lisp specification states that the single Lisp #\Newline character is to indicate the end of a line of text. Thus, Lisp reading and writing of text requires understanding how line endings are handled on the native platform so that they can be properly converted to #\Newline. Allegro CL allows the end-of-line convention to be set for a stream, with the function eol-convention. A new value, :anynl, is now accepted for input streams. It causes any valid end-of-line convention to be correctly interpreted and avoids the problems associated with reading files with unexpected end-of-line markers. See here for more details. Earthquake data via the USGS websiteThe earthquake data example uses AllegroServe to access earthquake data from the United States Geological Survey, location data from Google Maps and a zip code directory to list recent earthquakes near any specified location in the USA. The code for the example is relatively short. The techniques could be adapted by any application wishing to use or display publicly available data. And running it, you can find out about recent earthquakes near you! (We are in California, so these things matter to us.) A discussion of the example and instructions for downloading are here. RPC update provides better interface for killing the client Lisp
A new Allegro RPC (Remote Procedure Call) update was released in
mid-January, 2007. Along with various minor code changes and some
significant documentation revisions, the update added a new
High Performance Btree Module Now AvailableThe same btree module that AllegroCache has been using to implement object persistence is now available for programmers to use directly. Btrees are useful for applications where you need a simple and efficient way of storing on disk and retrieving vast amounts of data and where you don't want to pay the overhead of transactions and CLOS. This note discusses btrees and gives a simple example using them. Some techniques for reducing consing when processing very large text filesPrograms often have to process large text files. In particular, AllegroCache and AllegroGraph programs often need to read enormously large text based files, such as ntriple rdf files or comma separated files with hundreds of millions of entries or more. In these cases, even a small amount of extra consing per entry results in a burdensome or even unacceptable gc overhead. Techniques are thus needed for reducing consing to a minimum. In this note, we show effective cons reducing code. It uses the resource based read-line variants discussed in this earlier Tech Corner article. We show space usage reductions from 79Mbytes to 8Kbytes (comparing naive use of read-line compared to using the variants) and from 257 Mbytes to 98 Mbytes in an example where some information from the data must be stored. Allegro CL documentation index and permuted index now regularly updatedWe have now automated the system for producing the Allegro CL documentation index and permuted index. This allows us to update both indexes regularly so features added after a release will be properly indexed. (In the past, the regular index was only occasionally updated and the permuted index was never updated between Allegro CL releases.) The Allegro CL 8.0 documentation on our website has updated indexes. You may view it on the web or see this page for information on downloading the updated version. Exploring the Microsoft IE OLE interfaceIn this article we use ACL to explore Microsoft Internet Explorer's OLE interface. We'll use two tools, the def-ole-linkage system and the more flexible, but lower-level, remote-autotool system. OpenGL bindings using SWIG 1.3.30OpenGL is a collection of 2D and 3D graphics routines providing an environment for developing portable, interactive 2D and 3D graphics applications (see www.opengl.org). Allegro CL now has an interface to OpenGL 1.1 on Windows, to OpenGL 1.2 and OpenGL 1.3 on Linux, and OpenGL 2.0 on Mac OS X (ppc or x86). The interface was built using SWIG -- see Allegro CL support in SWIG. The SWIG-generated files are available and will likely work on other UNIX platforms, but we have not tested them on anything other than Windows, Linux, and Mac OS X (ppc or x86) at this time. Support for ISO 8601 date-time representationsISO 8601 is an international standard for representing dates in the Gregorian calendar and times and representations of periods of times. Support for parsing ISO 8601 date-time strings and storing the corresponding date-time object in Lisp has been added in an update (available to supported customers and to Express users) released in mid-August, 2006. The note discusses the new facility and has links to the documentation. New Allegro CL FAQ (replacing old one)There is a new FAQ for Allegro CL. It has a simpler format than the old FAQ and will be updated by Franz more often. It will no longer be included in the documentation, as doing that results in out-of-date copies still seeming current. Comments on the content and format are welcome (send them to support@franz.com). The material covers all currently-supported Allegro CL releases, including questions about the Express edition and Express edition licenses. Lisp in a Box now includes Allegro CL 8.0 on LinuxLispbox is a version of Lisp in a Box (created originally by Matthew Danish and Mikel Evins) customized for use with the Practical Common Lisp book by Peter Seibel. Downloads including the appropriate Allegro CL 8.0 Express Edition are available for Windows, Mac OS X, and (as we now announce here) Linux on x86 machines. An AllegroCache RSS feed is now availableAn RSS feed containing release information for AllegroCache updates is now available on our RSS feeds page. Use the RSS feed to stay up to date on releases of AllegroCache. Space-efficient variants of read-lineTwo new functions, read-line-into and simple-stream-read-line provide space-efficient variants of read-line. They work by allowing the programmer to supply the target string (for read-line-into) or a buffer (for simple-stream-read-line) and thus avoid the creation of unnecessary new strings. See the doc pages for descriptions and here for a demonstration of their use of almost no space. Get the new functionality with sys:update-allegro. Available in version 8.0 only. Python implemented in Common LispWillem Broekema has created an implementation of Python in Allegro CL 8.0 (it works with Allegro CL 8.0 Free Express). It is available for free download. See http://trac.common-lisp.net/clpython/ for more information and downloading instructions. Fair multiprocessing exampleIf you run multiple processes in a Lisp application, there may be an issue about how to allocate processor time between the processes and how often to switch beween processes. In this article, we discuss the allocation issue and demonstrate a couple of ways to control the frequency of process switching. Allegro CL 8.0 Student Edition releasedThe Student Edition (available at a low price to bona fide students) of Allegro CL 8.0 has been released. It is described on this page, which also tells how to order it. Allegro CL 8.0 Express Edition releasedThe Express Edition of Allegro CL 8.0 has been released. This is a free edition available to all on selected platforms. It is described on this page, which also tells how to get it. Backing up AllegroCache dataAllegroCache 1.1 has a new and improved scheme for ensuring data persistence compared to version 1.0. This note discusses the issue of data persistence in general and the old and the new support for persistence in AllegroCache. Allegro CL 8.0 for Intel Mac OS X is now availableAllegro Common Lisp 8.0 is now available for Intel Mac OS X. This version of Allegro CL runs natively on Intel Mac OS X and is a completely separate version from the PowerPC version of Allegro CL that runs on Mac OS X. 64-bit Allegro CL 8.0 for Windows XP Professional x64 Edition is now available64-bit Allegro Common Lisp 8.0 is now available for Microsoft Windows XP Professional x64 Edition. The x64 Edition of XP is Microsoft's 64-bit version of Windows that runs on AMD Athlon 64 processors, and Intel processors compatible with the AMD Athlon 64 instruction set. This is not to be confused with the 64-bit version of Windows for Intel IA64. This version of Allegro CL is not targeted at IA64. New Common Graphics widgetsCommon Graphics in Allegro CL 8.0 includes support for two new widgets: the lamp widget, which allows displaying a colored shape (typically a circle) with several color modes for providing visual clues in a graphical application; and the HTML widget and an associated HTML browser dialog, which allow browser capabilities within Lisp. See here for more information. New AllegroServe tutorialsFour new tutorials, on GET requests, on Post requests, on Multipart requests, and on redirects, are now available. Runnable examples are included with each tutorial. This page lists all tutorials (including the ones mentioned). Using AJAX with Allegroserve and WebactionsAjax, an acronym for Asynchronous Javascript And Xml, adds to dynamic html the ability for the client to send background messages to the server and have responses trigger changes to the user's screen. AllegroServe and Webactions support AJAX, as described here. New support for constructing MIME messagesMIME (Multipurpose Internet Mail Extensions) provides a standard for attaching files, both text and binary, to email messages. Allegro CL has long supported managing email messages from within Lisp (using the POP and IMAP interfaces for reading messages and the SMTP interface for sending them). With a recent update, it has now been enhanced to support the construction and sending of MIME messages. The entire email interface is described in imap.htm (the document is named for the first supported interface even though it describes much more than IMAP). The new MIME API is in the section MIME support in that document. There are several examples showing how to construct and send MIME messages. The ability to create native Lisp pipe streamsA recent update to Allegro CL 8.0 (and 7.0) added support for creating native pipe streams. (Support for OS-provided pipe-streams was already provided by excl.osi:pipe.) A pipe stream is a pair of bi-directional streams interconnected so that data written to one can be read on the other. Pipe streams are not particularly useful by themselves. They are provided as a building block for inter-process communication within the Lisp. See make-pipe-stream for further details. See also make-function-input-stream and with-function-input-stream. The latter two operators use pipe streams. All three pages include examples. Lisp scripting on Windows with .bat filesOn UNIX, #! can be used to run "Lisp scripts". Until now, this was not possible on Windows. Read the Windows Scripting Tech Corner article, for more information. Allegro CL 8.0 has been released.More information here. RSS feeds for 7.0 and 8.0 patches are now availableRSS feeds for patches are now available on our RSS feeds page. Atom 1.0 feeds now available
In addition to RSS 0.91, 1.0 and 2.0 feeds, we now have an Atom 1.0 feed.
Brief tutorials on Allegro CL featuresThe Tutorials page of the support section of the Franz Inc. website has links to brief tutorials on Allegro CL utilities and features. These tutorials are design to provide a quick introduction to a feature, by way of a simple, runnable example (the tutorials may have code to run or may show a transcript of running code and return values). ArchiveYou can find old Tech Corner entries here.
© 2008 Franz Inc - Privacy Statement |