Hamilton C shell explained

Hamilton C shell
Screenshot Size:300px
Author:Nicole Hamilton
Latest Release Version:5.2.g
Programming Language:C
Operating System:Windows (historically OS/2)
Genre:Unix Shell on Windows
License:Commercial proprietary software

Hamilton C shell is a clone of the Unix C shell and utilities[1] [2] for Microsoft Windows created by Nicole Hamilton[3] 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[4] [5] [6] [7] [8] [9] and on Windows NT in July 1992.[10] [11] [12] The OS/2 version was discontinued in 2003 but the Windows version continues to be actively supported.

Design

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

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 type interactively but not very well for 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.[13]

By contrast, Hamilton uses a top-down recursive descent parser that allows it to compile statements to an internal form before running them.[1] [8] As a result, statements can be nested or piped arbitrarily.[6] The language has also been extended with built-in and user-defined procedures, local variables, floating point and additional expression, editing and wildcarding operators, including an "indefinite directory" wildcard construct written as "..." that matches zero or more directory levels as required to make the rest of the pattern match.[14]

Threads

Lacking fork or a high performance way to recreate that functionality, Hamilton uses the Windows threads facilities instead.[6] [8] 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.[15]

Windows conventions

Hamilton differs from other Unix shells in that it also directly supports Windows conventions for drive letters, filename slashes, escape characters, etc.[9]

External links

Notes and References

  1. Early Book: Hamilton C shell Quick Reference. Hamilton Laboratories, Wayland, MA. Jul 10, 1990. July 28, 2016.
  2. Faught . Danny . The shell game . Software QA Magazine . 3 . 4 . Aug 31, 1996 . Apr 8, 2013 . dead . https://web.archive.org/web/20120301104503/http://tejasconsulting.com/sqamag/shell.html . March 1, 2012 .
  3. The author has discussed her transition from Douglas Hamilton on a panel discussion at Stanford, beginning at 29:37. Nicole Hamilton, Carl Ingram, Liz Kennedy Myers, Tom Mills, John Ordway, Scott Thatcher, Kirstie Wilde (Moderator). Class of 1972 Panel Discussion: Hell No We Won't Go (Quietly Into the Night)!. Stanford Alumni Association, iTunes U. Nov 28, 2007. July 28, 2016.
  4. Machlis. Sharon. Wayland writer for IBM. Middlesex News. Dec 18 1988. 2E. July 28, 2016.
  5. Sussman. Ann. Hamilton C Shell Speeds Development Of OS/2 Applications. PC Week. Dec 26 1988 – Jan 2 1989. 37. July 28, 2016.
  6. Hamilton. Douglas A.. Hamilton C shell Announcement. IBM Personal Systems Developer. Summer 1989. 119–121. July 28, 2016.
  7. Richman. Scott. Examining the Hamilton C Shell. Dr. Dobb's Journal. Jan 1991. July 28, 2016.
  8. Goutal. Kenneth G.. The Hamilton C shell. MIPS Magazine. Sep 1989. July 28, 2016.
  9. Yager. Tom. OS/2, Unix Style. BYTE Magazine. Feb 1990. July 28, 2016.
  10. https://hamiltonlabs.com/ReleaseNotes.htm Hamilton C shell for Windows Release Notes 4.0
  11. Hamilton, Doug. Looking for C-Shell on NT. Jul 27, 1995. comp.os.ms-windows.nt.misc. hamilton.806823765@BIX.com. Oct 8, 2010.
  12. Deignan. Michael P.. Hamilton C Shell. Windows IT Pro. March 31, 1998. September 22, 2019.
  13. http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ Csh Programming Considered Harmful
  14. Web site: Wildcarding and pattern matching. Hamilton Laboratories. August 13, 2018.
  15. Hamilton, Doug. Suggestions for multiple-reader/single-writer lock?. Apr 21, 1995. comp.os.ms-windows.nt.misc. hamilton.798430053@BIX.com. July 28, 2016.