Hamilton C shell

From Infogalactic: the planetary knowledge core
Jump to: navigation, search
Hamilton C shell
Hamilton C shell x64 on Windows 7.png
64-bit Hamilton C shell on a Windows 7 desktop.
Original author(s) Nicole Hamilton
Initial release December 12, 1988; 35 years ago (1988-12-12)
Stable release 5.2 / September 15, 2014; 9 years ago (2014-09-15)
Written in C
Operating system Windows
Type Unix Shell on Windows
License Commercial proprietary software
Website www.hamiltonlabs.com/Cshell.htm

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, its compiler architecture, its use of threads, and the decision to follow Windows rather than Unix conventions.[8][9]

Parser

Hamilton C shell and Cygwin bash on Windows 7, showing the use of recursion for factoring.

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.[13] 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.[1][8] As a result, statements can be nested arbitrarily.[6]

Threads

Hamilton C shell and Cygwin bash date loops.

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.[14]

Windows conventions

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

References

  1. 1.0 1.1 Early Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. The author has discussed her transition from Douglas Hamilton on a panel discussion at Stanford, beginning at 29:37. Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. 6.0 6.1 6.2 Lua error in package.lua at line 80: module 'strict' not found.
  7. Lua error in package.lua at line 80: module 'strict' not found.
  8. 8.0 8.1 8.2 8.3 Lua error in package.lua at line 80: module 'strict' not found.
  9. 9.0 9.1 9.2 Lua error in package.lua at line 80: module 'strict' not found.
  10. Hamilton C shell for Windows Release Notes 4.0, retrieved June 19, 2010.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.
  13. Csh Programming Considered Harmful by Tom Christiansen
  14. Lua error in package.lua at line 80: module 'strict' not found.

External links