Puneet Varma (Editor)

Hamilton C shell

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Original author(s)
  
Nicole Hamilton

Operating system
  
Windows

Written in
  
C

Type
  
Unix Shell on Windows

Initial release
  
December 12, 1988; 28 years ago (1988-12-12)

Stable release
  
5.2.g / March 5, 2017; 10 days ago (2017-03-05)

Hamilton C shell is a clone of the Unix C shell and utilities for Microsoft Windows created by Nicole Hamilton at Hamilton Laboratories as a completely original work, not based on any prior code. It was first released on OS/2 on December 12, 1988 and on Windows NT in July 1992. The OS/2 version was discontinued in 2003 but the Windows version continues to be actively supported.

Contents

Design

Hamilton C shell differs from the Unix C shell in several respects, its compiler architecture, its use of threads, and the decision to follow Windows rather than Unix conventions.

Parser

The original C shell uses an ad hoc parser. This has led to complaints about its limitations. It works well enough for the kinds of things users typed interactively but not very well on the more complex commands a user might take time to write in a script. It is not possible, for example, to pipe the output of a foreach statement into grep. There was a limit to how complex a command it could handle.

By contrast, Hamilton uses a top-down recursive descent parser that allows it to compile commands and procedures to an internal form before running them. As a result, statements can be nested arbitrarily.

Threads

Lacking fork or a high performance way to recreate that functionality, Hamilton uses the Windows threads facilities instead. When a new thread is created, it runs within the same process space and it shares all of the process state. If one thread changes the current directory or the contents of memory, it's changed for all the threads. It's much cheaper to create a thread than a process but there's no isolation between them. To recreate the missing isolation of separate processes, the threads cooperate to share resources using locks.

Windows conventions

Hamilton differs from other Unix shells in that it follows Windows conventions instead of Unix conventions for filename slashes, escape characters, etc.

References

Hamilton C shell Wikipedia


Similar Topics