Building better languages and tools; for some measure of better.
See the codeEYG is a scripting language with structural typing, managed effects and immutable dependencies.
Install the CLI with:
curl -fsSL https://eyg.run/install | bash
A hello world example script.
#!/usr/bin/env eyg
{
script: (_) -> {
let _ = perform StandardOut("Hello, World!\n")
0
}
}
Update permissions chmod +x entry.eyg.
Then run the script directly ./entry.eyg.
Any file containing valid source code is a module.
The file containing just 5 is a module.
An EYG script is a function from the list of script arguments to a returned exit code.
The type of a script function is (List(String)) -> Integer
A valid script module has a script function as a field of a record.
The type of a script file/module is {script: (List(String)) -> Int, ..}.
Run a script using eyg script path/to/script.
An entryfile is the first module run. It can be a valid script file and, because records are extensible, have other fields. For example a module with a "shell" field is a valid shell config.
Top-level modules may be executable and have a shebang (#!/usr/bin/env eyg).
The example below works as a script and shell config.
// entry.eyg
let tests = import "./path/to/tests.eyg"
{
script: (arguments) -> {
let counts = test({})
match !equal(counts.failed, 0) {
True({}) -> { 0 }
False({}) -> { 1 }
}
},
shell: (_) -> {
perform Break({})
}
}
Start the shell with eyg shell entry.eyg
Run all the tests with eyg script entry.eyg
EYG is a strongly typed replacement for bash, make and shell tools in general.
Type check your whole project, application and scripts with eyg check entry.eyg
Use eyg eval for evaluating pure values, no side effects, and printing the result.
packages/gleam_cli/README.md.guides/managing_signatories.md.guides/syntax.md.!builtin is catalogued in guides/builtins_reference.md../guides/cli_effects_reference.md.guides/file_resolution.md../guides/install_from_source.md.The intermediate representation (IR) of EYG is a minimal tree and is the stable interface for writing EYG programs. Type checking, syntax, evaluation or compilation are optional components built on this foundation.
This repository contains the language definition, implementation, website and package hub.
EYG makes it easy to swap out components of the toolchain. A sensible reason could be to create a runtime with a unique set of effects, i.e. embed EYG in a game or website. Another reason could be to imagine your own syntax, or even visual editor, and reuse the EYG interpreter and packages.
The source for packages maintained as a standard library i.e. standard and json.
Other packages in this collection are for demo purposes i.e. catfact
The overlay package contains access policy helpers for CLI effects.
Building better languages and tools; for some measure of better.
"Eat Your Greens" is a reference to the idea that eating vegetables is good for you, however the benefit is only realised at some later time.
Projects in this repo introduce extra contraints, over regular programming languages and tools. By doing so more guarantees about the system built on them can be given.
Over the last few years the Eat Greens Principle to build actor systems, datalog engines. A record of these experiments is at https://petersaxton.uk/log/. The code for these experiments is no longer available if you want to ask more about them reach out to me directly
Gleam
96.1%
CSS
1.5%
Building better languages and tools; for some measure of better.
See the codeEYG is a scripting language with structural typing, managed effects and immutable dependencies.
Install the CLI with:
curl -fsSL https://eyg.run/install | bash
A hello world example script.
#!/usr/bin/env eyg
{
script: (_) -> {
let _ = perform StandardOut("Hello, World!\n")
0
}
}
Update permissions chmod +x entry.eyg.
Then run the script directly ./entry.eyg.
Any file containing valid source code is a module.
The file containing just 5 is a module.
An EYG script is a function from the list of script arguments to a returned exit code.
The type of a script function is (List(String)) -> Integer
A valid script module has a script function as a field of a record.
The type of a script file/module is {script: (List(String)) -> Int, ..}.
Run a script using eyg script path/to/script.
An entryfile is the first module run. It can be a valid script file and, because records are extensible, have other fields. For example a module with a "shell" field is a valid shell config.
Top-level modules may be executable and have a shebang (#!/usr/bin/env eyg).
The example below works as a script and shell config.
// entry.eyg
let tests = import "./path/to/tests.eyg"
{
script: (arguments) -> {
let counts = test({})
match !equal(counts.failed, 0) {
True({}) -> { 0 }
False({}) -> { 1 }
}
},
shell: (_) -> {
perform Break({})
}
}
Start the shell with eyg shell entry.eyg
Run all the tests with eyg script entry.eyg
EYG is a strongly typed replacement for bash, make and shell tools in general.
Type check your whole project, application and scripts with eyg check entry.eyg
Use eyg eval for evaluating pure values, no side effects, and printing the result.
packages/gleam_cli/README.md.guides/managing_signatories.md.guides/syntax.md.!builtin is catalogued in guides/builtins_reference.md../guides/cli_effects_reference.md.guides/file_resolution.md../guides/install_from_source.md.The intermediate representation (IR) of EYG is a minimal tree and is the stable interface for writing EYG programs. Type checking, syntax, evaluation or compilation are optional components built on this foundation.
This repository contains the language definition, implementation, website and package hub.
EYG makes it easy to swap out components of the toolchain. A sensible reason could be to create a runtime with a unique set of effects, i.e. embed EYG in a game or website. Another reason could be to imagine your own syntax, or even visual editor, and reuse the EYG interpreter and packages.
The source for packages maintained as a standard library i.e. standard and json.
Other packages in this collection are for demo purposes i.e. catfact
The overlay package contains access policy helpers for CLI effects.
Building better languages and tools; for some measure of better.
"Eat Your Greens" is a reference to the idea that eating vegetables is good for you, however the benefit is only realised at some later time.
Projects in this repo introduce extra contraints, over regular programming languages and tools. By doing so more guarantees about the system built on them can be given.
Over the last few years the Eat Greens Principle to build actor systems, datalog engines. A record of these experiments is at https://petersaxton.uk/log/. The code for these experiments is no longer available if you want to ask more about them reach out to me directly
Gleam
96.1%
CSS
1.5%