You are on page 1of 4

Scilla

LANGUAGE GRAMMAR

Ilya Sergey

ilyasergey.net
Zilliqa Team
ngapore and United Kingdom
zilliqa.com Types
Primitive type P ::= Int Integer
me seman- String String
contracts Hash Hash
he key lan- BNum Block number
cipline for Address Account address
ted formal
Type T , S ::= P primitive type
Map P T map
Message message
T -> S value function
e the chal- D hTk i instantiated data type
n Z������ type variable
tax, static, forall .T polymorphic function
nteraction
Expressions (pure) Term Meaning Description

Expression e ::= f simple expression


let x h: T i = f in e let-form
Simple expression f ::= l primitive literal
x variable
{ hentry ik } Message
fun (x : T ) => e function
builtin b hx k i built-in application
x hx k i application
tfun => e type function
@x T type instantiation
C h {hTk i} i hx k i constructor instantiation
match x with h | sel k i end pattern matching
Selector sel ::= pat => e
Pattern pat ::= x variable binding
C hpat k i constructor pattern
( pat ) paranthesized pattern
_ wildcard pattern
Message entrry entry ::= b :x
Name b identi�er
Statements (effectful)
s ::= x <- f read from mutable field
f := x store to a field
x = e assign a pure expression
match x with̻pat => s̼end pattern matching and branching
x <- &B read from blockchain state
accept accept incoming payment
send ms send list of messages

You might also like