home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / doc / faq.txt < prev    next >
Text File  |  2002-03-25  |  14KB  |  312 lines

  1.  
  2.         Frequently Asked Questions about the Icon programming language
  3.  
  4.    http://www.cs.arizona.edu/icon/faq.htm
  5.    Last updated March 25, 2002.
  6.  
  7.    Learning about Icon
  8.    A1. What is Icon?
  9.    A2. What is Icon good for?
  10.    A3. What is the Icon program library?
  11.    A4. Where can I learn more about Icon?
  12.    A5. How about comprehensive documentation?
  13.  
  14.    Implementations
  15.    B1. What platforms support Icon?
  16.    B2. How do I get started with Icon?
  17.    B3. Is there a Unicode version of Icon?
  18.    B4. What happened to the compiler?
  19.  
  20.    Administration
  21.    C1. What is the Icon Project?
  22.    C2. How often is the on-line material updated?
  23.    C3. Where did Icon come from?
  24.    C4. Where is Icon going? 
  25.  
  26.    Support
  27.    D1. Is there a users' group for Icon?
  28.    D2. How do I get technical support?
  29.  
  30.    Programming
  31.    E1. Why doesn't read() work with every?
  32.    E2. Why doesn't string invocation such as "foo"() work?
  33.    E3. How can I call a C function?
  34.    E4. Can I open a bidirectional pipe?
  35.      _________________________________________________________________
  36.  
  37. Learning about Icon
  38.  
  39.   A1. What is Icon?
  40.  
  41.    Icon is a very high level general-purpose programming language with
  42.    extensive features for processing strings (text) and data structures.
  43.    Icon is an imperative, procedural language with a syntax that is
  44.    reminiscent of C and Pascal, but with semantics at a much higher
  45.    level.
  46.  
  47.    Icon has a novel expression-evaluation mechanism that integrates
  48.    goal-directed evaluation and backtracking with conventional control
  49.    structures. It has a string scanning facility for pattern matching
  50.    that avoids the tedious details usually associated with analyzing
  51.    strings. Icon's built-in data structures include sets and tables with
  52.    associative lookup, lists that can be used as vectors or stacks and
  53.    queues, and records.
  54.  
  55.    Icon is a strongly, though not statically, typed language. It provides
  56.    transparent automatic type conversion: For example, if an integer is
  57.    used in an operation that requires a string, the integer is
  58.    automatically converted to a string.
  59.  
  60.    Several implementations of Icon have high-level graphics facilities
  61.    with an easily programmed window interface.
  62.  
  63.    Icon manages storage automatically. Objects are created as needed
  64.    during program execution and space is reclaimed by garbage collection
  65.    as needed. The sizes of strings and data structures are limited only
  66.    by the amount of available memory.
  67.  
  68.   A2. What is Icon good for?
  69.  
  70.    As a general-purpose programming language with a large computational
  71.    repertoire, Icon can be used for most programming tasks. It's
  72.    especially strong at building software tools, for processing text, and
  73.    for experimental and research applications.
  74.  
  75.    Icon is designed to make programming easy; it emphasizes the value of
  76.    programmer's time and the importance of getting programs to work
  77.    quickly. Consequently, Icon is used both for short, one-shot tasks and
  78.    for very complex applications.
  79.  
  80.   A3. What is the Icon program library?
  81.  
  82.    The library is a collection of programs and procedures written in
  83.    Icon. User contributions are welcome and form a significant portion of
  84.    the library.
  85.  
  86.    Library procedures effectively augment the built-in functions
  87.    available to an Icon program. A wide variety of procedures currently
  88.    exists, and most graphically-based programs are built around library
  89.    procedures.
  90.  
  91.    The programs in the library range from simple demonstrations to handy
  92.    tools to complex graphical applications.
  93.  
  94.    The library is a resource for both new and experienced programmers. In
  95.    addition to their basic utility, its programs and procedures serve as
  96.    examples of how things can be written in Icon.
  97.  
  98.   A4. Where can I learn more about Icon?
  99.  
  100.    Here are some good places to start.
  101.      * Ralph Griswold's overview:
  102.        http://www.cs.arizona.edu/icon/docs/ipd266.htm
  103.      * Dave Hanson's introduction:
  104.        http://www.cs.arizona.edu/icon/intro.htm
  105.      * John Shipman's tutorial: http://www.nmt.edu/tcc/help/lang/icon/
  106.  
  107.   A5. How about comprehensive documentation?
  108.  
  109.    The definitive work is The Icon Programming Language (third edition)
  110.    by Griswold and Griswold (Peer-to-Peer Communications, 1996). It
  111.    contains both tutorial and reference material.
  112.  
  113.    Graphics facilities are described in Graphics Programming in Icon by
  114.    Griswold, Jeffery, and Townsend (Peer-to-Peer Communications, 1998).
  115.    Again, both tutorial and reference material is included.
  116.  
  117.    Icon's internals are detailed in The Implementation of the Icon
  118.    Programming Language by Griswold and Griswold (Princeton, 1986, out of
  119.    print). Although considerable changes have occurred since Version 6,
  120.    described in the book, the basic structure is the same. Two technical
  121.    reports, IPD112 and IPD239, describe subsequent changes.
  122.  
  123.    The Icon Programming Language Handbook, by Thomas W. Christopher, is
  124.    available on the web at http://www.toolsofcomputing.com/IconHandbook/.
  125.  
  126.    There is a large amount of additional information at the Icon web
  127.    site, http://www.cs.arizona.edu/icon, but there is no complete on-line
  128.    documentation.
  129.      _________________________________________________________________
  130.  
  131. Implementations
  132.  
  133.   B1. What platforms support Icon?
  134.  
  135.    Current implementations with graphics support are available for Unix
  136.    and Windows. On the Macintosh, the Unix implementation runs under
  137.    MacOS X, with graphics using XFree86. Older versions of Icon are
  138.    available for some other systems. An alternative Java-based
  139.    implementation for Unix, Jcon, is also available.
  140.  
  141.   B2. How do I get started with Icon?
  142.  
  143.    Version 9.4.1 of Icon for Unix can be downloaded from
  144.    http://www.cs.arizona.edu/icon/v941/. Source and binary packages are
  145.    available, each with the complete Icon program library.
  146.  
  147.    Version 9.3 of Icon for Windows is compatible at the source level with
  148.    version 9.4.1. It can be downloaded from
  149.    http://www.cs.arizona.edu/icon/v93w.htm. The Version 9.4.1 library can
  150.    be obtained separately from http://www.cs.arizona.edu/icon/v941/.
  151.  
  152.    For older implementations, start at
  153.    http://www.cs.arizona.edu/icon/implver.htm. Jcon is at
  154.    http://www.cs.arizona.edu/icon/jcon/.
  155.  
  156.   B3. Is there a Unicode version of Icon?
  157.  
  158.    No. Icon is defined in terms of 8-bit characters, and changing this
  159.    presents several design challenges that would likely break existing
  160.    programs. Also, modifying the C implementation is probably infeasible,
  161.    but a Unicode version of Jcon might be possible.
  162.  
  163.   B4. What happened to the compiler?
  164.  
  165.    For a while, Unix distributions included both an interpreter and a
  166.    compiler; but the interpreter is is usually fast enough even for
  167.    production work, and most people found that using the compiler wasn't
  168.    worth the extra compilation time or the hassles involved. We no longer
  169.    advertise the compiler or produce binaries for it. It is still part of
  170.    the source code distribution, and we have not deliberately broken it,
  171.    but we no longer support it and we cannot offer help if problems
  172.    arise.
  173.      _________________________________________________________________
  174.  
  175. Administration
  176.  
  177.   C1. What is the Icon Project?
  178.  
  179.    The Icon Project is a name used by the group that distributes and
  180.    supports the Icon programming language. The project maintains the Icon
  181.    web site at http://www.cs.arizona.edu/icon. A non-commercial
  182.    organization, the project derives support from the University of
  183.    Arizona, revenue from book sales, and user contributions.
  184.  
  185.   C2. How often is the on-line material updated?
  186.  
  187.    New material is added when it's available. Established implementations
  188.    usually are updated only when there's a new version. This typically is
  189.    every year or two. The Icon program library is updated on a similar
  190.    schedule.
  191.  
  192.   C3. Where did Icon come from?
  193.  
  194.    Icon is the latest in a series of high-level programming languages
  195.    designed to facilitate programming tasks involving strings and
  196.    structures. The original language, SNOBOL, was developed at Bell
  197.    Telephone Laboratories in the early 1960s. SNOBOL evolved into
  198.    SNOBOL4, which is still in use. Subsequent languages were developed at
  199.    the University of Arizona with support from the National Science
  200.    Foundation. Although it has similar objectives and many similar
  201.    capabilities, Icon bears little superficial resemblance to SNOBOL4.
  202.  
  203.    Icon implementations were developed by faculty, staff, and students at
  204.    the University of Arizona, with significant contributions from
  205.    volunteers around the world. An Icon history by Ralph and Madge
  206.    Griswold appears in the preprints of the second History of Programming
  207.    Languages Conference (HOPL-II), ACM SIGPLAN Notices, March 1993 (Vol
  208.    28, No 3).
  209.  
  210.    The name Icon is not an acronym, nor does it stand for anything in
  211.    particular, although the word iconoclastic was mentioned when the name
  212.    was chosen. The name predates the now common use of icon to refer to
  213.    small images used in graphical user interfaces. This sometimes
  214.    misleads people into thinking that that Icon is designed to create or
  215.    manipulate icons, but there's no good solution to that problem.
  216.  
  217.   C4. Where is Icon going?
  218.  
  219.    We continue to use Icon on a daily basis, but no significant changes
  220.    are planned. We expect to support the Unix version for the forseeable
  221.    future, and to distribute ports to other systems as supplied by
  222.    volunteers.
  223.  
  224.    The Unicon project is developing an object-oriented language based on
  225.    Icon. For more information, see http://unicon.sourceforge.net. An
  226.    earlier object-oriented extension to Icon, Idol, can be found in the
  227.    Icon program library.
  228.      _________________________________________________________________
  229.  
  230. Support
  231.  
  232.   D1. Is there a users' group for Icon?
  233.  
  234.    There is no official Icon users' group, but The Icon Project maintains
  235.    a moderated "Icon-group" electronic mailing list. To subscribe (or
  236.    unsubscribe), send a message to icon-group-request@cs.arizona.edu.
  237.  
  238.    There is a gateway between Icon-group and comp.lang.icon, an
  239.    unmoderated newsgroup for discussing issues related to Icon. The
  240.    gateway, which exchanges messages between the two systems, is
  241.    imperfect and not under the control of the Icon Project.
  242.  
  243.    The newsgroup generally provides faster response than the mailing list
  244.    and is less intrusive, but it sometimes suffers from inappropriate
  245.    postings. The Icon Project usually sends its announcements and other
  246.    messages to the mailing list.
  247.  
  248.   D2. How do I get technical support?
  249.  
  250.    The Icon Project is not a commercial organization, and its capacity
  251.    for providing technical support is limited. Please use the appropriate
  252.    resource when you need assistance:
  253.      * For programming assistance, submit a query to the mailing list or
  254.        newsgroup (see above).
  255.      * For porting assistance or Unix problems, contact
  256.        icon-project@cs.arizona.edu.
  257.      * For problems with the Windows implementation, contact the
  258.        implementor, jeffery@cs.nmsu.edu.
  259.      * For general information, additional documentation, or mail orders,
  260.        visit the Icon web site: http://www.cs.arizona.edu/icon.
  261.      _________________________________________________________________
  262.  
  263. Programming
  264.  
  265.   E1. Why doesn't read() work with every?
  266.  
  267.    every s := read() do {...} doesn't loop because read() produces a
  268.    single value and then fails if resumed. Other "consumer" procedures
  269.    such as get() and pop() work the same way. Use a while loop with these
  270.    procedures, and save every for use with generators such as !x or
  271.    key(T).
  272.  
  273.   E2. Why doesn't string invocation such as "foo"() work?
  274.  
  275.    String invocation works if the procedure is present; the catch is that
  276.    the linker removes unreferenced procedures. To ensure a procedure's
  277.    presence, reference it in the main() procedure. A simple reference
  278.    suffices, as in refs := [foo, bar, baz]; it's not necessary to
  279.    actually call it.
  280.  
  281.    (Why does the linker remove unreferenced procedures? Because this can
  282.    save huge amounts of memory for programs that use the library.)
  283.  
  284.   E3. How can I call a C function?
  285.  
  286.    You can't call an arbitrary C function, but if you're willing to write
  287.    a function to Icon's specifications, there are two approaches. Under
  288.    Unix, which provides loadfunc(), you can load one or more functions
  289.    from a shared library, and then treat them as if they had been written
  290.    in Icon. Some examples can be found in the cfuncs and packs/loadfuncs
  291.    directories of the Icon program library. The more cumbersome approach
  292.    is to add code to the Icon interpreter and rebuild it; some hooks are
  293.    provided for this purpose. Both approaches are discussed in Calling C
  294.    Functions from Icon, http://www.cs.arizona.edu/icon/docs/ipd240.htm.
  295.  
  296.    The Jcon implementation allows Icon programs to call Java code that is
  297.    written to Jcon specifications.
  298.  
  299.   E4. Can I open a bidirectional pipe?
  300.  
  301.    No, this is not possible. Although the concept is simple -- write a
  302.    line to a program via a pipe, then read that program's output -- it
  303.    probably wouldn't work. Most I/O libraries don't write anything to a
  304.    pipe until they've filled a buffer, and the most likely consequence
  305.    would be a deadlock, with each program waiting for the other to send
  306.    more data.
  307.      _________________________________________________________________
  308.  
  309.    This FAQ is edited by Gregg Townsend. It includes contributions from
  310.    Ralph Griswold, Cliff Hathaway, Clint Jeffery, Bob Alexander, and Todd
  311.    Proebsting.
  312.