EYG

A programming language for predictable, useful and confident development.

Penelopea, EYG's mascot

Predictable:

programs are deterministic, dependencies are immutable

Useful:

run anywhere, managed effects allow programs to declare runtime requirements

Confident:

A sound structural type system guarantees programs never crash

Run anywhere, safely.

EYG programs are sandboxed by default. All possible side effects are managed.
Each runtime exposes it's own focused set of effects. The snippets on this page browser specific effects like Prompt and Download
The effects of a program can be statically inferred before running it ensure your program can successfully run in the given context.
Read more about the effects
let string = @standard:1.string
let ask = perform Prompt("What is your name?")
let name = match ask {
Ok (name) -> name
Error (_) -> "World"
}
let greeting = string.append("Hello, ", name)
perform Alert(greeting)
release undefined: @standard:1

Never crash

Guarantee that a program will never crash by checking it ahead of time. EYG can check that your program is sound without the need to add any type annotations.
EYG's type system builds upon a proven mathematical foundation by using row typing.
let user = {age: 71, name: "Eve"}
let total = !int_add(10, "hello")
let address = user.address
sum
type missmatch given: Integer expected: String
missing row 'address'
missing variable 'sum'
Click on error message to jump to error.

Handle effects

Any effect can be intercepted using a handler. Provide a response to you effect without any side effects.
Handling effects is great for testing; if all effects are handled then your program is deterministic. No more flakey tests.
Read the effects documentation.
let exec = (_) -> {
let _ = perform Alert("hello world!")
"done"
}
handle Alert(
(value, resume) -> {
let {alerts: alerts, return: return} = resume({})
{alerts: [value, ..alerts], return: return}
},
(_) -> {
let return = exec({})
{alerts: [], return: return}
},
)
{
  alerts: [
    "hello world!"
  ]
  return: "done"
}
Click above to run and edit.

Named references

Use an ecosystem of helpful packages to work faster. Share code with anyone using your unique handle.
Signing up for account names is in closed beta for now. Get in touch to find out more
Read the reference documentation.
let {http: http} = @standard:1
let request = http.get("catfact.ninja")
let request = http.path(request, "/fact")
match perform Fetch(request) {
Ok ({body: body}) -> !string_from_binary(body)
Error (_) -> Error({})
}
release undefined: @standard:1

Iterate fast with a shell

EYG already has a prototyped strongly typed shell environment.
We need to get it ready and bring it to you.
Stay up to date join the mailing list.

An ecosystem of runtimes

EYG is built to support multiple runtimes. You have already seen this with closure serialisation
In the future EYG will be available in many more places, e.g. arduino, CLI's and IPaaS.
EYG makes this easy by having a carefully designed minimal AST.
Stay up to date join the mailing list.
Want to stay up to date?
Join our mailing list.