Pen is the parallel, concurrent, and functional programming language for scalable software development, focused on software maintainability and portability.
import Core'Number
import Os'File
# The `\` prefix for λ denotes a function.
findAnswer = \(kind string) number {
# Secret source...
21
}
main = \(ctx context) none {
# The `go` function runs a given function in parallel.
# `x` is a future for the computed value.
x = go(\() number { findAnswer("humanity") })
y = findAnswer("dolphins")
_ = File'Write(ctx, File'StdOut(), Number'String(x() + y))
none
}
Pen aims to make large-scale software development efficient where many engineers 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 yet full featured.
- Testability: Tests are always fast and reliable.
- Flexibility: Developers can change codes easily without regression.
- 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.
- Tests are always deterministic and fast.
- Tests are side-effect free and independent from test environment.
- There is no built-in system library dependent on platforms.
- Developers choose system packages suitable for their applications.
- System packages encapsulate platform-dependent codes and side effects.
- No other kind of package causes side effects without explicit injection.
- No runtime exception
- Memory safe
- No undefined behavior
- No data race
- 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.