# Icon on Macintosh

Gregg M. Townsend
Department of Computer Science
The University of Arizona

www.cs.arizona.edu/icon/v950/macintosh.htm
Last updated November 19, 2009

## Introduction

Because Mac OS X is based on Unix, it can run Icon. There is no special Macintosh interface, so as a practical matter Icon on the Mac is for those who are comfortable using a Unix shell in a Terminal window.

The command-line interface to Icon is described by Unix man pages. The `icon` command executes a program from a single source file. An Icon program in a simple text file `prog.icn` is executed by typing `icon prog.icn`. The more general `icont` command, modeled after the Unix cc command, supports multiple files, separate compilation, and other features.

## Co-Expressions

Because MacOS does not implement anonymous semaphores, each co-expression creates an open file. Programs with hundreds of active co-expressions may abort with a `cannot create semaphore` system error. The open file limit can be raised from the typical default of 256 using a `limit descriptors n` or `ulimit -nS n` command, depending on the shell.

## Graphics

For graphics, Icon uses the X Window System, generally called X11 in Macintosh documentation. Beginning with Mac OS 10.5 (Leopard), X11 starts automatically when needed, and no advance preparations are needed. An X11 icon appears in the dock when an Icon graphics program is run and persists innocuously afterward.

## Building Icon

Building Icon from source requires the Xcode toolbox, which comes on the OS X installation disk.

Icon is built in a Terminal window. The process is the same as on other platforms and uses the configuration named `macintosh`. See Building Icon for detailed instructions.