# Icon on Macintosh

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

www.cs.arizona.edu/icon/v951/macintosh.htm
Last updated June 18, 2012

## 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. X11 starts automatically when 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 is available free from Apple's Mac App Store.

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.