Clinton L. Jeffery and Hani Bani-Salameh
March 11, 2010
Unicon Technical Report #12
Abstract
![]() |
http://unicon.org/utr/utr12.html Department of Computer Science University of Idaho Moscow, ID 83844 |
Even Ui's very "simple" goals are complicated by the fact that the tool needs to run on any machine where Unicon runs with graphics facilities enabled. At this time, this primarily consists of UNIX-based systems that run the X Window System, such as Linux, Solaris, Mac OS X, and Microsoft Windows-based machines. There is a practical minimal screen resolution limit, probably around 800x600 for this tool.
Ui is a product of the Unicon Project and is a standard part of the
Unicon programming language distribution, developed under the GPL, hosted on
Source Forge, and downloaded from the web site at http://unicon.org.
If you are not already familiar with Unicon you may wish to consult
other technical reports from that site, such as UTR #7[2], along with
this one.
Windows Unicon and the Ui environment are based on
the volunteer work of many people; final responsibility for this release
rests with Clinton Jeffery of University of Idaho.
Send requests, and bug reports to
jeffery@cs.uidaho.edu.
You can easily select an existing Unicon source file, or name a new one.
If you click "Open" without choosing a name, you will be given the default
name of "noname.icn". Unicon source files generally must use the extension
.icn and should be plain text files without line numbers or
other extraneous information. Editing your program occurs within the main
Ui window, which might look like this:
The top area shows program source code, while the bottom portion shows messages such as compiler errors. You can change the font and the number of lines used to show messages from the Edit menu.
When you are done editing your program, you can save it, compile it, or just "make" (save, compile and link an executable) and run your program with menu options. The Arguments command in the Run... menu let's you specify any command-line arguments the program should be given when it is executed.
Run-time errors also result in a message for which the source line is
highlighted. The message for a run-time error includes Unicon's standard
traceback of procedures from main() to the procedure in which
the error occurred. When the error messages get long, you can either
increase the number of lines for the message window (as was done here) or
scroll through the message window's entire text using the scrollbar.
.icn source file, Ui switches the editor and compile and
link commands to work on a different program.
Project files are plain text files with extension .icp. They
list source files, one file per line. When you open a project file, Ui goes
into "project mode", and adds the source files in the project to your File
menu, allowing you to switch easily between files in the project. If you
subsequently open a source file not in the project, Ui asks if you want to
add that source file to the project, or switch out of project mode and edit
that file as a separate program. In general, project files allow you to
"make" large projects efficiently. Underneath the covers, Ui invokes the
other Unicon program executables to do the work of compiling and running
programs, described below.
When Ui "makes" a program executable, it recompiles those modules listed in
the project file whose modified time is newer than their corresponding
object files. On the other hand, Ui knows nothing about link declarations
embedded in source files, and recompilation will not be triggered by such
dependencies. When you use Ui, you should generally use link statements for
library files (such as Unicon Program Library modules), and use
.icp files for your own sources. Files listed in the .icp file
must not also be referenced in a link statement; linking the same module
twice causes link errors. For projects, the executable .bat
that is produced by "make" is named after the first program in the project
file.
The font in the edit window can be picked from the Font... command in the Edit menu. The number of lines to use for messages can be picked with the Message window... menu item in the Edit menu.
The font and message line options, as well as a default window width and
height, may be specified in a file called ui.ini
that Ui reads when it starts up. The file ui.ini
from the current directory is used, unless a UNICONINI environment
variable is set, in which case it is taken to be the pathname of
the initialization file that Ui is to use. An example ui.ini
file is the following:
width=800 height=800 font=times,28 msglines=3
Many Bothan spies died to bring us this information. -- Mon MothmaIn the early 1990's, a prominent member of the Icon community (Bob Goldberg, if I recall correctly) did a very rough prototype IDE for Icon on Windows, which whetted our appetite for this category of tool. An M.S. student at UTSA, Steve Schiavo, did a second prototype IDE in Borland Delphi. These efforts featured basic editing, compiling, and executing but were not feature complete and never released.
Clint Jeffery ported Icon's graphics facilities to Windows while at UTSA, as part of his agreed contribution for the book "Graphics Programming in Icon"[3]. An IDE (along with a setup.exe installer) was considered essential for the Windows Icon distribution. In order to minimize external language- and compiler-dependencies, and in order to test and demonstrate the functionality of Windows Icon, Schiavo's IDE was reimplemented in Icon by Clint Jeffery as a program called Wi (Windows icon). In order to provide an attractive, native-looking GUI, Windows95 native dialogs (the Win* functions) were added to the language specifically for use in Wi. The Wi program was modified slightly to form Wu (Windows unicon) when that language was invented.
Although the Wu program was nice, it was limited to only run on Windows, and made extensive use of Windows-only native GUI functions. Even on Windows it had some nasty limitations, such as a 32kb file size limit imposed by the classic native windows text editor widget. After Robert Parlett contributed his wonderful GUI class library, which supported fonts and colors, it became ever more desirable to build a Unicon IDE that would run on all Unicon platforms. There were multiple failed attempts, such as Bryan Ross's RUDE (Ross' Unicon Development Environment).
Finally, the Ui program was developed by Clint Jeffery, using Parlett's
IVIB interface builder and adapting code from Wu. Unfortunately, various
elements of Wu were not replicated immediately in Ui, and it has only
gradually progressed towards a complete or usable feature set. Its toolbar was
added by Nolan Clayton. Syntax coloring was added by Luis Alvidrez.
Hani bani Salameh ported it to version 2 of the GUI classes. It is by now
the work of several people, and remains very small and lacks features compared
with mainstream IDE's. However, it continues to evolve.
2. Clinton Jeffery, Version 11 of Unicon for Microsoft Windows, http://unicon.org/utr/utr7.html, 2006.
3. Gregg M. Townsend, Ralph E. Griswold, and Clinton L. Jeffery, Graphics Facilities for the Unicon Programming Language Version 9.3, The Univ. of Arizona Icon Project Document IPD281, 1996.