Skip to content

epos-lang/epos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Epos

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

#)

Getting Started

  • 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.epos to run the program

Notes:

  • This is in active development

About

The Epos Programming Language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published