-
Notifications
You must be signed in to change notification settings - Fork 0
Leakproof
In Nutmeg, a procedure is said to be leakproof if it makes no read or write reference, directly or indirectly, to mutable store. Because of this, a leakproof procedure cannot change any mutable store except the store it is passed as input arguments. Nor can its behaviour be modified by external mutation. Being leakproof is an important property in Nutmeg because it means that only the inputs and outputs matter.
For example, this is a leaky procedure. leakyProc is leaky because it references accumulator which is bound to a mutable list.
val accumulator = MutableList()
def leakyProc( x ):
accumulator.add( x )
end
By contrast, this is a leakproof procedure:
const alphabet = 'abcdefghijklmnopqrstuvwxyz'
[leakproof]
def positionInAlphabet( ch ):
alphabet.indexOf( ch )
end
N.B. If a procedure is not leakproof, it does not necessarily mean that it leaks. It only means we have no automatic assurance it does not leak.
Design Principles
- Nutmeg Design Goals
- The Spirit of Nutmeg
- Syntax Design
- State Encapsulation
- List of Design Decisions
- Influences
Language Features
- $$-Syntax (Echo Expressions)
- Actors
- Allocators
- Annotations
- Assignments
- Bindings
- Brackets
- Capsules (Proposed)
- Clean Procedures
- Coroutines
- Comments
- Copy by Snapshot
- Declarations
- Finesses
- For Syntax
- Futures
- Identifiers
- If Syntax
- Let Expressions and Blocks
- Messages
- Pass Syntax
- Queries
- References
- Return Statements
- Sealing
- Semicolons
- Streams and Iterators
- Strings
- Switch Syntax
Built-in Libraries and Functions
Implementation
- Architecture in one page
- Autoconversion
- Bundle Files
- Code-Trees
- Compiler Pipeline
- Components of the Compiler
- Installation File Structure
- Mishaps
- Peekable Pushable Generators
- Recursive Descent Parser
- Resolver
- Walkthrough of Hello-World
How-Tos
Process