Elfie

A little code.A lot of magic.

Meet Elfie, a programming language for an agentic world.

The Elfie language

A real programming language that treats your agent as a compiler.Codify your requirements, shape the logic, and keep building.

Why Choose Elfie

Get Deterministic Outcomes

The Elfie language is built around specifying exactly what the outcomes of any piece of code are. And the compiler is built to enforce those outcomes are true.

transform.lfy
fn minify(input: string): `Strips extra space` -> string {
  @acceptanceCriteria
    .add({
      situation = `Input is code`,
      behavior = `Preserve spaces in literals`,
    });
  @test.add({
    input = [`  remove      extra   space     `],
    output = `remove extra space`,
  });
}
The call hashFile(file, Algo.SHA256) points up to the signature hashFile(toHash: File, algorithm: Algo): string, which hashes the contents of a file with a specified algorithm; its file argument points to const file: `File to verify`, and Algo.SHA256 points to enum Algo { SHA256 = 'sha256' }.

Empowers Agents Beyond Text

The Elfie compiler is also an MCP server that empowers the agent to explore code, types, output and anything else it needs without needing to read or grep files. It’s like finally giving your agent its own IDE.

Compile to Any Languages

Compile Elfie code to any language that your agent can write. Or, teach your agent a brand new langauge and compile to that! You can also compile to multiple languages from the same code

signup.lfy
fn signup(email: string) -> User {
  where (`[[email]] is already in DB`) -> `Throw error`;
  where (`[[email]] not in DB`) -> `Save it`;
}
elfie compile
  • Rust
  • Go
  • Typescript
  • Python
  • C#
  • C++
signup.rs
#[derive(Debug, thiserror::Error)] 
pub enum SignupError { 
    #[error("{0} is already registered")] 
    EmailAlreadyRegistered(String), 
    #[error(transparent)] 
    Db(#[from] DbError), 
} 
 
// Compiled from fn signup 
pub fn signup(store: &impl UserStore, email: &str) -> Result<User, SignupError> { 
    if store.exists_by_email(email)? { 
        return Err(SignupError::EmailAlreadyRegistered(email.to_owned())); 
    } 
    Ok(store.insert_user(email)?) 
}