v0.1
Stephen Leach edited this page Nov 6, 2021
·
21 revisions
The first draft of Nutmeg aims to provide a basic, stable platform for further development.
- It can be installed and used on Linux and MacOS.
- It will support a command-line based, compile-then-run workflow, exemplified by the
nutmegc
andnutmeg
commands. - The Nutmeg in a Nutshell manual will describe all the features of this release and an overview of the project objectives.
- This release will have sufficient features to be able to process JSON meaningfully; it is not that JSON is an objective so much as a convenient way to summarise a coherent feature set.
- Integer and floating point arithmetic
- Booleans and Null
- Characters, Strings and Symbols
- Lists and iteration over lists, var, const and val lists supported
- Records and iteration over records, var, const and val records supported
- Maps and iteration over maps, var, const and val maps supported
- Refs with var, const and val refs supported
- One signature feature will be implemented, which is sealing. Optional parameters will not be supported.
- Syntax will include
- End-of line comments and Nested comments
- Literal constants for integers and floating point. Decimal radix only (others would be a bonus).
- Literal constants for strings (no interpolation), characters and symbols.
- Literal constants for booleans and null.
- Construction syntax for Lists, Maps and Records
- Top level declarations of the form
def F(E): ... enddef
,def K = ... enddef
(the latter needs confirmation) - Simple declarations of local variables e.g.
x := 99
- Simple assignment of local variables e.g.
x <- 99
- Function calls of the form
F(E)
,E.F
andE.F()
- Updaters of the form
F( E ) <-- E'
,E.F
<-- E'and
E.F() <-- E'` - Arithmetic operators:
+
,-
,/
,*
- Short circuit operators:
and
,or
n.b.not
is a library function - Bitwise operators:
AND
,OR
,NOT
- Range operators:
-
E ... E
, closed range -
E ..<
E'`, half-open range
-
- Discard operator:
STMNTS;;
-
Sequencing:
STMNT1; STMNT2
- Implicit sequencing (using newlines)
-
Conditional forms:
if ... elseif ... else ... endif
ifnot ... elseif ... elseifnot ... else ... endifnot
-
Loops
for ... do ... endfor
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
- Blocks and Modifiers
- Brackets
- Capsules (Proposed)
- Clean Procedures
- Comments
- Copy by Snapshot
- Declarations
- Finesses
- For Syntax
- Futures
- Identifiers
- If Syntax
- Messages
- Pass Syntax
- Queries
- References
- Return Statements
- Sealing
- Semicolons
- 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