Plasma Syntax to Concept Map

Paul Bone
version 0.1, April 2017
Draft. Copyright © 2017 Plasma Team License: CC BY-SA 4.0
Table of Contents

The purpose of this document is to show for each syntax-ish thing, what the underlying concept is. This should help us design the language on a coherent way. It is not intended as user documentation.


Table 1. Brackets




( )

Expression grouping, parameter lists (functions, types & structs)

Familiar to many programmers

{ }


[ ]

Lists (arbitrary size)

Lists, for loop parameters (unimplemented), array indexing.

[- -] or [ ]


Future, maybe use the ~ or - to denote whether it’s a lazy list or a parallel stream (channel).

[: :]

Arrays (fixed size sequences)

[% %] or [# #] or something else?



Table 2. Symbols






/* */


_ (underscore)


Used instead of variables in patterns, arguments and the LHS of assignments

\*, /, %, +, \-

Arithmetic operators


Unary minus

Similar concept as subtraction

<, >, , >=, ==, !=

Comparison operators

and, or, not

Logical operators

Not really "symbols" in the character ranges meaning of the word, but included here alongside other operators.


Concatenation operator


Parameter separation

in function results, argument lists (functions and types) and field lists, loop dot products.


Wildcard (in import/export lists), Multiplication


"or" in structure and type alternatives, "join" in lists and other structures.


"and" cross product in loop inputs.

Future, maybe, "and" doesn’t mean "cross" or "by".


"has type"


Scope qualification (access something from within another scope)


"results in"

Used to separates a function’s return values from its inputs, may be used in lambda expressions also.


"gets", different from "let"

Part of loop syntax, unimplemented.



The LHS (a new variable) is given the value of the RHS (also in struct construction and deconstruction). Or in type declarations, the type name on the LHS has the set of values from the RHS. Or in list outputs and reductions (unimplemented). In all of these cases the meaning is "let".


"store" or "write"

The value on the LHS is updated with the RHS, this makes sense for arrays.



added to a function call to indicate that it uses or observers a resource.



Future: For ranges, eg in array slicing.





Future: state variable syntax



Reserved in case I ever want to add pointer manipulation a la PAWNS.




Unused: Maybe string formatting?


Table 3. Issues



[ ]

This usually means a sequence but is also used for array indexing. That appears to be in conflict, however using [ ] for lists and array indexing will be familiar from other languages.


Used in type and structure expressions to mean "or" and struct, list etc manipulation to mean "join".

{}, _() and {: :}

Minor issue, I kinda like {} for code and dictionaries and structures. But (so far) I’ve chosen to avoid these conflicts.