{"id":13605374,"url":"https://github.com/CrowdHailer/eyg-lang","last_synced_at":"2025-04-12T05:32:53.257Z","repository":{"id":38077860,"uuid":"386258665","full_name":"CrowdHailer/eyg-lang","owner":"CrowdHailer","description":"Experiments in building \"better\" languages and tools; for some measure of better.","archived":false,"fork":false,"pushed_at":"2025-03-26T16:17:54.000Z","size":13263,"stargazers_count":228,"open_issues_count":8,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T05:17:08.076Z","etag":null,"topics":["functional-programming","gleam","programming"],"latest_commit_sha":null,"homepage":"https://eyg.run/","language":"Gleam","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrowdHailer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-15T11:03:40.000Z","updated_at":"2025-03-29T13:52:04.000Z","dependencies_parsed_at":"2023-11-22T20:24:17.701Z","dependency_job_id":"6455ceda-8644-4c0b-b32d-9bbd1e29f1d2","html_url":"https://github.com/CrowdHailer/eyg-lang","commit_stats":{"total_commits":1719,"total_committers":1,"mean_commits":1719.0,"dds":0.0,"last_synced_commit":"fc3c6d02582eaa914a270c54b6008b47dea53986"},"previous_names":["crowdhailer/eyg-lang"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdHailer%2Feyg-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdHailer%2Feyg-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdHailer%2Feyg-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdHailer%2Feyg-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrowdHailer","download_url":"https://codeload.github.com/CrowdHailer/eyg-lang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248524203,"owners_count":21118609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["functional-programming","gleam","programming"],"created_at":"2024-08-01T19:00:57.950Z","updated_at":"2025-04-12T05:32:51.572Z","avatar_url":"https://github.com/CrowdHailer.png","language":"Gleam","funding_links":[],"categories":["Gleam"],"sub_categories":[],"readme":"# Eat Your Greens (EYG)\n\n**Experiments in building \"better\" languages and tools; for some measure of better.**\n\n## Philosophy\n\n\"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.\n\nProjects in this repo introduce extra contraints, over regular programming languages and tools. By doing so more guarantees about the system can be given.\n\nFor example; EYG the language has only managed effects which gives the guarantee a program will never crash.\n\nI have experimented with this priciple to build actor systems, datalog engines and others.\nFor more context on these experiments you can view my devlog, short videos of experiments as they develop https://petersaxton.uk/log/.\n\nHowever most work in this repository is now focused on EYG the language.\n\n## Getting started\n\n### Run an EYG program\n\n```sh\n# Write the hello world program to the file `hello.json`.\n# Code in EYG is structured (not a text file) we'll get back to this.\necho '{\"0\":\"a\",\"f\":{\"0\":\"p\",\"l\":\"Log\"},\"a\":{\"0\":\"s\",\"v\":\"Hello, World!\"}}' \u003e hello.json\n\n# Run the hello world program using the JavaScript interpreter in your shell.\ncat hello.json | npx eyg-run\n```\n\nThis example requires `node` and `npx` is installed on your machine.\n\nEYG can be run in a variety of places using different interpreters/compilers.\nOr it can be run in any environment by implementing your own.\n\nEYG is a very small language and designed to be easy to implement.\nThe JS interpreter (used in the introduction above) is \u003c500 lines of code.\nView [the source](./packages/javascript_interpreter/src/interpreter.mjs) for details.\n\nOther interpreters in this repo:\n\n- Gleam\n- Go\n\n### Writing an EYG program\n\n#### Use the EYG structured editor.\n\nhttps://eyg.run/drafting/\n\nThis tool is used to manipulate the program tree directly.\nIt is nice because you can never write an invalid program.\nHowever, you can't type text as you are used to.\n\n#### Write the JSON by hand.\n\nFollow the [spec](./ir/README.md) for the EYG Intermediate Representations(IR) to write your program by hand.\n\nThis is not recommented, but is a useful thing to do if you want to try writing your own tooling.\n\n#### Bring your own syntax and parser.\n\nIf you find syntax interesting or like opinions your can bring the syntax you choose.\nAny syntax that is parsed to an EYG Intermediate Representations(IR) can be used.\n\nMost [language tutorial](https://craftinginterpreters.com/contents.html) start with parsing syntax if you want a place to start.\nOnce you have a working parser you can use EYG to have a working program.\n\nSomething like this would be great.\n\n```sh\ncat hello.eyg | yourparser | npx @eyg-run\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCrowdHailer%2Feyg-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCrowdHailer%2Feyg-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCrowdHailer%2Feyg-lang/lists"}