-
Notifications
You must be signed in to change notification settings - Fork 234
Updating Nu
Tim Burks edited this page Jul 28, 2019
·
2 revisions
- S-expression grammar.
- Macros and special-purpose operators (e.g. Markup generation)
- Built-in code formatting.
- Easy integration with C code using an Objective-C runtime.
- Explicit support for Protocol Buffer serialization and deserialization.
- Protocol Buffer representation of parsed code and program state.
- Packages for high-level code organization.
- Data structures represented as messages. Composition used instead of inheritance.
- Methods as functions bound to messages.
- Dot notation for concise access to package and message members.
- Keyword arguments for functions and methods.
- Freezable state for transporting running programs between servers.
operator | description |
---|---|
package | Declare a package. A package can contain messages, services, and functions. |
message | Declare a message. A message is a collection of fields and optional functions. |
service | Declare a service. A service is a collection of rpcs. |
rpc | Declare a remote procedure call. |
func | Define a function. Functions can be anonymous or named and optionally associated with messages. |
set | Create a variable and set it or modify an existing variable. |
car cdr cons | Every Lisp needs these basic list manipulation operators. |
All of these (except character and error) can be used in a message declaration to declare a field. All can be used as operators to “cast” a value to the associated type or return nil if the value is not representable with that type.
operator | description |
---|---|
map | Associative map. |
array | Array (repeated field). |
error | Get an error from a value or return nil if there is no error. |
double float | Floating-point types |
int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 | Integer types |
bool | Boolean |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. |
bytes | May contain any arbitrary sequence of bytes. |
character | UTF-8 code point. May not be used in messages (use int32 instead). |
enum | 32-bit integer |
oneof | Groups fields so that at most one can be set. |
operator | description |
---|---|
go | Start a concurrent process |
condition.new | Create a condition variable |
operator | description |
---|---|
if then else | |
cond else | |
while |
operator | description |
---|---|
quote | Quote an expression. |
eval | Evaluate an expression. |
defer | Evaluate an expression at the end of the current block, implicitly quoting the expression. |
operator | description |
---|---|
+ - * / | |
eq ne |
operator | description |
---|---|
puts | |
reads | |
putf | |
readf |
Messages can be declared with expressions, stored to variables, and used to call protoc plugins.
File descriptor sets can be read and parsed into package descriptions, and then displayed as expressions.