Generated by DeepSeek V3.2| Icon (programming language) | |
|---|---|
| Name | Icon |
| Paradigm | Multi-paradigm |
| Designer | Ralph Griswold |
| Developer | University of Arizona |
| Released | 0 1977 |
| Latest release version | 9.5.24i |
| Latest release date | 31 May 2024 |
| Influenced | Unicon, Python, Go |
Icon (programing language). Icon is a high-level, general-purpose programming language notable for its novel approach to control flow and string processing. It was created by Ralph Griswold and his team at the University of Arizona in the late 1970s, evolving from earlier work on the SNOBOL language. The language is characterized by its goal-directed evaluation, built-in data types for managing strings and structures, and a rich set of operators for text analysis.
The development of Icon began in 1977 under the leadership of Ralph Griswold, a prominent computer scientist known for his work on SNOBOL. The project originated at the University of Arizona as an effort to create a successor to SNOBOL that retained its powerful string manipulation capabilities while offering a more conventional and efficient syntax. Early versions were implemented in Ratfor and later in C, which became the standard implementation. The language's design was heavily influenced by the concepts explored in the SL5 language. Major contributions to its development came from researchers like Madge T. Griswold and David R. Hanson. The definitive reference, *The Icon Programming Language*, was published by Ralph Griswold and Madge T. Griswold.
Icon introduces several distinctive features, most notably its goal-directed evaluation mechanism, where expressions can produce sequences of results and control flow is driven by success or failure. It provides extensive built-in support for string and list processing, with operations like string scanning modeled on the pattern-matching of SNOBOL. The language includes advanced data types such as tables and sets, and supports co-expressions, a form of coroutine for advanced control structures. Its type system is dynamic, and automatic storage management is provided through garbage collection. These features made it particularly adept for tasks in text analysis, prototyping, and compiler writing.
The syntax of Icon is reminiscent of C and Pascal, using semicolons as statement terminators and braces to delimit blocks. Its semantics, however, are defined by expression evaluation rather than statements. A core concept is that expressions are generators that can produce multiple values, and operators like alternation (`|`) and conjunction (`&`) control backtracking. The string scanning environment, initiated by operators like `?`, provides a context for matching and extraction operations. Structures like procedures, co-expressions, and invocable entities are first-class values. Error handling is managed through built-in functions and failure propagation, rather than exception constructs common in languages like Java.
The canonical implementation of Icon is a interpreter written in C, making it highly portable across systems like Unix, Windows, and Linux. The source code is freely available under a permissive license. The most significant variant is Unicon, which extends Icon with features for object-oriented programming, database connectivity, and 3D graphics. Other academic derivatives and experimental versions have explored integrating Icon concepts with functional paradigms or enhancing its performance through JIT compilation. The implementation effort has been sustained primarily by the University of New Mexico and other academic contributors.
A classic example is the Hello World program: `procedure main(); write("Hello, world"); end`. More illustrative of Icon's power is a program to find all words in a string: `every write(find("the", "the quick brown fox"))` leverages generators. A program demonstrating string scanning and pattern matching might use constructs like `?subject & while tab(upto(&letters)) do write(tab(many(&letters)))` to extract words. These examples showcase the language's concise syntax for text operations, contrasting with more verbose approaches in languages like Fortran or COBOL. Sample programs are distributed with the language's implementation from the University of Arizona.
Icon has been used extensively in areas requiring sophisticated text manipulation, such as compiler construction, natural language processing, and data cleaning. It served as a teaching tool in computer science curricula at institutions like the University of Arizona and University of California, Irvine. Its most direct influence is on its successor, Unicon. Concepts from Icon, particularly its goal-directed evaluation and powerful string handling, have inspired features in later languages, including the generators in Python and the `range` concept in Go. The language's design principles contributed to discussions on programming language theory and non-standard control structures.
Category:Programming languages Category:SNOBOL programming language family Category:University of Arizona