Nickle Tutorial

Robert Burgess

Keith Packard

This is a user tutorial for Nickle, a powerful desktop calculator language. Nickle supports many features of advanced languages, as well as arbitrary precision numbers. This tutorial is intended to teach Nickle to someone who is already fairly familiar with programming, using descriptions with examples. Topics are covered progressively, beginning with invocation and commands, moving on to learning the language, and finally to more advanced topics.


Table of Contents
1. Nickle Tour
2. Nickle Basics
2.1. Invocation
2.2. Commands
2.2.1. Expressions
2.2.2. Quit
2.2.3. Print
2.2.4. Undefine
2.2.5. Loading files
2.2.6. Edit
2.2.7. History
3. Language introduction
3.1. Nickle Datatypes
3.1.1. Primitive datatypes
3.1.2. Composite datatypes
3.1.3. Declarations
3.1.4. Initializers
3.1.5. Identifier scope
3.1.6. Storage classes
3.2. Nickle Expressions
3.2.1. Variable declarations
3.2.2. Anonymous function declarations
3.2.3. Binary operators
3.2.4. Unary operators
3.2.5. Constants
3.2.6. Variables
3.2.7. Struct and union references
3.2.8. Array references
3.2.9. The fork operator
3.2.10. Comma operator
3.3. Control Statements in Nickle
3.3.1. Simple statements
3.3.2. Conditionals
3.3.3. Twixt
3.3.4. Switch
3.3.5. Union switch
3.3.6. Loops
3.3.7. Flow control
3.4. Nickle Functions
4. Builtins
4.1. Input and Output
4.1.1. Opening and closing files
4.1.2. Flush
4.1.3. End
4.1.4. Characters and strings
4.1.5. Unicode and characters vs. bytes
4.1.6. Formatted I/O
4.1.7. At the top level
4.2. Math
4.2.1. Numbers
4.2.2. Operators
4.2.3. The Math namespace
4.3. Strings
4.3.1. Operators
4.3.2. String namespace
5. Advanced topics
5.1. Copy Semantics and Garbage Collection
5.1.1. Copy by value
5.1.2. Garbage collection
5.1.3. Type checking and subtyping
5.2. Nickle Namespaces
5.2.1. Extend
5.2.2. Peering inside
5.3. Nickle Exceptions
5.3.1. Raise
5.3.2. Try - catch
5.3.3. Twixt
5.4. Threads and Mutual Exclusion in Nickle
5.4.1. Basic threading
5.4.2. Thread functions
5.4.3. Mutual exclusion
5.4.4. An example
5.4.5. Semaphores
5.5. Nickle Continuations