Pen programming language
Pen is the programming language that makes software development scalable, focusing on software maintainability and portability.
import System'Context { Context }
import System'File
sayHello = \(ctx Context) none | error {
File'Write(ctx, File'StdOut(), "Hello, world!\n")?
none
}
main = \(ctx Context) number {
e = sayHello(ctx)
if e = e as none {
0
} else if error {
1
}
}
Install
See Install.
Documentation
- Getting started
- Language reference
- Code examples
Vision
Pen aims to make large-scale software development efficient where a number of people develop software together. 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 reliable, fast, and independent with each other.
- Modifiability: Developers can change application logic without changing implementation details, and vice versa.
- Portability
- Programs written in the language can be ported to different platforms including WebAssembly.
Features
Minimal language
- Its syntax and type system are small, simple, and easy to learn.
- Yet, the language supports all the modern features, such as:
- Functional programming
- Effect system
- Dependency injection
- Asynchronous operations
- Parallel computation
Deterministic testing
- All unit tests are deterministic.
- Therefore, testing is always reliable and fast.
- You never get bothered by flaky or slow tests.
System injection
- System injection is a novel mechanism to isolate application logic from implementation details.
- The language injects system functions into applications explicitly.
- Developers can even define their own system functions.
Others
- Static typing
- Immutable values
- Pure functions by default
- Errors as values (no runtime error)
- Cross compile
- Rust/C foreign function interface
Work in progress...
Asynchronous operation
Functions can be called asynchronously to run multiple tasks concurrently.
Parallel computation
The runtime and library provide tools for thread-safe parallel computation that leverage multi-core CPUs.
License
Pen is released under open source licenses. See its LICENSE file for more information.