Wipple’s syntax was designed with just a few rules and balances punctuation
with English words, making it a great first programming language. Instead of
sticking with conventional names like print
, Wipple uses more
intuitive names like show
.
greet : name -> format "Hello, _!" name
show (greet "world") -- Hello, world!
Wipple has a powerful type system that checks your mistakes to prevent crashes at runtime. You can document a function’s behavior using a type annotation, or let Wipple figure out the types for you. And you can use traits to extend existing code with new behavior.
Person : type {
name :: Text
age :: Number
}
instance (Show Person) : { name age } ->
format "_ is _ years old" name age
bob : Person {
name : "Bob"
age : 30
}
show bob -- Bob is 30 years old
Instead of using if
, Wipple’s when
expression
enables you to check complex conditions with ease. Before your code even
runs, Wipple ensures that it handles all possible conditions — no surprises
in production.
report-card :: Grade -> Text
report-card : grade -> when grade {
A -> "top of the class"
B -> "good job"
C -> "need to study"
D or F -> "didn't pass"
}
Start coding right now in the Wipple Playground. Works on any device.
The Wipple Guide has tutorials for experienced programmers coming from languages like JavaScript and Python.