Pen programming language

GitHub Action License Twitter

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")?


main = \(ctx context) none {
  e = sayHello(ctx.Os)

  if _ = e as none {
  } else if error {
    Process'Exit(ctx.Os, 1)


See Install.



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.


Minimal language

  • Its syntax and type system are small, simple, and easy to learn.
  • Yet, the language supports all the modern features.

Concurrent/parallel computation

  • The language and its runtime enables thread-safe concurrent/parallel computation.
  • For more information, see Concurrency and parallelism.

System packages

  • System packages encapsulate side effects as separate packages.
  • No other packages have side effects unless injected them into explicitly.

Reliable testing

  • Unit tests are always deterministic and fast.
  • No flaky or slow tests bother developers.

Even more...

  • 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.