The programming language of epic poetry
Epos is a functional statically-typed programming language that compiles to LLVM IR.
Epos draws inspiration from Lua, Nim, Elixir, and Gleam (in no particular order).
Example code
(#
Simple program in Epos
#)
fn each(lst: list(t), fun: fn(t), index: int = 0)
lst.elem(index).fun()
match index < len(lst) - 1 then
true => each(lst, fun, index + 1)
end
end
record Book
title: string
author: string
date: string
end
books: list(Book) = {
@{
title => "Fear and Trembling",
author => "Johannas de Silentio",
date => "1843"
}, @{
title => "Either/Or",
author => "Victor Eremita",
date => "1843"
}, @{
title => "Concluding Unscientific Postscript",
author => "Johannas Climacus",
date => "1846"
}
}
books.each(fn(book: Book) => print([[
Title: #{book.title}
Author: #{book.author}
Date: #{book.date}
]]))
(#
Running `epos -r simple-program.epos` returns this result:
Executable created: build/simple-program
Running build/simple-program...
Title: Fear and Trembling
Author: Johannas de Silentio
Date: 1843
Title: Either/Or
Author: Victor Eremita
Date: 1843
Title: Concluding Unscientific Postscript
Author: Johannas Climacus
Date: 1846
#)
- Run
nix run github:epos-lang/epos -- init <project-name>to create a new project - In the new directory, run
epos -r <project-name>/main.eposto run the program
- This is in active development