Pen is the programming language for scalable software development, focused on software maintainability and portability.
import Os'Context { Context }
import Os'File
import Os'Process
sayHello = \(ctx Context) none | error {
File'Write(ctx, File'StdOut(), "Hello, world!\n")?
none
}
main = \(ctx context) none {
e = sayHello(ctx.Os)
if _ = e as none {
none
} else if error {
Process'Exit(ctx.Os, 1)
}
}
See Install.
- Getting started
- Language reference
- Code examples
Pen aims to make large-scale software development efficient where a number of people develop software together for a long time. To realize that, it focuses on software maintainability and portability.
- Maintainability
- Simplicity: The language is small and easy to learn but also full featured.
- Testability: Unit tests are always fast and reliable.
- Modifiability: Developers can change application logic independently from implementation details.
- Portability
- Programs written in Pen can be ported to different platforms including WebAssembly.
- Its syntax and type system are small, simple, and easy to learn.
- Yet, the language supports all the modern features.
- The language and its runtime enables thread-safe concurrent/parallel computation.
- For more information, see Concurrency and parallelism.
- System packages encapsulate side effects as separate packages.
- No other packages have side effects unless injected them into explicitly.
- Unit tests are always deterministic and fast.
- No flaky or slow tests bother developers.
- Static typing
- Immutable values
- Pure functions by default
- Errors as values
- Asynchronous I/O
- Cross compile
- Rust/C Foreign Function Interface (FFI)
Pen is dual-licensed under MIT and Apache 2.0.