The Boring Programming Language (Boring-Lang) is an attempt to create an easy, productive, general purpose programming language that makes as few interesting choices as possible while still being in line with modern concepts in programming languages.
All variables are immutable by default, to make them mutable use the `mut` keyword. Once a variable becomes immutable it cannot become mutable again. If you need it to become mutable, either implement the `copy` trait, or simply create a new one with the same data.
```
let mut foo := Dict<String, Int32>{
'eggs': 12,
'bananas': 2,
}
// fine
foo.insert('grapes', 2)
let bar = foo // bar is not mutable
bar.insert('apples', 4) // fails with compiler error
let mut baz = bar.copy()
baz.insert('apples', 4) // fine
```
Methods on a struct must specify if they mutate the struct.
Context is an exceptionally useful feature in golang, but a common complaint is that:
1. Because it works as an arbitrary map, it can be used to pass arguments into a function that aren't explicitly stated.
2. It is used for both passing context parameters and cancellation, two fundamentally different tasks that have no reason to be in the same object.
The boring standard library solves this by using parametric polymorphism. Context is by default an empty object passed through the chain, and each function/set of context parameters is an additional trait condition applied at compile time.
if !(await ctx.is_cancelled()) { // check cancel token
await handler(ctx, req, resp)
}
await resp.set_status(400)
await resp.write('cancelled')
}
}
```
for the above examples, you would pass a context type that implements all three traits.
## Monadic function modifiers
Boring uses function modifiers to implement functionality like `async/await` and `coroutines`. These function by rewriting the AST prior to compilation. The table below describes the modifiers currently available.
Similar to python, folders/files represent the `.` seperated import path though relative imports are *not* supported. Exported values must be marked with `pub`. All imports take the form: